You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
shop-pc/store/index.js

20 lines
406 B

/*
* @Author: ch
* @Date: 2022-05-04 20:35:20
* @LastEditors: ch
* @LastEditTime: 2022-05-04 21:39:42
* @Description: file content
*/
import { TOKEN } from "../plugins/config/localKey";
export const state = () => ({
token: ''
})
export const mutations = {
SET_TOKEN (state, token = ''){
state.token = token;
token ? localStorage.setItem(TOKEN, token) : localStorage.removeItem(TOKEN);
}
}