耀实惠小程序
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.
 
 
 

35 lines
692 B

import api from '@/request/index'
import utils from '@/utils/utils.js'
import {
storageKeys,
storage
} from '@/utils/storage.js'
export default {
userInfo({ state, commit }) {
return new Promise((resolve, reject) => {
api('getUserInfo')
.then(res => {
let { code, message, result } = res
if (code === 200) {
let obj = { ...result.userInfo, ...result.account }
commit('set_userInfo', obj);
resolve(obj)
} else {
uni.showToast({
title: message,
icon: 'none',
duration: 2000,
})
}
})
.catch(() => {
uni.showToast({
title: '获取信息失败!',
icon: 'none',
duration: 2000,
})
})
})
},
}