Przeglądaj źródła

change in basic service, now showing alert of possible failures

jason.lu 6 lat temu
rodzic
commit
2585416eb5

+ 1 - 1
sourcecode/h5app/vue/src/connector/basic-service.js

@@ -322,7 +322,7 @@ var BasicFunction = new (function () {
     };
 
     this.on_fail = function (msg) {
-        alert("系统遇到小问题,程序猿学长正在快马加鞭修复!请联系微信:lugt00,第一时间为你手动匹配!");
+        alert("网络可能不畅,为了给您更佳的体验,您可以微信搜索支持服务账号 lugt00, 专享人工匹配!");
         BasicFunction.Queue.errorCount += 1;
         if (BasicFunction.Queue.errorCount >= 10) {
             BasicFunction.Queue.errorCount = 0;

+ 14 - 8
sourcecode/h5app/vue/src/views/SecurityVerify.vue

@@ -166,7 +166,7 @@
                 BasicFunction.get_data("http://gift.fogice.com/server/fileserver/upload?sign=abcdefg", function (res) {
                     // console.log('----- upload photo result -----');
                     // console.log(res);
-                    if (res == undefined || res.model === undefined || res.model.length === 0) {
+                    if (res === undefined || res.model === undefined || res.model.length === 0) {
                         Toast.fail('上传失败,请重试');
                         return;
                     }
@@ -191,7 +191,7 @@
                                         // console.log('----- User Info -----');
                                         BasicFunction.get_data('smartUsers/list?uid=' + userId, function (res) {
                                             // console.log(res);
-                                            if (res.ret === '10000') {
+                                            if (res.ret === '10000' && ret.model !== undefined && ret.model.list !== undefined) {
                                                 let user = res.model.list[0];
                                                 user.name = that.username;
                                                 user.phone = that.phone;
@@ -240,11 +240,17 @@
         created: function () {
             let userid = localStorage.getItem('frontend-userid');
             let that = this;
-            BasicFunction.get_data('smartUsers/list?uid=' + userid, function (res) {
+            BasicFunction.get_data('smartUsers/me?uid=' + userid, function (res) {
                 // console.log('----- User Info ----- ' + userid);
                 // console.log(res);
-                if (res.ret === '10000') {
+                if (res !== undefined && res.ret === "10000"
+                    && res.model !== undefined
+                    && res.model.list !== undefined
+                    && res.model.list.length > 0
+                    && res.model.list[0].phone !== undefined) {
                     if (res.model.list[0].phone.length !== 0) that.$router.push('presentRegister');
+                } else {
+                    that.$router.push('index');
                 }
             }, {});
         }
@@ -264,7 +270,7 @@
                 }
             } else if (substring.length > 1) {
                 var ls = substring.charCodeAt(i + 1);
-                if (ls == 0x20e3) {
+                if (ls === 0x20e3) {
                     return true;
                 }
             } else {
@@ -276,9 +282,9 @@
                     return true;
                 } else if (0x3297 <= hs && hs <= 0x3299) {
                     return true;
-                } else if (hs == 0xa9 || hs == 0xae || hs == 0x303d || hs == 0x3030
-                    || hs == 0x2b55 || hs == 0x2b1c || hs == 0x2b1b
-                    || hs == 0x2b50) {
+                } else if (hs === 0xa9 || hs === 0xae || hs === 0x303d || hs === 0x3030
+                    || hs === 0x2b55 || hs === 0x2b1c || hs === 0x2b1b
+                    || hs === 0x2b50) {
                     return true;
                 }
             }