Browse Source

bug修改

wangfei 6 years ago
parent
commit
db51fd7cac
3 changed files with 18 additions and 3 deletions
  1. 3
    3
      src/pages/page2.vue
  2. 11
    0
      src/store/user/index.js
  3. 4
    0
      src/util/api.js

+ 3
- 3
src/pages/page2.vue View File

@@ -124,7 +124,7 @@ export default {
124 124
   methods: {
125 125
     ...mapUserActions([
126 126
       'getWeatherInfo',
127
-      'getPerson'
127
+      'getPersonB'
128 128
     ]),
129 129
     ...mapPageActions([
130 130
       'getPagesList'
@@ -174,11 +174,11 @@ export default {
174 174
       this.getWeatherInfo()
175 175
     },
176 176
     getPersonList () {
177
-      this.getPerson().then(res => {
177
+      this.getPersonB().then(res => {
178 178
         if (res) {
179 179
           this.returnUserList({
180 180
             firstName: (res.classId || res.classId === 1) ? '' : res.personName,
181
-            words: res.words.replace('{{name}}', res.personName),
181
+            words: (res.words || '').replace('{{name}}', res.personName),
182 182
             show: false
183 183
           })
184 184
         }

+ 11
- 0
src/store/user/index.js View File

@@ -90,6 +90,17 @@ export default {
90 90
           reject(res)
91 91
         })
92 92
       })
93
+    },
94
+    getPersonB ({ commit }) {
95
+      return new Promise((resolve, reject) => {
96
+        Ajax(api.person2.url, {
97
+          method: api.person2.method
98
+        }).then(res => {
99
+          resolve(res)
100
+        }).catch((res) => {
101
+          reject(res)
102
+        })
103
+      })
93 104
     }
94 105
   }
95 106
 }

+ 4
- 0
src/util/api.js View File

@@ -15,6 +15,10 @@ const $api = {
15 15
   person: {
16 16
     method: 'get',
17 17
     url: `/api/person/connection`
18
+  },
19
+  person2: {
20
+    method: 'get',
21
+    url: `/api/person/connectionB`
18 22
   }
19 23
 }
20 24