yuantianjiao 6 年之前
父節點
當前提交
616f0c1f4c
共有 4 個檔案被更改,包括 49 行新增40 行删除
  1. 10
    3
      src/pages/user/App.vue
  2. 9
    7
      src/pages/user/mainPage/userCenter/index.vue
  3. 29
    29
      src/store/userCenter/userCenter.js
  4. 1
    1
      vue.config.js

+ 10
- 3
src/pages/user/App.vue 查看文件

1
 <template>
1
 <template>
2
-  <div id="app">
3
-    <router-view></router-view>
2
+  <div id="app" v-if="showPage">
3
+    <router-view ></router-view>
4
   </div>
4
   </div>
5
 </template>
5
 </template>
6
 
6
 
10
 const { mapActions: actions } = createNamespacedHelpers('userCenter')
10
 const { mapActions: actions } = createNamespacedHelpers('userCenter')
11
 export default {
11
 export default {
12
   name: 'app',
12
   name: 'app',
13
+  data () {
14
+    return {
15
+      showPage: false
16
+    }
17
+  },
13
   components: {},
18
   components: {},
14
   computed: {
19
   computed: {
15
     ...mapState({
20
     ...mapState({
23
     } else {
28
     } else {
24
       this.code = null
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
   methods: {
35
   methods: {
29
     ...actions(['getUserInfo'])
36
     ...actions(['getUserInfo'])

+ 9
- 7
src/pages/user/mainPage/userCenter/index.vue 查看文件

79
   components: {
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
   methods: {
92
   methods: {
91
     ...actions(['getUserInfo']),
93
     ...actions(['getUserInfo']),

+ 29
- 29
src/store/userCenter/userCenter.js 查看文件

74
   namespaced: true,
74
   namespaced: true,
75
   state: {
75
   state: {
76
     userInfo: {
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
     caseInfo: {}
107
     caseInfo: {}
108
   },
108
   },

+ 1
- 1
vue.config.js 查看文件

26
       '/api': {
26
       '/api': {
27
         // target: 'https://dp.huiju360.com.cn/hj_operations',
27
         // target: 'https://dp.huiju360.com.cn/hj_operations',
28
         // target: 'http://192.168.0.62:8080', //wf
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
         // target: 'http://dev.ycjcjy.com', //frp
30
         // target: 'http://dev.ycjcjy.com', //frp
31
         changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
31
         changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
32
         // pathRewrite: {
32
         // pathRewrite: {