| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- // 用户数据模块
- import api from '@/common/request/index'
- import store from '@/store'
- import { setStorage, getStorage, removeStorage } from '@/util/index.js'
- import {
- USER_INFO,
- SET_TOKEN,
- OUT_LOGIN,
- SET_LOGINSTATE
- } from '../types.js'
- const state = {
- pic: getStorage('pic') ? getStorage('pic') : '',
- safe_log_data: []
- }
- const actions = {
- }
- const mutations = {
- // 保存用户信息
- "SET_PIC"(state, pic) {
- state.pic = pic
- setStorage('pic', pic)
- },
- "SET_SAFE_LOG_DATA"(state, data) {
- state.safe_log_data = data
- },
- }
- const getters = {
- }
- export default {
- state,
- mutations,
- actions,
- getters
- }
|