liveh5-nuxt/app/stores/auth/index.js
xingyy 29e8fb9cb7 refactor(auth): 优化实名认证逻辑和用户信息展示
- 在 detail.vue 中增加性别显示逻辑,将 sex 字段转换为对应的性别文字
- 在 auth store 中添加 selectedZone 属性,用于保存选择的区号
- 修改 login 页面,将 selectedZone 存入 store 并在组件挂载时初始化
- 更新 profile 页面,增加拍卖作品状态显示
- 优化 realAuth 页面,根据选择的区号决定是否进行法大大验证
2025-02-20 20:40:00 +08:00

25 lines
764 B
JavaScript

import { createGlobalState,useLocalStorage } from '@vueuse/core'
export const authStore = createGlobalState(() => {
const token=useLocalStorage('token','')
const RefreshToken=useLocalStorage('RefreshToken','')
const userInfo=useLocalStorage('userInfo',{})
const fingerprint=useLocalStorage('fingerprint','')
const checkoutSessionUrl=useLocalStorage('checkoutSessionUrl','')
const selectedZone=useLocalStorage('selectedZone','')
const payment=useLocalStorage('payment',{
leftPrice:'',
leftCurrency:'',
buyUid:'',
auctionArtworkUuid:''
})
return{
selectedZone,
payment,
checkoutSessionUrl,
userInfo,
RefreshToken,
token,
fingerprint
}
})