|
@@ -647,17 +647,17 @@ export default {
|
|
|
let params = {
|
|
|
openid: openid,
|
|
|
};
|
|
|
-
|
|
|
+ let _this = this
|
|
|
this.openid = openid;
|
|
|
axios.defaults.withCredentials = true;
|
|
|
axios
|
|
|
.post(`https://beta.api.cocorobo.cn/api/user`, qs.stringify(params))
|
|
|
.then(async (res) => {
|
|
|
let _data = res.data[0][0];
|
|
|
- this.$message.error('该微信已绑定'+_data.username+'账号');
|
|
|
- this.wechatDialogVisible = false;
|
|
|
- if (this.$refs.QRcode && this.$refs.QRcode.innerHTML) {
|
|
|
- this.$refs.QRcode.innerHTML = "";
|
|
|
+ _this.$message.error('该微信已绑定'+_data.username+'账号');
|
|
|
+ _this.wechatDialogVisible = false;
|
|
|
+ if (_this.$refs.QRcode && _this.$refs.QRcode.innerHTML) {
|
|
|
+ _this.$refs.QRcode.innerHTML = "";
|
|
|
}
|
|
|
})
|
|
|
.catch((err) => {
|
|
@@ -666,20 +666,25 @@ export default {
|
|
|
let params = [
|
|
|
{
|
|
|
functionName: API_CONFIG.ajax_UpdateOpenId.functionName, // 调用存储过程的名称
|
|
|
- uid: this.userid,
|
|
|
+ uid: _this.userid,
|
|
|
openid: openid,
|
|
|
},
|
|
|
];
|
|
|
- this.$ajax
|
|
|
+ _this.$ajax
|
|
|
.post(API_CONFIG.baseUrl, params)
|
|
|
.then(() => {
|
|
|
- this.$message.success("绑定成功");
|
|
|
- this.wechatDialogVisible = false;
|
|
|
- this.getData();
|
|
|
+ _this.$message.success("绑定成功");
|
|
|
+ _this.wechatDialogVisible = false;
|
|
|
+ _this.getData();
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
- this.$message.error("绑定失败请重新扫码");
|
|
|
+ _this.$message.error("绑定失败请重新扫码");
|
|
|
console.error(err);
|
|
|
+ setTimeout(() => {
|
|
|
+ _this.wechatDialogVisible = true;
|
|
|
+ _this.wechatLogin();
|
|
|
+ }, 1000);
|
|
|
+
|
|
|
});
|
|
|
});
|
|
|
},
|