liveh5-nuxt/app/stores-collect-code/auth/index.js

34 lines
1.1 KiB
JavaScript
Raw Normal View History

import { createGlobalState,useLocalStorage } from '@vueuse/core'
export const codeAuthStore = createGlobalState(() => {
const token=useLocalStorage('token','')
const RefreshToken=useLocalStorage('RefreshToken','')
const userInfo=useLocalStorage('userInfo',{})
const fingerprint=useLocalStorage('fingerprint','')
const formData=useLocalStorage('formData',{
"countryCode": "",
"phone": "", //手机号
"userName": "", //用户名 (第一次传)
"gender": 1, //性别 1男 2女 3未知 (第一次传)
"birthday": "", //生日 (第一次传)
"address": "", //家庭住址 (第一次传)
"bankName": "", //银行名字(第一次传)
"bankNo": "", //银行卡号(第一次传)
"cardId": "",
cardType:1
})
const lotNo=ref(undefined)
const price=ref(undefined)
const auctionArtworkUuid=ref(undefined)
const number=useLocalStorage('number',undefined)
return{
lotNo,
price,
auctionArtworkUuid,
number,
formData,
userInfo,
RefreshToken,
token,
fingerprint
}
})