import { getToken, setToken } from "@/utils/common.js" const state = { token: getToken(), headHeight: '100rpx', statusBarHeight: 0, // 涨跌颜色 stocksColor: 'green_rise', // green_rise:绿涨红跌 , red_rise:绿跌红涨 } const mutations = { SET_statusBarHeight: (state, Height) => { state.statusBarHeight = Height }, SET_STOCKS_COLOR: (state, code) => { state.stocksColor = code }, SET_TOKEN: (state, token) => { setToken(token) state.token = token } } const actions = { // setToken = (token) => { // console.log('token = ' , token) // } setToken({ commit }, token) { commit('SET_TOKEN', token) }, } export default { namespaced: true, state, mutations, actions }