question.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>广西自学考试网上系统</title>
  5. <meta charset="UTF-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  7. <!--<link rel="stylesheet" href="https://unpkg.com/element-ui@2.4.11/lib/theme-chalk/index.css">-->
  8. <!--<link rel="stylesheet" href="https://unpkg.com/element-ui@2.4.11/lib/theme-chalk/index.css">-->
  9. <link rel="stylesheet" href="https://lib.baomitu.com/element-ui/2.12.0/theme-chalk/index.css">
  10. <script src="https://lib.baomitu.com/jquery/1.12.4/jquery.min.js"></script>
  11. <script src="./vendor/md5/md5.js" type="text/javascript"></script>
  12. <script src="./js/tool.js"></script>
  13. <script src="https://lib.baomitu.com/vue/2.5.17/vue.min.js"></script>
  14. <script src="https://lib.baomitu.com/element-ui/2.4.11/index.js"></script>
  15. <script>
  16. function keyDown(){
  17. if (event.keyCode==13) //回车键的键值为13
  18. document.getElementById("loginBtn").click(); //调用登录按钮的登录事件
  19. }
  20. </script>
  21. </head>
  22. <body onkeydown="keyDown();">
  23. <div id="particles-js"></div>
  24. <div id="app">
  25. <div class="center" v-show="loaded">
  26. <div class="content">
  27. <el-card class="box-card" style="position: absolute;top: 20%;width: 380px;min-height: 350px;max-height: 380px;">
  28. <div slot="header" class="clearfix" style="text-align: center;">
  29. <span>设置密保问题</span>
  30. </div>
  31. <el-form ref="loginForm" :model="loginForm" :rules="loginFormRule">
  32. <form class="el-form">
  33. <div class="el-form-item">
  34. <div class="el-form-item__content">
  35. <div class="el-input el-input-group el-input-group--prepend">
  36. <div class="el-input-group__prepend" style="padding-left: 5px;padding-right: 5px;color: black">
  37. &nbsp;&nbsp;&nbsp;&nbsp;问题
  38. </div>
  39. <el-select v-model="loginForm.question" filterable placeholder="请选择问题" style="width:285px;">
  40. <el-option label="我的出生地" value="我的出生地"></el-option>
  41. <el-option label="我就读的小学" value="我就读的小学"></el-option>
  42. <el-option label="我母亲的名字" value="我母亲的名字"></el-option>
  43. <el-option label="我父亲的名字" value="我父亲的名字"></el-option>
  44. <el-option label="我最好的朋友的名字" value="我最好的朋友的名字"></el-option>
  45. </el-select>
  46. </div>
  47. </div>
  48. </div>
  49. <div class="el-form-item">
  50. <div class="el-form-item__content">
  51. <div class="el-input el-input-group el-input-group--prepend">
  52. <div class="el-input-group__prepend" style="padding-left: 5px;padding-right: 5px;color: black">
  53. &nbsp;&nbsp;&nbsp;&nbsp;答案
  54. </div>
  55. <input v-model="loginForm.answer" maxlength="32"
  56. type="text" autocomplete="off" placeholder="请填写答案" class="el-input__inner">
  57. </div>
  58. </div>
  59. </div>
  60. <div class="el-form-item">
  61. <div class="el-form-item__content">
  62. <div class="el-input el-input-group el-input-group--prepend">
  63. <div class="el-input-group__prepend" style="padding-left: 5px;padding-right: 5px;color: black">
  64. 校验码
  65. </div>
  66. <input v-model="validateCode" maxlength="4"
  67. type="text" autocomplete="off" placeholder="校验码" class="el-input__inner">
  68. <i v-if="validateCode_check==1" class="fa fa-check-circle-o fa-lg" style="font-size: 22px; position: absolute;top: 15px;right: 100px;height: 80%;color:#67C23A"></i>
  69. <i v-if="validateCode_check==0" class="fa fa-times-circle-o fa-lg" style="font-size: 22px; position: absolute;top: 15px;right: 100px;height: 80%;color: #F56C6C"></i>
  70. <i v-if="validateCode_check=='loading'" class="fa fa-spinner fa-lg" style="font-size: 22px; position: absolute;top: 15px;right: 100px;height: 80%;color: blue"></i>
  71. <img :src="validateCodesrc" @click="freshImg" style="cursor:pointer; position: absolute;top: 5px;right: 2px;height: 80%;">
  72. </div>
  73. </div>
  74. </div>
  75. </form>
  76. <div v-if="errorInfo" >
  77. <div style="margin-bottom: 5px;">
  78. <div role="alert" class="el-alert el-alert--error" size="mini" style=" font-size:10px;">
  79. <i class="fa fa-info-circle fa-lg"></i>
  80. <div class="el-alert__content">{{errorInfo}}
  81. <i class="el-alert__closebtn fa fa-window-close fa-lg" @click="errorInfo = null"></i>
  82. </div>
  83. </div>
  84. </div>
  85. </div>
  86. <el-form-item>
  87. <span style="width:100%" v-show="!isLogin">
  88. <el-button type="primary" id="loginBtn" class="btn-long" @click="login('loginForm')">确定</el-button>
  89. <a style="cursor:pointer; position: absolute;top: 35px;right: 2px;height: 80%;" href="javascript:void(0)" @click="goPhone()">绑定手机</a>
  90. </span>
  91. <span style="width:100%" v-show="isLogin">
  92. <el-button type="primary" id="loginBtn" class="btn-long" @click="goLogin()">返回登陆页面</el-button>
  93. </span>
  94. </el-form-item>
  95. </el-form>
  96. </el-card>
  97. </div>
  98. </div>
  99. </div>
  100. </body>
  101. <script>
  102. new Vue({
  103. el: '#app',
  104. computed: {
  105. validateCodesrc: function() {
  106. this.randomnum = Date.parse(new Date());
  107. return basePath + "/std/validateCode.htm?"+this.randomnum;
  108. },
  109. },
  110. watch: {
  111. validateCode: function(newValue, oldValue) {
  112. if(newValue && newValue.length ==4){
  113. this.validateCode_check = "loading";
  114. var this_ = this;
  115. //请求验证 校验码
  116. ajaxRequest("", '/std/stdRegInfo/checkValidateCode.htm', {validateCode:this.validateCode}, function (resp) {
  117. if (resp.success) {
  118. this_.validateCode_check = 1;
  119. } else {
  120. this_.validateCode_check = 0;
  121. }
  122. })
  123. }
  124. },
  125. },
  126. data: function () {
  127. return {
  128. showInfo:true,
  129. randomnum:null,
  130. validateCode_check:null,
  131. loaded: false,
  132. isLogin:false,
  133. logoPath: "",
  134. productName: "广西自考报考系统",
  135. errorInfo: null,
  136. validateCode: "",
  137. isMutiAccount:false,
  138. selection:null,
  139. accountArrayloading:false,
  140. loginForm: {
  141. question: "",
  142. answer: "",
  143. validateCode:"",
  144. std_id:""
  145. },
  146. loginFormRule: {
  147. question: [{
  148. required: true,
  149. message: "请填写问题",
  150. trigger: "blur"
  151. }],
  152. answer: [{
  153. required: true,
  154. message: "请填写答案",
  155. trigger: "blur"
  156. }],
  157. validateCode: [{
  158. required: true,
  159. message: "请填写校验码",
  160. trigger: "blur"
  161. }]
  162. }
  163. }
  164. },
  165. mounted: function() {
  166. },
  167. created: function() {
  168. this.loaded = true;
  169. },
  170. methods: {
  171. freshImg: function(){
  172. this.randomnum = Date.parse(new Date());
  173. },
  174. goLogin: function() {
  175. window.location.href = "./login.html";
  176. },
  177. goPhone: function() {
  178. window.location.href = "./phone.html";
  179. },
  180. login: function () {
  181. this.errorInfo = null;
  182. var _this = this;
  183. if(!this.loginForm.question){
  184. this.errorInfo = "请填写问题";
  185. return;
  186. }
  187. if(!this.loginForm.answer){
  188. this.errorInfo = "请填写答案";
  189. return;
  190. }
  191. if(!this.validateCode){
  192. this.errorInfo = "请填写校验码";
  193. return;
  194. }
  195. var rtn = window.confirm("确定设置密保问题吗?(请妥善保管好问题答案,方便以后找回密码)");
  196. if(rtn){
  197. var answer_md5 = hex_md5(this.loginForm.answer);
  198. var cloneLoginForm = JSON.parse(JSON.stringify(this.loginForm));
  199. cloneLoginForm.answer = answer_md5;
  200. cloneLoginForm.validateCode = this.validateCode;
  201. let std_id = '';
  202. let uerStr = localStorage.getItem("user");
  203. if(uerStr){
  204. let user = JSON.parse(uerStr);
  205. if(user){
  206. std_id = user.id;
  207. }
  208. }
  209. cloneLoginForm.std_id = std_id;
  210. ajaxRequest("", '/std/setQuestion.htm', cloneLoginForm, function (resp) {
  211. if (resp.success) {
  212. if(!resp.login){
  213. _this.errorInfo = "请先登陆后再设置密保问题!";
  214. _this.freshImg();
  215. _this.validateCode = "";
  216. _this.isLogin = true;
  217. }else{
  218. _this.$alert("恭喜您,成功设置密保问题。请牢记密保问题和答案!", '信息提示', {
  219. confirmButtonText: '确定', callback: function() {
  220. window.location.href = "../#/index";
  221. }
  222. });
  223. }
  224. } else {
  225. _this.errorInfo = resp.errorMsg;
  226. _this.freshImg();
  227. _this.validateCode = "";
  228. }
  229. })
  230. }
  231. }
  232. }
  233. });
  234. </script>
  235. <style scoped>
  236. .home {
  237. display: flex;
  238. flex-direction: column;
  239. height: 100vh;
  240. }
  241. .school-logo {
  242. margin-left: -300px;
  243. }
  244. .header {
  245. min-height: 120px;
  246. display: grid;
  247. }
  248. .center {
  249. position: absolute;
  250. top: 0;
  251. left: 0;
  252. right: 0;
  253. bottom: 0;
  254. background-position: center;
  255. background-repeat: no-repeat;
  256. background-size: cover;
  257. opacity: 0.8;
  258. filter: alpha(opacity = 20);
  259. }
  260. .content {
  261. margin-top: 100px;
  262. margin-left: 35%;
  263. width: 380px;
  264. /* height: 300px; */
  265. border-radius: 6px;
  266. background-color: white;
  267. display: grid;
  268. grid-template-areas: "";
  269. }
  270. .login-type {
  271. flex: 1;
  272. line-height: 40px;
  273. background-color: #eeeeee;
  274. }
  275. .active-type {
  276. background-color: #ffffff;
  277. }
  278. .close {
  279. position: absolute;
  280. top: 0;
  281. right: 0;
  282. background-color: #eeeeee;
  283. color: #999999;
  284. width: 80px;
  285. height: 40px;
  286. line-height: 40px;
  287. }
  288. .close:hover {
  289. color: #444444;
  290. }
  291. .btn-long {
  292. width: 100%;
  293. }
  294. body {
  295. margin: 0px 0px
  296. }
  297. .group__prepend{
  298. padding: 0px 10px !important;
  299. }
  300. .el-alert {
  301. margin: 20px 0 0;
  302. }
  303. .el-alert--error {
  304. background-color: #fef0f0 !important;
  305. color: #f56c6c;
  306. }
  307. .el-alert {
  308. width: 100%;
  309. padding: 8px 16px;
  310. margin: 0;
  311. box-sizing: border-box;
  312. border-radius: 4px;
  313. position: relative;
  314. background-color: #fff;
  315. overflow: hidden;
  316. opacity: 1;
  317. display: flex;
  318. align-items: center;
  319. transition: opacity .2s;
  320. }
  321. .artcle-title {
  322. margin-top: 25px !important;
  323. font-family: "Microsoft YaHei", "微软雅黑字体";
  324. color: #4c4c4c !important;
  325. font-size: 23px !important;
  326. text-align: center !important;
  327. font-weight: bold !important;
  328. }
  329. .artcle-detail {
  330. padding-top: 20px;
  331. line-height: 30px;
  332. font-size: 18px;
  333. }
  334. </style>
  335. </html>