Przeglądaj źródła

首页点击社保,五险不会卡住

dujingxian 4 lat temu
rodzic
commit
ea9a1d2aca
2 zmienionych plików z 14 dodań i 5 usunięć
  1. 1 1
      src/static/common.json
  2. 13 4
      src/views/index/index.ts

+ 1 - 1
src/static/common.json

@@ -1,3 +1,3 @@
 {
-  "version": "1.4.18"
+  "version": "1.4.19"
 }

+ 13 - 4
src/views/index/index.ts

@@ -147,10 +147,14 @@ export default class Index extends Vue {
     }
 
     // 点击五险一金
-    hFiveSocial() {
+    async hFiveSocial() {
+        let result = await Http.getInstance().userinfo();
+        if (result && result.data) {
+            localStorage.setItem("realname", result.data.realname);
+        }
         // 获取本地信息
         let name = localStorage.getItem('realname')
-        let socialType = localStorage.getItem('token_type')
+        let socialType = localStorage.getItem('social_type')
         if (name !== null && socialType !== null && this.data.id_card !== '') {
             this.$router.push('/social?is_fund=1')
         } else {
@@ -159,8 +163,13 @@ export default class Index extends Vue {
     }
 
     // 点击社保
-    hSocialInsurance () {
+    async hSocialInsurance () {
+        let result = await Http.getInstance().userinfo();
+        if (result && result.data) {
+            localStorage.setItem("realname", result.data.realname);
+        }
         let name = localStorage.getItem('realname')
+        let socialType = localStorage.getItem('social_type')
         // 获取本地社保类型
         let is_town = localStorage.getItem('is_town')
         console.log(is_town);
@@ -170,7 +179,7 @@ export default class Index extends Vue {
             });
             return
         }
-        if (name !== null && this.data.id_card !== '') {
+        if (name !== null && this.data.id_card !== '' && socialType !== null) {
             this.$router.push('/social?is_fund=0')
         } else {
             this.$router.push('/user/info')