|
@@ -14,22 +14,29 @@
|
|
|
|
|
|
export default {
|
|
|
created: function () {
|
|
|
- let otp = this.$route.query.o;
|
|
|
- // let otp = BasicFunction.utils_get_param("o");
|
|
|
+ // let otp = this.$route.query.o;
|
|
|
+ let otp = BasicFunction.utils_get_param("o");
|
|
|
console.log('otp: ');
|
|
|
console.log(otp);
|
|
|
- let userid = '';
|
|
|
- if (localStorage.getItem('frontend-userid')) {
|
|
|
- userid = localStorage.getItem('frontend-userid');
|
|
|
- this.$router.push('index');
|
|
|
+ if (otp === null) {
|
|
|
+ console.warn('无otp');
|
|
|
+ return;
|
|
|
}
|
|
|
+ let userid = '';
|
|
|
+ // if (localStorage.getItem('frontend-userid')) {
|
|
|
+ // userid = localStorage.getItem('frontend-userid');
|
|
|
+ // this.$router.push('index');
|
|
|
+ // }
|
|
|
+ let that = this;
|
|
|
BasicFunction.get_data("ajaxotplogin?otp=" + otp.toString(), function (response) {
|
|
|
- console.log("------ User Info --------");
|
|
|
+ console.log("------ User Info login --------");
|
|
|
console.log(response);
|
|
|
if (response.ret === "10000") {
|
|
|
let user = response.model.list[0];
|
|
|
userid = user.uid;
|
|
|
localStorage.setItem('frontend-userid', userid);
|
|
|
+ Toast.success('登录成功');
|
|
|
+ // that.$router.push('index');
|
|
|
} else {
|
|
|
// 失败的处理
|
|
|
console.warn("获取用户信息失败");
|
|
@@ -38,7 +45,7 @@
|
|
|
}, {});
|
|
|
// if (userid.length === 0) this.$router.push('warning');
|
|
|
// else this.$router.push('index');
|
|
|
- this.$router.push('index');
|
|
|
+ // this.$router.push('index');
|
|
|
}
|
|
|
}
|
|
|
|