This commit is contained in:
18500206848
2024-02-02 14:40:26 +08:00
parent 21a84c3035
commit 8964c6983f
253 changed files with 0 additions and 25212 deletions

View File

@@ -1,75 +0,0 @@
import {
getStore,
setStore
} from '@/untils/store.js'
import {isGather} from '@/api/auth.js';
const authentication = {
state: {
// 实名认证
realName: {},
// 银行卡印证
bankCard: {},
// 采集签名
autograph: getStore({
name: 'autograph'
}) || {},
},
getters: {},
actions: {
setRealName({
commit,
getters
}, realName){
commit('SET_REALNAME', realName);
},
setBankCard({
commit,
getters
}, bankCard){
commit('SET_BACKCARD', bankCard);
},
setAutograph({
commit,
getters
}){
return new Promise((resolve, reject) => {
isGather().then((res) => {
const data = res.data
commit('SET_AUTOGRAPH', data);
resolve(res.data)
}).catch(reject)
})
},
clearAuthenication(){
commit('SET_REALNAME', '');
commit('SET_BACKCARD', '');
commit('SET_AUTOGRAPH', '');
}
},
mutations: {
SET_REALNAME: (state, realName) => {
state.realName = realName;
setStore({
name: 'realName',
content: realName,
type: 'session'
})
},
SET_BACKCARD: (state, bankCard) => {
setStore({
name: 'bankCard',
content: bankCard,
type: 'session'
})
},
SET_AUTOGRAPH: (state, autograph) => {
state.autograph = autograph;
setStore({
name: 'autograph',
content: autograph,
type: 'session'
})
}
}
}
export default authentication