diff --git a/src/api/yyyf.js b/src/api/yyyf.js index b6d3b26..8b8f8de 100644 --- a/src/api/yyyf.js +++ b/src/api/yyyf.js @@ -31,3 +31,24 @@ export function getExamDetails(data) { params: data, }); } + +export function getUserTimeMoneyDto() { + return request({ + method: 'get', + url: Host + 'exam/getUserTimeMoneyDto', + }); +} + +export function submit() { + return request({ + method: 'get', + url: Host + 'exam/submit', + }); +} + +export function reStart() { + return request({ + method: 'get', + url: Host + 'exam/reStart', + }); +} diff --git a/src/components/balances/banlanes-tabds.vue b/src/components/balances/banlanes-tabds.vue index 2f9dc92..aeca8d6 100644 --- a/src/components/balances/banlanes-tabds.vue +++ b/src/components/balances/banlanes-tabds.vue @@ -78,19 +78,19 @@ o.oooooo -->
- + + > --> +
- + + >--> +
- + + >--> + +
@@ -124,12 +167,15 @@ diff --git a/src/pages/yyyflogin.vue b/src/pages/yyyflogin.vue index d154540..02d131c 100644 --- a/src/pages/yyyflogin.vue +++ b/src/pages/yyyflogin.vue @@ -19,6 +19,8 @@ export default { loading: null, tel: null, pass: null, + //0 考试 1 练习 2 不计分 + reqType: null, }; }, @@ -26,6 +28,7 @@ export default { created() { this.startLoading(); let params = this.parseUrl(); + this.reqType = params.reqType; //判断是否来自以渔有方 if ( !$.isEmptyObject(params) && @@ -112,7 +115,8 @@ export default { //保存登录的token到cookie // Cookie.set('token', res.data.data.token); localStorage.setItem('token', res.data.data.token); - + //重复提交标识 + localStorage.setItem('isSubmit', JSON.stringify(false)); //保存登录的用户信息到cookie // Cookie.set('userData', res.data.data); localStorage.setItem('userData', JSON.stringify(res.data.data)); @@ -125,43 +129,40 @@ export default { // 保存邀请码信息 localStorage.setItem('invitationCode', res.data.data.invitationCode); this.endLoading(); - location.href = '/'; + location.href = '/entry'; } else { this.$message.warning(res.data.msg); } }); }, loginFromYyyf: function(params) { + let self = this; signInYyyf(params).then(res => { if (res.data.code === 200) { let status = res.data.data.status; + localStorage.setItem('yyyfToken', res.data.data.yyyfUserToken); + + //0 考试 1 练习 2 不计分 + localStorage.setItem('reqType', self.reqType); + if (self.reqType == 0) { + //考试 保留考试剩余 + localStorage.setItem('remainingTime', res.data.data.remainingTime); + } + if (status == 1) { //保存登录的token到cookie // Cookie.set('token', res.data.data.token); - localStorage.setItem('yyyfToken', res.data.data.yyyfUserToken); - let code = res.data.data.code; - this.tel = res.data.data.tel; - this.pass = res.data.data.password; - //注册 - if (code != undefined && code != '') { - let signParams = { - tel: this.tel, - nickName: res.data.data.nickName, - code: res.data.data.code, - password: this.pass, - internationalCode: null, - invitationCode: '', - }; - this.sign(signParams); - } else { - this.login(); - } + self.dealLogin(res); } else { this.$message.warning({ message: res.data.data.msg, onClose: function() { - this.closeWindow(); + if (status == 3) { + self.dealLogin(res); + } else { + self.closeWindow(); + } }, }); } @@ -169,12 +170,31 @@ export default { this.$message.warning({ message: res.data.msg, onClose: function() { - this.closeWindow(); + self.closeWindow(); }, }); } }); }, + dealLogin: function(res) { + let code = res.data.data.code; + this.tel = res.data.data.tel; + this.pass = res.data.data.password; + //注册 + if (code != undefined && code != '') { + let signParams = { + tel: this.tel, + nickName: res.data.data.nickName, + code: res.data.data.code, + password: this.pass, + internationalCode: null, + invitationCode: '', + }; + this.sign(signParams); + } else { + this.login(); + } + }, closeWindow: function() { if ( navigator.userAgent.indexOf('Firefox') != -1 ||