|
@@ -236,42 +236,49 @@ export default {
|
|
} else if (this.loginType == "bind") {
|
|
} else if (this.loginType == "bind") {
|
|
// this.$message.info("绑定账号");
|
|
// this.$message.info("绑定账号");
|
|
let data = await this.$ajax.post(API_CONFIG.baseUrl2 + 'checkOpenId', [{email: email}])
|
|
let data = await this.$ajax.post(API_CONFIG.baseUrl2 + 'checkOpenId', [{email: email}])
|
|
- console.log(data);
|
|
|
|
|
|
+ if(!data.data[0].length){
|
|
|
|
+ this.$message.error("未查找到对应账号请重新输入");
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if(data.data[0][0].thirdpartyid){
|
|
|
|
+ this.$message.error("该账号已绑定微信登录请重新输入");
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
|
|
- // 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;
|
|
|
|
- // });
|
|
|
|
|
|
+ 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() {
|
|
async getLoading() {
|