|
|
@@ -1,6 +1,7 @@
|
|
|
import { defineStore } from 'pinia'
|
|
|
import { ref } from 'vue'
|
|
|
import { Base64 } from 'js-base64'
|
|
|
+import defHead from '@img/icons/turnk_number_head.png'
|
|
|
interface TUser extends Token认证用户实体 {
|
|
|
/** 令牌 */
|
|
|
token?: string
|
|
|
@@ -10,6 +11,7 @@ interface TUser extends Token认证用户实体 {
|
|
|
roleId?: string
|
|
|
/** 请求时携带的标识符 */
|
|
|
Identifier?: string
|
|
|
+ mobileDes?: string
|
|
|
}
|
|
|
const service = 'miniprogram'
|
|
|
const initState = {
|
|
|
@@ -26,9 +28,11 @@ const useUserStore = defineStore(
|
|
|
const initUserInfo = (val: Token认证返回实体) => {
|
|
|
const data = { ...val.user }
|
|
|
delete data.authorities
|
|
|
-
|
|
|
- data.mobile = func.convert.mobileDes(data.mobile)
|
|
|
+ if (!data.head_url) {
|
|
|
+ data.head_url = defHead
|
|
|
+ }
|
|
|
userInfo.value = data
|
|
|
+ userInfo.value.mobileDes = func.convert.mobileDes(data.mobile)
|
|
|
userInfo.value.token = val.access_token
|
|
|
userInfo.value.orgId = val.user.authorities[0].orgId
|
|
|
userInfo.value.roleId = val.user.authorities[0].roles[0].roleId
|