user.js 422 B

12345678910111213141516
  1. /*
  2. * @Description: 获取用户信息更新
  3. * @Author: 欧阳承珺
  4. * @LastEditors: 欧阳承珺
  5. * @Date: 2022-11-08 09:15:06
  6. * @LastEditTime: 2022-11-16 13:58:30
  7. */
  8. export default function({store, app: {$axios}}) {
  9. if(store?.state?.token !== '') {
  10. return $axios.get('members/getMemberInfo').then((res)=> {
  11. if(res.code === 200) {
  12. store.commit('setUser',res.result.memberInfo)
  13. }
  14. })
  15. }
  16. }