|
@@ -9,15 +9,15 @@ export const state = () => ({
|
|
export const mutations = {
|
|
export const mutations = {
|
|
setToken(state, token) {
|
|
setToken(state, token) {
|
|
state.token = token;
|
|
state.token = token;
|
|
- this.$cookies.set("token", token, { maxAge: 2592000, path: '/' });
|
|
|
|
|
|
+ if (this.$cookies.get('can-use-cookie')) this.$cookies.set("token", token, { maxAge: 2592000, path: '/' });
|
|
},
|
|
},
|
|
getToken(state) {
|
|
getToken(state) {
|
|
- state.token = this.$cookies.get("token");
|
|
|
|
|
|
+ if (this.$cookies.get('can-use-cookie')) state.token = this.$cookies.get("token");
|
|
},
|
|
},
|
|
setUserInfo(state, data) {
|
|
setUserInfo(state, data) {
|
|
state.userInfo = data;
|
|
state.userInfo = data;
|
|
// state.email = data.email;
|
|
// state.email = data.email;
|
|
- this.$cookies.set("user-info", data, { maxAge: 2592000, path: '/' });
|
|
|
|
|
|
+ if (this.$cookies.get('can-use-cookie')) this.$cookies.set("user-info", data, { maxAge: 2592000, path: '/' });
|
|
},
|
|
},
|
|
clearUserInfo(state) {
|
|
clearUserInfo(state) {
|
|
state.userInfo = {};
|
|
state.userInfo = {};
|