|
|
@@ -1341,24 +1341,24 @@
|
|
|
getUserInfo() {
|
|
|
this.$Request.get("/app/user/selectUserById").then((res) => {
|
|
|
if (res.code == 0) {
|
|
|
- uni.setStorageSync("weChatNum", res.data.weChatNum);
|
|
|
- uni.setStorageSync("zhiRate", res.data.zhiRate);
|
|
|
- if (res.data.avatar) {
|
|
|
+ uni.setStorageSync("weChatNum", res.data?.weChatNum);
|
|
|
+ uni.setStorageSync("zhiRate", res.data?.zhiRate);
|
|
|
+ if (res.data?.avatar) {
|
|
|
this.avatar = res.data.avatar;
|
|
|
}
|
|
|
- if (res.data.userName) {
|
|
|
+ if (res.data?.userName) {
|
|
|
this.userName = res.data.userName;
|
|
|
}
|
|
|
- uni.setStorageSync("userId", res.data.userId);
|
|
|
- if (res.data.companyId) {
|
|
|
+ uni.setStorageSync("userId", res.data?.userId);
|
|
|
+ if (res.data?.companyId) {
|
|
|
uni.setStorageSync("companyId", res.data.companyId);
|
|
|
}
|
|
|
- if (res.data.userType == 1 || res.data.userType == null) {
|
|
|
+ if (res.data?.userType == 1 || res.data?.userType == null) {
|
|
|
|
|
|
this.userType = 1;
|
|
|
uni.setStorageSync("userType", 1);
|
|
|
|
|
|
- if (res.data.isUserVip == 1) {
|
|
|
+ if (res.data?.isUserVip == 1) {
|
|
|
//判断用户是否是vip
|
|
|
this.isVip = true;
|
|
|
uni.setStorageSync("isUserVip", 1);
|