| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- import { getMobileUserInfo } from '@/api/index';
- import { selectAllocationPermission } from '@/api/week';
- const user = {
- state: {
- userInfo: null,
- activaTypeStore: null,
- },
- mutations: {
- SET_USER_INFO: (state, userInfo) => {
- state.userInfo = userInfo;
- },
- SET_ACTIVA_TYPE_STORE: (state, value) => {
- state.activaTypeStore = value;
- },
- SET_ASSIGN_FLAG: (state, value) => {
- state.isAssignFlag = value;
- },
- },
- actions: {
- // 获取用户信息
- getUserInfo({ dispatch, commit, state }) {
- return new Promise((resolve, reject) => {
- getMobileUserInfo()
- .then((res) => {
- commit('SET_USER_INFO', res.data);
- localStorage.setItem('nickName', res.data.nickName);
- localStorage.setItem('postName', res.data.postName);
- localStorage.setItem('zipPhoto', res.data.zipPhoto);
- localStorage.setItem('deptLevel', res.data.depts[0].deptLevel);
- localStorage.setItem('userId', res.data.userId);
- resolve();
- })
- .catch((error) => {
- reject(error);
- });
- });
- },
- // 储存提示类-未拜访-从那个店铺类型进入未拜访列表
- setActivaTypeStore({ commit }, value) {
- commit('SET_ACTIVA_TYPE_STORE', value);
- },
- },
- };
- export default user;
|