123456789101112131415161718192021222324 |
- import Vue from 'vue'
- export default {
- namespaced: true,
- state: uni.getStorageSync("userInfo") ? JSON.parse(uni.getStorageSync("userInfo")) : {},
- mutations: {
- UPDATA_USERINFO(state, payload) {
- Object.keys(payload).forEach(e => Vue.set(state, e, payload[e]))
- uni.setStorageSync("userInfo", JSON.stringify(state))
- },
- REDUCEMONEY(state, money) {
- state.money -= +money
- },
- SET_CODE(state, code) {
- state.code = code
- },
- SET_OPENID(state, openid) {
- state.openid = openid
- },
- SET_ACCESSTOKEN(state, access_token) {
- state.access_token = access_token
- }
- }
- }
|