优化代码
This commit is contained in:
@@ -62,7 +62,9 @@
|
||||
<view class="Nickname" @click="modifyPassword">
|
||||
<view class="avatarmodify-item">密码</view>
|
||||
<view class="NicknameInput">
|
||||
<view class="NicknameInput-name">{{ havaPassword == true ? "" : "未设置" }}</view>
|
||||
<view class="NicknameInput-name">{{
|
||||
havaPassword == true ? "" : "未设置"
|
||||
}}</view>
|
||||
<image
|
||||
class="more"
|
||||
src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/More.png"
|
||||
@@ -128,15 +130,15 @@ export default {
|
||||
uni.setStorageSync("userinfo", res.data);
|
||||
setTimeout(() => {
|
||||
uni.getStorage({
|
||||
key: "userinfo",
|
||||
success: (res) => {
|
||||
this.id = res.data.id;
|
||||
this.name = res.data.nickName;
|
||||
this.userinfo = this.useravatar = res.data.headerIcon;
|
||||
this.email = res.data.email;
|
||||
this.havaPassword = res.data.havaPassword;
|
||||
},
|
||||
});
|
||||
key: "userinfo",
|
||||
success: (res) => {
|
||||
this.id = res.data.id;
|
||||
this.name = res.data.nickName;
|
||||
this.userinfo = this.useravatar = res.data.headerIcon;
|
||||
this.email = res.data.email;
|
||||
this.havaPassword = res.data.havaPassword;
|
||||
},
|
||||
});
|
||||
}, 300);
|
||||
} else {
|
||||
console.log(res.msg);
|
||||
@@ -179,22 +181,39 @@ export default {
|
||||
method: "POST",
|
||||
data: {
|
||||
uuid: data.uuid,
|
||||
userId: this.id,
|
||||
id: this.id,
|
||||
},
|
||||
userInfo: true,
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.showToast({
|
||||
title: "登录成功",
|
||||
icon: "success",
|
||||
request({
|
||||
url: "user/confirm",
|
||||
method: "POST",
|
||||
data: {
|
||||
uuid: data.uuid,
|
||||
id: this.id,
|
||||
},
|
||||
userInfo: true,
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.showToast({
|
||||
title: "登录成功",
|
||||
icon: "success",
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res,
|
||||
icon: "none",
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
uni.showToast({
|
||||
title: "登录失败",
|
||||
icon: "none",
|
||||
});
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res,
|
||||
icon: "none",
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
uni.showToast({
|
||||
|
||||
Reference in New Issue
Block a user