优化代码
This commit is contained in:
@@ -18,34 +18,47 @@ const _sfc_main = {
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
common_vendor.index.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;
|
||||
}
|
||||
});
|
||||
this.id = option.id;
|
||||
this.getUserInfo();
|
||||
},
|
||||
onShow() {
|
||||
common_vendor.index.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;
|
||||
}
|
||||
});
|
||||
this.getUserInfo();
|
||||
},
|
||||
methods: {
|
||||
//获取个人信息
|
||||
getUserInfo() {
|
||||
components_request.request({
|
||||
url: "user/getUserInfo",
|
||||
method: "POST",
|
||||
data: {
|
||||
id: this.id
|
||||
},
|
||||
userInfo: true
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.userinfo = res.data;
|
||||
common_vendor.index.setStorageSync("userinfo", res.data);
|
||||
setTimeout(() => {
|
||||
common_vendor.index.getStorage({
|
||||
key: "userinfo",
|
||||
success: (res2) => {
|
||||
this.id = res2.data.id;
|
||||
this.name = res2.data.nickName;
|
||||
this.userinfo = this.useravatar = res2.data.headerIcon;
|
||||
this.email = res2.data.email;
|
||||
this.havaPassword = res2.data.havaPassword;
|
||||
}
|
||||
});
|
||||
}, 300);
|
||||
} else {
|
||||
common_vendor.index.__f__("log", "at pages/Setting/Setting.vue:142", res.msg);
|
||||
}
|
||||
});
|
||||
},
|
||||
//修改密码
|
||||
modifyPassword() {
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/Setting/settingmod/changePassword?id=" + this.id
|
||||
url: "/pages/Setting/settingmod/changePassword?id=" + this.id + "&havaPassword=" + this.havaPassword
|
||||
});
|
||||
},
|
||||
// 修改邮箱
|
||||
@@ -128,7 +141,7 @@ const _sfc_main = {
|
||||
},
|
||||
userInfo: true
|
||||
}).then((ress) => {
|
||||
common_vendor.index.__f__("log", "at pages/Setting/Setting.vue:226", "修改调用返回", ress);
|
||||
common_vendor.index.__f__("log", "at pages/Setting/Setting.vue:243", "修改调用返回", ress);
|
||||
if (ress.code === 200) {
|
||||
common_vendor.index.showToast({
|
||||
title: "修改成功",
|
||||
@@ -172,7 +185,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
e: common_vendor.o((...args) => $options.inputNickname && $options.inputNickname(...args)),
|
||||
f: common_vendor.t($data.email == "" || $data.email == null ? "未绑定" : $data.email),
|
||||
g: common_vendor.o((...args) => $options.modifyEmailAddress && $options.modifyEmailAddress(...args)),
|
||||
h: common_vendor.t($data.havaPassword ? "" : "未设置"),
|
||||
h: common_vendor.t($data.havaPassword == true ? "" : "未设置"),
|
||||
i: common_vendor.o((...args) => $options.modifyPassword && $options.modifyPassword(...args)),
|
||||
j: common_vendor.o((...args) => $options.scanCode && $options.scanCode(...args))
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user