password.html 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834
  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. <!-- import CSS -->
  8. <!-- <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css"> -->
  9. <!--<link rel="stylesheet" href="https://unpkg.com/element-ui@2.4.11/lib/theme-chalk/index.css">-->
  10. <!--<link rel="stylesheet" href="https://unpkg.com/element-ui@2.4.11/lib/theme-chalk/index.css">-->
  11. <link rel="stylesheet" href="https://lib.baomitu.com/element-ui/2.12.0/theme-chalk/index.css">
  12. <link rel="stylesheet" href="./css/icons.css">
  13. <link href="./vendor/step/bootstrap.min.css" rel="stylesheet">
  14. <link href="./vendor/step/gloab.css" rel="stylesheet">
  15. <script src="./vendor/md5/md5.js" type="text/javascript"></script>
  16. <!--<script src="https://cdn.polyfill.io/v2/polyfill.min.js"></script>-->
  17. </head>
  18. <body>
  19. <div id="app" style="width:60%;left:20%;position:absolute;margin: 10px 10px">
  20. <el-card v-show="loaded" style="display: none" class="box-card" v-loading="loading" element-loading-text="初始化数据加载中...">
  21. <div slot="header" class="clearfix">
  22. <div style="text-align: center;font-size: 15px;">
  23. 密码修改
  24. </div>
  25. </div>
  26. <center>
  27. <div style="width: 725px">
  28. <el-tabs type="border-card">
  29. <el-tab-pane label="手机号码">
  30. <el-form ref="stdRegInfo" :model="stdRegInfo" :rules="stdRegInfoRule" label-width="100px">
  31. <el-row>
  32. <el-col :span="24">
  33. <el-form-item label="姓名:" prop="std_name">
  34. <el-input v-model="stdRegInfo.std_name" maxlength="18" placeholder="请填写姓名" style="width:400px;"></el-input>
  35. </el-form-item>
  36. </el-col>
  37. </el-row>
  38. <el-row>
  39. <el-col :span="24">
  40. <el-form-item label="证件号:" prop="cert_no">
  41. <el-input v-model="stdRegInfo.cert_no" maxlength="18" placeholder="请填写证件号" style="width:400px;"></el-input>
  42. </el-form-item>
  43. </el-col>
  44. </el-row>
  45. <el-row>
  46. <el-col :span="24">
  47. <el-form-item label="手机号:" prop="std_mobile">
  48. <el-input v-model="stdRegInfo.std_mobile" maxlength="11" placeholder="请填写手机号" style="width:400px;"></el-input>
  49. </el-form-item>
  50. </el-col>
  51. </el-row>
  52. <el-row>
  53. <el-col :span="24">
  54. <el-form-item label="验证码:" prop="code">
  55. <el-input v-model="stdRegInfo.code" ng-readonly="true" maxlength="6" placeholder="请点击发送验证码获取短信验证码" style="width:400px;"></el-input>
  56. </el-form-item>
  57. </el-col>
  58. </el-row>
  59. <el-row>
  60. <el-col :span="24">
  61. <el-form-item>
  62. <div style="width:500px;">
  63. <el-button type="primary" @click="sendSms" :loading="checkLoading" :disabled="secCountDown>0">{{secCountDownInfo}}</el-button>
  64. <el-button type="primary" @click="checkSms" :loading="checkLoading">身份验证</el-button>
  65. <el-button @click="goLogin">返回登录页面</el-button>
  66. </div>
  67. </el-form-item>
  68. </el-col>
  69. </el-row>
  70. <el-row v-show="canSubmit==true">
  71. <el-col :span="24">
  72. <el-form-item label="新密码:" prop="std_pass1">
  73. <el-input type="password" v-model="stdRegInfo.std_pass1" placeholder="包含字母,数字,特殊字符至少8个字符" style="width:400px;"></el-input>
  74. </el-form-item>
  75. </el-col>
  76. </el-row>
  77. <el-row v-show="canSubmit==true">
  78. <el-col :span="24">
  79. <el-form-item label="密码确定:" prop="std_pass2">
  80. <el-input type="password" v-model="stdRegInfo.std_pass2" style="width:400px;"></el-input>
  81. </el-form-item>
  82. </el-col>
  83. </el-row>
  84. <el-row v-show="canSubmit==true">
  85. <el-col :span="24">
  86. <div style="text-align: center;margin-bottom: 3px">
  87. <!-- <el-form-item> -->
  88. <div style="margin-top: 10px;margin-left: 220px">
  89. <el-button type="primary" @click="onSubmit">提交修改信息</el-button>
  90. <el-button @click="goLogin">返回登录页面</el-button>
  91. </div>
  92. </div>
  93. </el-col>
  94. </el-row>
  95. </el-form>
  96. </el-tab-pane>
  97. <el-tab-pane label="账号或密保问题">
  98. <el-form ref="stdRegInfo" :model="stdRegInfo" :rules="stdRegInfoRule" label-width="100px">
  99. <el-row>
  100. <el-col :span="24">
  101. <el-form-item label="姓名:" prop="std_name">
  102. <el-input v-model="stdRegInfo.std_name" maxlength="18" placeholder="请填写姓名" style="width:400px;"></el-input>
  103. </el-form-item>
  104. </el-col>
  105. </el-row>
  106. <el-row>
  107. <el-col :span="24">
  108. <el-form-item label="证件号:" prop="cert_no">
  109. <el-input v-model="stdRegInfo.cert_no" maxlength="18" placeholder="请填写证件号" style="width:400px;"></el-input>
  110. </el-form-item>
  111. </el-col>
  112. </el-row>
  113. <el-row>
  114. <el-col :span="24">
  115. <el-form-item label="准考证号:" prop="ticket_no" v-show="!isTicketNo">
  116. <el-input v-model="stdRegInfo.ticket_no" maxlength="18" placeholder="请填写准考证号" style="width:400px;"></el-input>
  117. </el-form-item>
  118. </el-col>
  119. </el-row>
  120. <el-row>
  121. <el-col :span="24">
  122. <el-form-item label="问题:" prop="question" v-show="!isQuestion">
  123. <el-select v-model="stdRegInfo.question" filterable placeholder="请选择问题" style="width:400px;">
  124. <el-option label="我的出生地" value="我的出生地"></el-option>
  125. <el-option label="我就读的小学" value="我就读的小学"></el-option>
  126. <el-option label="我母亲的名字" value="我母亲的名字"></el-option>
  127. <el-option label="我父亲的名字" value="我父亲的名字"></el-option>
  128. <el-option label="我最好的朋友的名字" value="我最好的朋友的名字"></el-option>
  129. </el-select>
  130. </el-form-item>
  131. </el-col>
  132. </el-row>
  133. <el-row>
  134. <el-col :span="24">
  135. <el-form-item label="答案:" prop="answer" v-show="!isQuestion">
  136. <el-input v-model="stdRegInfo.answer" ng-readonly="true" maxlength="32" placeholder="请填写答案" style="width:400px;"></el-input>
  137. </el-form-item>
  138. </el-col>
  139. </el-row>
  140. <el-row>
  141. <el-col :span="24">
  142. <el-form-item>
  143. <div style="width:500px;">
  144. <el-button type="primary" @click="checkInfo" :loading="checkLoading">身份验证</el-button>
  145. <el-button type="primary" @click="secondcheckInfo" :loading="checkLoading" v-show="!isQuestion || !isTicketNo">二次验证</el-button>
  146. <el-button @click="goLogin">返回登录页面</el-button>
  147. </div>
  148. </el-form-item>
  149. </el-col>
  150. </el-row>
  151. <!-- <el-row>
  152. <el-col :span="24">
  153. <el-form-item label="手机号:">
  154. <div v-if="stdRegInfo.std_mobile">
  155. <span style="width:200px">{{stdRegInfo.std_mobile}}</span> &nbsp; <el-button type="default" :disabled="secCountDown>0" @click="sendPhoneVcode()">{{secCountDownInfo}}</el-button>
  156. </div>
  157. <div v-if="!stdRegInfo.std_mobile">
  158. <font style="color:red">请先验证考生信息</font>
  159. </div>
  160. </el-form-item>
  161. </el-col>
  162. </el-row>
  163. <el-row>
  164. <el-col :span="24">
  165. <el-form-item label="短信验证码:">
  166. <el-input v-model="stdRegInfo.validate_code" maxlength="5" placeholder="请填写短信验证码"></el-input>
  167. </el-form-item>
  168. </el-col>
  169. </el-row>
  170. -->
  171. <el-row v-show="canSubmit==true">
  172. <el-col :span="24">
  173. <el-form-item label="新密码:" prop="std_pass1">
  174. <el-input type="password" v-model="stdRegInfo.std_pass1" placeholder="包含字母,数字,特殊字符至少8个字符" style="width:400px;"></el-input>
  175. </el-form-item>
  176. </el-col>
  177. </el-row>
  178. <el-row v-show="canSubmit==true">
  179. <el-col :span="24">
  180. <el-form-item label="密码确定:" prop="std_pass2">
  181. <el-input type="password" v-model="stdRegInfo.std_pass2" style="width:400px;"></el-input>
  182. </el-form-item>
  183. </el-col>
  184. </el-row>
  185. <el-row v-show="canSubmit==true">
  186. <el-col :span="24">
  187. <div style="text-align: center;margin-bottom: 3px">
  188. <!-- <el-form-item> -->
  189. <div style="margin-top: 10px;margin-left: 220px">
  190. <el-button type="primary" @click="onSubmit">提交修改信息</el-button>
  191. <el-button @click="goLogin">返回登录页面</el-button>
  192. </div>
  193. <!-- <div class="footer abs-bottom">
  194. <center>
  195. <font style="font-size: 15px">
  196. 启明禾木软件 @ 2019
  197. </font>
  198. </center>
  199. </div> -->
  200. <!-- </el-form-item> -->
  201. </div>
  202. </el-col>
  203. </el-row>
  204. </el-form>
  205. </el-tab-pane>
  206. <el-tab-pane label="电子邮件">
  207. <el-form ref="stdRegInfo" :model="stdRegInfo" :rules="stdRegInfoRule" label-width="100px">
  208. <el-row>
  209. <el-col :span="24">
  210. <el-form-item label="姓名:" prop="std_name">
  211. <el-input v-model="stdRegInfo.std_name" maxlength="18" placeholder="请填写姓名" style="width:400px;"></el-input>
  212. </el-form-item>
  213. </el-col>
  214. </el-row>
  215. <el-row>
  216. <el-col :span="24">
  217. <el-form-item label="证件号:" prop="cert_no">
  218. <el-input v-model="stdRegInfo.cert_no" maxlength="18" placeholder="请填写证件号" style="width:400px;"></el-input>
  219. </el-form-item>
  220. </el-col>
  221. </el-row>
  222. <el-row>
  223. <el-col :span="24">
  224. <el-form-item label="电子邮箱:" prop="std_email">
  225. <el-input v-model="stdRegInfo.std_email" maxlength="60" placeholder="请填写电子邮箱" style="width:400px;"></el-input>
  226. </el-form-item>
  227. </el-col>
  228. </el-row>
  229. <el-row>
  230. <el-col :span="24">
  231. <el-form-item label="验证码:" prop="code">
  232. <el-input v-model="stdRegInfo.code" ng-readonly="true" maxlength="6" placeholder="请点击发送邮件获取邮件验证码" style="width:400px;"></el-input>
  233. </el-form-item>
  234. </el-col>
  235. </el-row>
  236. <el-row>
  237. <el-col :span="24">
  238. <el-form-item>
  239. <div style="width:500px;">
  240. <el-button type="primary" @click="sendMail" :loading="checkLoading" :disabled="secMailCountDown>0">{{secMailCountDownInfo}}</el-button>
  241. <el-button type="primary" @click="checkMail" :loading="checkLoading">身份验证</el-button>
  242. <el-button @click="goLogin">返回登录页面</el-button>
  243. </div>
  244. </el-form-item>
  245. </el-col>
  246. </el-row>
  247. <el-row v-show="canSubmit==true">
  248. <el-col :span="24">
  249. <el-form-item label="新密码:" prop="std_pass1">
  250. <el-input type="password" v-model="stdRegInfo.std_pass1" placeholder="包含字母,数字,特殊字符至少8个字符" style="width:400px;"></el-input>
  251. </el-form-item>
  252. </el-col>
  253. </el-row>
  254. <el-row v-show="canSubmit==true">
  255. <el-col :span="24">
  256. <el-form-item label="密码确定:" prop="std_pass2">
  257. <el-input type="password" v-model="stdRegInfo.std_pass2" style="width:400px;"></el-input>
  258. </el-form-item>
  259. </el-col>
  260. </el-row>
  261. <el-row v-show="canSubmit==true">
  262. <el-col :span="24">
  263. <div style="text-align: center;margin-bottom: 3px">
  264. <!-- <el-form-item> -->
  265. <div style="margin-top: 10px;margin-left: 220px">
  266. <el-button type="primary" @click="onSubmit">提交修改信息</el-button>
  267. <el-button @click="goLogin">返回登录页面</el-button>
  268. </div>
  269. </div>
  270. </el-col>
  271. </el-row>
  272. </el-form>
  273. </el-tab-pane>
  274. <el-row>
  275. <el-col :span="24">
  276. <div style="text-align: left;margin-bottom: 3px">
  277. <div style="margin-top: 10px;margin-left: 0px;color:red;">
  278. 温馨提醒:账号未绑定手机或电子邮箱,请点击“账号或密保问题”切换页面,通过账号或密保问题修改密码。
  279. </div>
  280. </div>
  281. </el-col>
  282. </el-row>
  283. </el-tabs>
  284. </div>
  285. </center>
  286. </el-card>
  287. </div>
  288. </body>
  289. <!-- import Vue before Element -->
  290. <!-- <script src="https://unpkg.com/vue/dist/vue.js"></script> -->
  291. <script src="https://lib.baomitu.com/vue/2.5.17/vue.min.js"></script>
  292. <!-- import JavaScript -->
  293. <!-- <script src="https://unpkg.com/element-ui/lib/index.js"></script> -->
  294. <script src="https://lib.baomitu.com/element-ui/2.4.11/index.js"></script>
  295. <script src="https://lib.baomitu.com/jquery/1.12.4/jquery.min.js"></script>
  296. <script src="./vendor/jqueryPlugPop/plug-in.min.js"></script>
  297. <script src="./js/tool.js"></script>
  298. <script>
  299. new Vue({
  300. el: '#app',
  301. data: function () {
  302. var validateConfirmPass1 = function(rule, value, callback) {
  303. var this_ = window['Vue'];
  304. var regex = new RegExp('(?=.*[0-9])(?=.*[a-zA-Z])(?=.*[^a-zA-Z0-9]).{8,30}');
  305. // var regex = /^[A-Za-z0-9]{8,20}$/;
  306. // var regex = new RegExp("^(?![0-9]+$)(?![a-z]+$)(?![A-Z]+$)(?!([^(0-9a-zA-Z)])+$)^.{8,}$");
  307. if (this_.stdRegInfo.std_pass1 === '') {
  308. callback(new Error('请输入密码'));
  309. } else if (!regex.test(this_.stdRegInfo.std_pass1)) {
  310. callback(new Error('密码中必须包含字母、数字、特殊字符至少8个字符!'));
  311. // callback();
  312. } else {
  313. //密码复杂度检查
  314. callback();
  315. }
  316. };
  317. var validateConfirmPass = function(rule, value, callback) {
  318. var this_ = window['Vue'];
  319. var regex = new RegExp('(?=.*[0-9])(?=.*[a-zA-Z])(?=.*[^a-zA-Z0-9]).{8,30}');
  320. // var regex = /^[A-Za-z0-9]{8,20}$/;
  321. // var regex = new RegExp("^(?![0-9]+$)(?![a-z]+$)(?![A-Z]+$)(?!([^(0-9a-zA-Z)])+$)^.{8,}$");
  322. if (this_.stdRegInfo.std_pass2 === '') {
  323. callback(new Error('请再次输入密码'));
  324. } else if (this_.stdRegInfo.std_pass2 !== this_.stdRegInfo.std_pass1) {
  325. callback(new Error('两次输入密码不一致!'));
  326. } else if (!regex.test(this_.stdRegInfo.std_pass2)) {
  327. callback(new Error('密码中必须包含字母、数字、特殊字符至少8个字符!'));
  328. // callback();
  329. } else {
  330. //密码复杂度检查
  331. callback();
  332. }
  333. };
  334. var validateCertNo = function(rule, value, callback) {
  335. if ((new RegExp(/^[a-zA-Z0-9]+$/g).test(value))) {
  336. callback();
  337. } else {
  338. callback(new Error('证件号只允许填数字和英文'));
  339. }
  340. }
  341. return {
  342. loading: false,
  343. checkLoading: false,
  344. isTicketNo:true,
  345. isQuestion:true,
  346. secCountDown: 0,
  347. secCountDownInfo:"发送验证码",
  348. secMailCountDown: 0,
  349. secMailCountDownInfo:"发送邮件",
  350. canSubmit:false,
  351. stdRegInfo: {
  352. id:"",
  353. cert_no: "",
  354. std_mobile: "",
  355. code:"",
  356. std_pass1: "",
  357. std_pass2: "",
  358. },
  359. stdRegInfoRule: {
  360. std_pass1: [
  361. { required: true, message: '请输入密码', trigger: 'blur' },
  362. { validator: validateConfirmPass1, trigger: 'blur' },
  363. ],
  364. std_pass2: [
  365. { required: true, message: '请输入确定密码', trigger: 'blur' },
  366. { validator: validateConfirmPass, trigger: 'blur' },
  367. ],
  368. std_name:[
  369. { required: true, message: '请输入姓名', trigger: 'blur' },
  370. ],
  371. cert_no: [
  372. { required: true, message: '请输入证件号', trigger: 'blur' },
  373. { validator: validateCertNo, trigger: ['blur', 'change'] },
  374. ],
  375. ticket_no: [
  376. // { required: true, message: '请输入准考证号', trigger: 'blur' },
  377. ],
  378. },
  379. }
  380. },
  381. mounted: function() {
  382. window['Vue'] = this;
  383. this.loading = false;
  384. },
  385. created: function() {
  386. this.loaded = true;
  387. },
  388. methods: {
  389. checkInfo: function(){
  390. var _this = this;
  391. this.checkLoading = true;
  392. if(!this.stdRegInfo.std_name){
  393. $.Pop("请输入姓名!", 'alert', function () {
  394. });
  395. _this.checkLoading = false;
  396. return;
  397. }
  398. if(!this.stdRegInfo.cert_no){
  399. $.Pop("请输入证件号!", 'alert', function () {
  400. });
  401. _this.checkLoading = false;
  402. return;
  403. }
  404. ajaxRequest("", '/std/findStdByCertNo.htm', {
  405. std_name:this.stdRegInfo.std_name,
  406. cert_no: this.stdRegInfo.cert_no
  407. }, function (resp) {
  408. if(resp.entity && String(resp.entity.id)){
  409. _this.stdRegInfo.id = String(resp.entity.id);
  410. // 如果没有密保问题,且没有绑定手机,则验证通过
  411. if(!resp.entity.question && !resp.entity.bindphone){
  412. $.Pop("验证通过,请修改密码!", 'alert', function () {});
  413. _this.canSubmit = true;
  414. _this.isTicketNo = true;
  415. _this.isQuestion = true;
  416. }else if(!resp.entity.question && resp.entity.bindphone){
  417. // 如果没有密保问题,且绑定手机,则提醒通过手机号修改密码
  418. $.Pop("请通过手机号码修改密码!", 'alert', function () {
  419. });
  420. _this.canSubmit = false;
  421. _this.isTicketNo = true;
  422. _this.isQuestion = true;
  423. }else if(resp.entity.question){
  424. // 如果有密保问题,则展示密保问题
  425. $.Pop("身份验证通过,请填写密保问题进行二次验证!", 'alert', function () {});
  426. _this.canSubmit = false;
  427. _this.isQuestion = false;
  428. _this.isTicketNo = true;
  429. //_this.stdRegInfo.question = resp.entity.question;
  430. }
  431. }else if(resp.success==false && resp.errorMsg){
  432. $.Pop(resp.errorMsg, 'alert', function () {
  433. });
  434. _this.canSubmit = false;
  435. }else{
  436. $.Pop("身份验证失败,请重新输入!", 'alert', function () {
  437. });
  438. _this.canSubmit = false;
  439. _this.isTicketNo = true;
  440. _this.isQuestion = true;
  441. }
  442. _this.checkLoading = false;
  443. })
  444. },
  445. secondcheckInfo: function(){
  446. var _this = this;
  447. this.checkLoading = true;
  448. if(!this.stdRegInfo.std_name){
  449. $.Pop("请输入姓名!", 'alert', function () {
  450. });
  451. _this.checkLoading = false;
  452. return;
  453. }
  454. if(!this.stdRegInfo.cert_no){
  455. $.Pop("请输入证件号!", 'alert', function () {
  456. });
  457. _this.checkLoading = false;
  458. return;
  459. }
  460. let url = '/std/findStdByCertNo.htm';
  461. var answer_md5 = null;
  462. if(!_this.isQuestion){
  463. if(!this.stdRegInfo.question){
  464. $.Pop("请选择问题!", 'alert', function () {
  465. });
  466. _this.checkLoading = false;
  467. return;
  468. }
  469. if(!this.stdRegInfo.answer){
  470. $.Pop("请输入答案!", 'alert', function () {
  471. });
  472. _this.checkLoading = false;
  473. return;
  474. }
  475. url = '/std/checkQuestion.htm';
  476. answer_md5 = hex_md5(this.stdRegInfo.answer);
  477. }else if(!_this.isTicketNo){
  478. if(!this.stdRegInfo.ticket_no){
  479. $.Pop("请输入准考证号!", 'alert', function () {
  480. });
  481. _this.checkLoading = false;
  482. return;
  483. }
  484. }
  485. ajaxRequest("", url, {
  486. std_name:this.stdRegInfo.std_name,
  487. cert_no: this.stdRegInfo.cert_no,
  488. ticket_no: this.stdRegInfo.ticket_no,
  489. question:this.stdRegInfo.question,
  490. answer: answer_md5
  491. }, function (resp) {
  492. if(resp.entity && String(resp.entity.id)){
  493. _this.stdRegInfo.id = String(resp.entity.id);
  494. $.Pop("验证通过,请修改密码!", 'alert', function () {});
  495. _this.canSubmit = true;
  496. }else if(resp.success==false && resp.errorMsg){
  497. $.Pop(resp.errorMsg, 'alert', function () {
  498. });
  499. _this.canSubmit = false;
  500. }else{
  501. $.Pop("二次验证失败,请重新输入!", 'alert', function () {
  502. });
  503. _this.canSubmit = false;
  504. }
  505. _this.checkLoading = false;
  506. })
  507. },
  508. sendSms: function(){
  509. var _this = this;
  510. ajaxRequest("", '/std/sendSmsForFindPassword.htm', { std_name: this.stdRegInfo.std_name,cert_no:this.stdRegInfo.cert_no,std_mobile:this.stdRegInfo.std_mobile }, function (resp) {
  511. if(resp.success==true){
  512. _this.secCountDown = 60;
  513. var int = setInterval(function(){
  514. _this.secCountDown--;
  515. if(_this.secCountDown == 0){
  516. clearInterval(int);
  517. //恢复 发送按钮
  518. _this.secCountDownInfo = "发送验证码";
  519. }else{
  520. //倒计时提示
  521. _this.secCountDownInfo = _this.secCountDown+"秒后可重新发送";
  522. }
  523. },1000);
  524. $.Pop("验证码发送成功!", 'alert', function () {});
  525. }else if(resp.success==false && resp.errorMsg){
  526. $.Pop(resp.errorMsg, 'alert', function () {
  527. });
  528. }else{
  529. $.Pop("验证码发送失败,请重新尝试!", 'alert', function () {
  530. });
  531. }
  532. _this.checkLoading = false;
  533. })
  534. },
  535. checkSms: function(){
  536. var _this = this;
  537. ajaxRequest("", '/std/checkSms.htm', { std_name: this.stdRegInfo.std_name,cert_no:this.stdRegInfo.cert_no,std_mobile:this.stdRegInfo.std_mobile,code:this.stdRegInfo.code }, function (resp) {
  538. if(resp.entity && String(resp.entity.id)){
  539. _this.stdRegInfo.id = String(resp.entity.id);
  540. $.Pop("验证通过,请修改密码!", 'alert', function () {});
  541. _this.canSubmit = true;
  542. }else if(resp.success==false && resp.errorMsg){
  543. $.Pop(resp.errorMsg, 'alert', function () {
  544. });
  545. _this.canSubmit = false;
  546. }else{
  547. $.Pop("短信验证失败,请重新尝试!", 'alert', function () {
  548. });
  549. _this.canSubmit = false;
  550. }
  551. _this.checkLoading = false;
  552. })
  553. },
  554. sendMail: function(){
  555. var _this = this;
  556. ajaxRequest("", '/std/sendMailForFindPassword.htm', { std_name: this.stdRegInfo.std_name,cert_no:this.stdRegInfo.cert_no,std_email:this.stdRegInfo.std_email }, function (resp) {
  557. if(resp.success==true){
  558. _this.secMailCountDown = 60;
  559. var int = setInterval(function(){
  560. _this.secMailCountDown--;
  561. if(_this.secMailCountDown == 0){
  562. clearInterval(int);
  563. //恢复 发送按钮
  564. _this.secMailCountDownInfo = "发送邮件";
  565. }else{
  566. //倒计时提示
  567. _this.secMailCountDownInfo = _this.secMailCountDown+"秒后可重新发送";
  568. }
  569. },1000);
  570. $.Pop("验证码已发送,请登陆邮箱获取!", 'alert', function () {});
  571. }else if(resp.success==false && resp.errorMsg){
  572. $.Pop(resp.errorMsg, 'alert', function () {
  573. });
  574. }else{
  575. $.Pop("邮件发送失败,请重新尝试!", 'alert', function () {
  576. });
  577. }
  578. _this.checkLoading = false;
  579. })
  580. },
  581. checkMail: function(){
  582. var _this = this;
  583. ajaxRequest("", '/std/checkMail.htm', { std_name: this.stdRegInfo.std_name,cert_no:this.stdRegInfo.cert_no,std_email:this.stdRegInfo.std_email,code:this.stdRegInfo.code }, function (resp) {
  584. if(resp.entity && String(resp.entity.id)){
  585. _this.stdRegInfo.id = String(resp.entity.id);
  586. $.Pop("验证通过,请修改密码!", 'alert', function () {});
  587. _this.canSubmit = true;
  588. }else if(resp.success==false && resp.errorMsg){
  589. $.Pop(resp.errorMsg, 'alert', function () {
  590. });
  591. _this.canSubmit = false;
  592. }else{
  593. $.Pop("邮件验证失败,请重新尝试!", 'alert', function () {
  594. });
  595. _this.canSubmit = false;
  596. }
  597. _this.checkLoading = false;
  598. })
  599. },
  600. sendPhoneVcode: function(){
  601. var _this = this;
  602. ajaxRequest("", '/std/sendPhoneVcode.htm', { std_id: this.stdRegInfo.id }, function (resp) {
  603. _this.secCountDown = 25;
  604. var int = setInterval(function(){
  605. _this.secCountDown--;
  606. if(_this.secCountDown == 0){
  607. clearInterval(int);
  608. //恢复 发送按钮
  609. _this.secCountDownInfo = "发送验证码";
  610. }else{
  611. //倒计时提示
  612. _this.secCountDownInfo = _this.secCountDown+"秒后可重新发送";
  613. }
  614. },1000);
  615. //提示 验证码 发送成功
  616. alert("验证码:"+resp.entity);
  617. })
  618. },
  619. validateForm: function() {
  620. this.$refs['stdRegInfo'].validate(function(valid) {
  621. if (valid) {
  622. return true;
  623. } else {
  624. console.log('error submit!!');
  625. return false;
  626. }
  627. });
  628. },
  629. goLogin: function() {
  630. window.location.href = "./login.html";
  631. },
  632. onSubmit: function() {
  633. this.$refs['stdRegInfo'].validate(function(valid) {
  634. var this_ = window['Vue'];
  635. if (valid) {
  636. //clone对象
  637. var stdRegInfo = JSON.parse(JSON.stringify(this_.stdRegInfo));
  638. //MD5密码加密
  639. stdRegInfo['std_pass1'] = hex_md5(stdRegInfo['std_pass1']);
  640. stdRegInfo['std_pass2'] = hex_md5(stdRegInfo['std_pass2']);
  641. //删除过程数据
  642. // delete stdRegInfo['std_pass1'];
  643. // delete stdRegInfo['std_pass2'];
  644. ajaxRequest("", '/std/passwordNoLogin.htm', stdRegInfo, function (resp) {
  645. if (resp.success) {
  646. //提示注册成功 跳转登录页面
  647. $.Pop('密码修改成功,即将跳转登录页面', 'alert', function () {
  648. setTimeout(function(){
  649. window.location.href = "./login.html";
  650. }, 300);
  651. })
  652. } else {
  653. $.Pop(resp.errorMsg, 'alert', function () {
  654. });
  655. }
  656. })
  657. } else {
  658. console.log('error submit!!');
  659. }
  660. });
  661. }
  662. }
  663. });
  664. </script>
  665. <style scoped>
  666. .footer {
  667. height: 30px;
  668. }
  669. .abs-bottom {
  670. width: 100%;
  671. position: absolute;
  672. bottom: 0;
  673. left: 0;
  674. right: 0;
  675. margin-bottom: 5px
  676. }
  677. #particles-js {
  678. position: absolute;
  679. top: 0;
  680. left: 0;
  681. right: 0;
  682. bottom: 0;
  683. }
  684. .particles-js-canvas-el {
  685. background-color: aliceblue
  686. }
  687. .btn-long {
  688. width: 100%;
  689. }
  690. .el-select {
  691. width: 100%;
  692. }
  693. .el-card__header {
  694. padding: 8px 8px !important;
  695. }
  696. body {
  697. background-color: #F3F3F3;
  698. }
  699. .el-checkbox__inner{
  700. vertical-align: text-top !important;
  701. }
  702. .el-checkbox__input{
  703. margin-bottom: 6px !important;
  704. }
  705. .el-tabs__nav{
  706. width: 100% !important
  707. }
  708. .el-tabs__item{
  709. width: 33.3% !important
  710. }
  711. </style>
  712. </html>