|
@@ -42,6 +42,9 @@ const store = new Vuex.Store({
|
|
uni.setStorageSync("name", res.data.name);
|
|
uni.setStorageSync("name", res.data.name);
|
|
const userObj = res.data;
|
|
const userObj = res.data;
|
|
uni.setStorageSync("globalUser", res.data);
|
|
uni.setStorageSync("globalUser", res.data);
|
|
|
|
+ uni.setStorageSync("token", res.token);
|
|
|
|
+ // uni.setCookie(res.token);
|
|
|
|
+ // uni.setToken(res.token);
|
|
commit('setLoading', false);
|
|
commit('setLoading', false);
|
|
commit('setLoginUser', userObj);
|
|
commit('setLoginUser', userObj);
|
|
// commit('setToken', token);
|
|
// commit('setToken', token);
|
|
@@ -72,6 +75,7 @@ const store = new Vuex.Store({
|
|
.then(res => {
|
|
.then(res => {
|
|
//用户名缓存
|
|
//用户名缓存
|
|
uni.setStorageSync("name", res.data.name);
|
|
uni.setStorageSync("name", res.data.name);
|
|
|
|
+ uni.setStorageSync("token", res.token);
|
|
const userObj = res.data;
|
|
const userObj = res.data;
|
|
commit('setLoading', false);
|
|
commit('setLoading', false);
|
|
commit('setLoginUser', userObj);
|
|
commit('setLoginUser', userObj);
|