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/plugins/storeStorage.js

14 lines
411 B

3 years ago
/*
* @Author: ch
* @Date: 2022-05-04 21:15:17
* @LastEditors: ch
3 years ago
* @LastEditTime: 2022-05-07 11:05:11
3 years ago
* @Description: 服务端没有localStorage对象在Sotre中不能直接取值在plugins中统一为state做一次初始取值处理
*/
3 years ago
import { TOKEN } from "./config/sotrageKey";
3 years ago
export default ({store})=>{
// 获取storage中的token
store.commit('SET_TOKEN',localStorage.getItem(TOKEN));
}