|
@@ -159,6 +159,7 @@ export default {
|
|
|
form: {},
|
|
|
showName: "",
|
|
|
oloading: false,
|
|
|
+ openid: "",
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
@@ -172,7 +173,7 @@ export default {
|
|
|
...mapActions({
|
|
|
login: "user/login",
|
|
|
}),
|
|
|
- loginFn() {
|
|
|
+ async loginFn() {
|
|
|
if (this.loading) return;
|
|
|
|
|
|
if (this.account.length <= 0) {
|
|
@@ -233,7 +234,44 @@ export default {
|
|
|
this.loading = false;
|
|
|
});
|
|
|
} else if (this.loginType == "bind") {
|
|
|
- this.$message.info("绑定账号");
|
|
|
+ // this.$message.info("绑定账号");
|
|
|
+ let data = await this.$ajax.post(API_CONFIG.baseUrl2 + 'checkOpenId', [{email: email}])
|
|
|
+ console.log(data);
|
|
|
+
|
|
|
+ // let params = {
|
|
|
+ // geetest_challenge: "",
|
|
|
+ // geetest_validate: "",
|
|
|
+ // geetest_seccode: "",
|
|
|
+ // loginUsername: email.trim(),
|
|
|
+ // loginPassword: window.btoa(this.password.trim()),
|
|
|
+ // };
|
|
|
+ // this.loading = true;
|
|
|
+ // axios.defaults.withCredentials = true;
|
|
|
+ // console.log("👇");
|
|
|
+ // axios
|
|
|
+ // .post("https://beta.api.cocorobo.cn/api/user", qs.stringify(params))
|
|
|
+ // .then(async (res) => {
|
|
|
+ // console.log("res", res);
|
|
|
+ // let _data = res.data[0][0];
|
|
|
+ // if (_data.active === 1) {
|
|
|
+ // await this.$ajax.post(API_CONFIG.baseUrl2 + 'UpdateOpenId', [{openid: this.openid}])
|
|
|
+ // window.localStorage["identity"] = JSON.stringify(_data.identity);
|
|
|
+ // this.$message.success("绑定成功");
|
|
|
+ // await this.login();
|
|
|
+ // this.$router.push({ path: this.redirect || "/" });
|
|
|
+ // } else {
|
|
|
+ // this.$message.error("绑定失败");
|
|
|
+ // }
|
|
|
+ // this.loading = false;
|
|
|
+ // })
|
|
|
+ // .catch((e) => {
|
|
|
+ // if (e.response && e.response.data == "Wrong email or password") {
|
|
|
+ // this.$message.error("账号或密码错误");
|
|
|
+ // } else {
|
|
|
+ // this.$message.error("绑定失败");
|
|
|
+ // }
|
|
|
+ // this.loading = false;
|
|
|
+ // });
|
|
|
}
|
|
|
},
|
|
|
async getLoading() {
|
|
@@ -330,6 +368,7 @@ export default {
|
|
|
let params = {
|
|
|
openid: openid
|
|
|
}
|
|
|
+ this.openid = openid
|
|
|
axios.defaults.withCredentials = true;
|
|
|
axios.post(`https://beta.api.cocorobo.cn/api/user`, qs.stringify(params)).then(async res => {
|
|
|
console.log("res", res);
|