|
@@ -37,7 +37,7 @@ export const useUserStore = defineStore('user', {
|
|
|
qrInfo: {
|
|
qrInfo: {
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
- cardImage:"",
|
|
|
|
|
|
|
+ cardImage: "",
|
|
|
}),
|
|
}),
|
|
|
actions: {
|
|
actions: {
|
|
|
// 获取用户卡片信息
|
|
// 获取用户卡片信息
|
|
@@ -48,7 +48,16 @@ export const useUserStore = defineStore('user', {
|
|
|
} : {}
|
|
} : {}
|
|
|
let res = await getCardInfo(parmas)
|
|
let res = await getCardInfo(parmas)
|
|
|
console.log(res, "resresresresresres");
|
|
console.log(res, "resresresresresres");
|
|
|
- this.cardInfo = res.data
|
|
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ this.cardInfo = res.data
|
|
|
|
|
+ this.cardInfo.avatar = res.data.avatar.replace("http","https")
|
|
|
|
|
+
|
|
|
|
|
+ } else if (res.code == 401) {
|
|
|
|
|
+ // token 失效,清除登录态并跳转登录页
|
|
|
|
|
+ uni.removeStorageSync('token')
|
|
|
|
|
+ this.$reset()
|
|
|
|
|
+ uni.reLaunch({ url: '/pages/login/login' })
|
|
|
|
|
+ }
|
|
|
resolve(res.data)
|
|
resolve(res.data)
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
@@ -58,8 +67,15 @@ export const useUserStore = defineStore('user', {
|
|
|
userId
|
|
userId
|
|
|
} : {}
|
|
} : {}
|
|
|
let res = await getCompanyInfo(parmas)
|
|
let res = await getCompanyInfo(parmas)
|
|
|
- this.companyInfo = res.data
|
|
|
|
|
- this.companyInfo.introduce = formatRichText(res.data.introduce)
|
|
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ this.companyInfo = res.data
|
|
|
|
|
+ this.companyInfo.introduce = formatRichText(res.data.introduce)
|
|
|
|
|
+ } else if (res.code == 401) {
|
|
|
|
|
+ // token 失效,清除登录态并跳转登录页
|
|
|
|
|
+ uni.removeStorageSync('token')
|
|
|
|
|
+ this.$reset()
|
|
|
|
|
+ uni.reLaunch({ url: '/pages/login/login' })
|
|
|
|
|
+ }
|
|
|
resolve(this.companyInfo)
|
|
resolve(this.companyInfo)
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|