yuantianjiao vor 6 Jahren
Ursprung
Commit
616f0c1f4c

+ 10
- 3
src/pages/user/App.vue Datei anzeigen

@@ -1,6 +1,6 @@
1 1
 <template>
2
-  <div id="app">
3
-    <router-view></router-view>
2
+  <div id="app" v-if="showPage">
3
+    <router-view ></router-view>
4 4
   </div>
5 5
 </template>
6 6
 
@@ -10,6 +10,11 @@ import { mapState, createNamespacedHelpers } from 'vuex'
10 10
 const { mapActions: actions } = createNamespacedHelpers('userCenter')
11 11
 export default {
12 12
   name: 'app',
13
+  data () {
14
+    return {
15
+      showPage: false
16
+    }
17
+  },
13 18
   components: {},
14 19
   computed: {
15 20
     ...mapState({
@@ -23,7 +28,9 @@ export default {
23 28
     } else {
24 29
       this.code = null
25 30
     }
26
-    this.getUserInfo({ org: this.org, code: this.code })
31
+    this.getUserInfo({ org: this.org, code: this.code }).then(() => {
32
+      this.showPage = true
33
+    })
27 34
   },
28 35
   methods: {
29 36
     ...actions(['getUserInfo'])

+ 9
- 7
src/pages/user/mainPage/userCenter/index.vue Datei anzeigen

@@ -79,13 +79,15 @@ export default {
79 79
   components: {
80 80
 
81 81
   },
82
-  created () {
83
-    if (this.userInfo != 406) {
84
-      this.user = this.userInfo.customer
85
-      this.AccountInfo = JSON.parse(this.user.AccountInfo)
86
-      this.headimgurl = this.AccountInfo.headimgurl
87
-      this.isLoading = false
88
-    }
82
+  mounted () {
83
+    this.$nextTick(() => {
84
+      if (this.userInfo != 406) {
85
+        this.user = this.userInfo.customer
86
+        this.AccountInfo = JSON.parse(this.user.AccountInfo)
87
+        this.headimgurl = this.AccountInfo.headimgurl
88
+        this.isLoading = false
89
+      }
90
+    })
89 91
   },
90 92
   methods: {
91 93
     ...actions(['getUserInfo']),

+ 29
- 29
src/store/userCenter/userCenter.js Datei anzeigen

@@ -74,35 +74,35 @@ export default {
74 74
   namespaced: true,
75 75
   state: {
76 76
     userInfo: {
77
-      AccountInfo: {
78
-        "city": "CITY",
79
-        "country": "COUNTRY",
80
-        "headimgurl": "http://thirdwx.qlogo.cn/mmopen/g3MonUZtNHkdmzicIlibx6iaFqAc56vxLSUfpb6n5WKSYVY0ChQKkiaJSgQ1dZuTOgvLLrhJbERQQ4eMsv84eavHiaiceqxibJxCfHe/46",
81
-        "nickname": "NICKNAME",
82
-        "openid": "OPENID",
83
-        "province": "PROVINCE",
84
-        "sex": "1",
85
-        "unionid": "o6_bmasdasdsad6_2sgVt7hMZOPfL"
86
-      },
87
-      AccountType: "wechat",
88
-      CreateDate: "0001-01-01T00:00:00Z",
89
-      CustomerId: "1",
90
-      CustomerName: "测试",
91
-      Headimgurl: "",
92
-      MapUser: "",
93
-      MappingId: "1",
94
-      Name: "测试",
95
-      Openid: "OPENID",
96
-      OrgId: "1",
97
-      Phone: "13823838438",
98
-      Points: 0,
99
-      RecommendCase: "1",
100
-      RecommendId: "0",
101
-      RecommendName: "",
102
-      Sex: 1,
103
-      Status: 1,
104
-      UserType: "customer",
105
-      Uuid: "",
77
+      // AccountInfo: {
78
+      //   "city": "CITY",
79
+      //   "country": "COUNTRY",
80
+      //   "headimgurl": "http://thirdwx.qlogo.cn/mmopen/g3MonUZtNHkdmzicIlibx6iaFqAc56vxLSUfpb6n5WKSYVY0ChQKkiaJSgQ1dZuTOgvLLrhJbERQQ4eMsv84eavHiaiceqxibJxCfHe/46",
81
+      //   "nickname": "NICKNAME",
82
+      //   "openid": "OPENID",
83
+      //   "province": "PROVINCE",
84
+      //   "sex": "1",
85
+      //   "unionid": "o6_bmasdasdsad6_2sgVt7hMZOPfL"
86
+      // },
87
+      // AccountType: "wechat",
88
+      // CreateDate: "0001-01-01T00:00:00Z",
89
+      // CustomerId: "1",
90
+      // CustomerName: "测试",
91
+      // Headimgurl: "",
92
+      // MapUser: "",
93
+      // MappingId: "1",
94
+      // Name: "测试",
95
+      // Openid: "OPENID",
96
+      // OrgId: "1",
97
+      // Phone: "13823838438",
98
+      // Points: 0,
99
+      // RecommendCase: "1",
100
+      // RecommendId: "0",
101
+      // RecommendName: "",
102
+      // Sex: 1,
103
+      // Status: 1,
104
+      // UserType: "customer",
105
+      // Uuid: "",
106 106
     },
107 107
     caseInfo: {}
108 108
   },

+ 1
- 1
vue.config.js Datei anzeigen

@@ -26,7 +26,7 @@ module.exports = {
26 26
       '/api': {
27 27
         // target: 'https://dp.huiju360.com.cn/hj_operations',
28 28
         // target: 'http://192.168.0.62:8080', //wf
29
-        target: 'http://192.168.0.11:8080', //ys
29
+        target: 'http://192.168.0.11', //ys
30 30
         // target: 'http://dev.ycjcjy.com', //frp
31 31
         changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
32 32
         // pathRewrite: {