xiongzhu 4 лет назад
Родитель
Сommit
d7c3008a26
2 измененных файлов с 5 добавлено и 5 удалено
  1. 2 2
      src/store/index.js
  2. 3 3
      src/views/Mine.vue

+ 2 - 2
src/store/index.js

@@ -67,9 +67,9 @@ export default createStore({
         }
     },
     actions: {
-        getUserInfo(context) {
+        getUserInfo(context, refresh) {
             return http.http
-                .get('/user/my')
+                .get('/user/my', { refresh })
                 .then(res => {
                     http.axios.defaults.headers.common['X-Username'] = res.id;
                     context.commit('setUserInfo', res);

+ 3 - 3
src/views/Mine.vue

@@ -217,7 +217,7 @@ export default {
         this.getInit();
     },
     methods: {
-        getInit() {
+        getInit(refresh) {
             if (this.isLogin) {
                 this.$http
                     .post(
@@ -249,7 +249,7 @@ export default {
                 StatusBar.styleLightContent();
             }
 
-            return this.$store.dispatch('getUserInfo');
+            return this.$store.dispatch('getUserInfo', refresh);
         },
         copy() {
             this.$copyText(this.userInfo.id).then(
@@ -315,7 +315,7 @@ export default {
                 });
         },
         onRefresh() {
-            return this.getInit()
+            return this.getInit(true)
                 .then(() => {
                     this.isLoading = false;
                 })