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
409 B

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