修改
This commit is contained in:
@@ -6,7 +6,9 @@ const tokenKey = 'stk',
|
||||
uidKey = 'suid',
|
||||
userTypeKey = 'sut',
|
||||
duidKey = 'sduid',
|
||||
sak = 'saikey'
|
||||
sak = 'saikey',
|
||||
useridKey= 'userId',
|
||||
username= 'username'
|
||||
const getValueByKey = key => {
|
||||
return sessionStorage.getItem(key) ? sessionStorage.getItem(key) : ''
|
||||
}
|
||||
@@ -15,8 +17,8 @@ const getDefaultState = () => ({
|
||||
token: getValueByKey(tokenKey),
|
||||
ai: getValueByKey(sak),
|
||||
platform: getValueByKey(platformKey),
|
||||
userid: '',
|
||||
username: '',
|
||||
userid: getValueByKey(useridKey),
|
||||
username: getValueByKey(username),
|
||||
realname: '',
|
||||
mobile: '',
|
||||
uno: '', //0500024691
|
||||
@@ -85,6 +87,7 @@ const mutations = {
|
||||
},
|
||||
SET_USER_NAME: (state, username) => {
|
||||
state.username = username
|
||||
sessionStorage.setItem('username', username)
|
||||
},
|
||||
SET_REALNAME: (state, realname) => {
|
||||
state.realname = realname
|
||||
@@ -152,7 +155,7 @@ const actions = {
|
||||
getUserInfo({ commit }) {
|
||||
console.log(this);
|
||||
return new Promise((resolve) => {
|
||||
getUserInfo().then(res => {
|
||||
getUserInfo({t: new Date().getTime()}).then(res => {
|
||||
// if (res.code == vm.$StatusCode.SUCCESS) {
|
||||
if(res.code == 0) {
|
||||
console.log(res);
|
||||
|
||||
Reference in New Issue
Block a user