jason.lu před 6 roky
rodič
revize
c72c5cadd3

+ 4 - 0
sourcecode/h5app/vue/src/views/PresentRegister.vue

@@ -152,6 +152,10 @@
 
                 // console.log('------- photo -------');
                 // console.log(this.photo);
+                if(userId == null || userId === undefined){
+                    this.$router.push('login');
+                    return;
+                }
 
                 let that = this;
                 // 如果没有改变图片,直接上传

+ 12 - 1
sourcecode/h5app/vue/src/views/SecurityVerify.vue

@@ -269,11 +269,22 @@
         created: function () {
             let userid = localStorage.getItem('frontend-userid');
             let that = this;
+            if(userid == null || userid === undefined){
+                this.$router.push('login');
+                return;
+            }
             BasicFunction.get_data('smartUsers/list?uid=' + userid, function (res) {
                 // console.log('----- User Info ----- ' + userid);
                 // console.log(res);
                 if (res.ret === '10000') {
-                    if (res.model.list[0].phone.length !== 0) that.$router.push('presentRegister');
+                    if(res.model === undefined || res.model == null || res.model.list == undefined || res.model.list.length <= 0){
+                        this.$router.push('login');
+                        return;
+                    }
+                    if (res.model.list[0].phone.length !== 0) {
+                        that.$router.push('presentRegister');
+                        return;
+                    }
                 }
             }, {});
         }