Преглед на файлове

fix present and security verify

jason.lu преди 6 години
родител
ревизия
8c752e555f

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

@@ -453,7 +453,7 @@ var BasicFunction = new (function () {
 
     this.gotoJsLogin = function() {
         //var APPID = "wx47691e7aabf77631";
-        //var re_uri = "https://gift.fogice.com/wxjs/oauth.php?otp=" + this.utils_get_parm("otp");
+        //var re_uri = "https://gift.fogice.com/wxjs/oauth.php?otp=" + this.utils_get_param("otp");
         //var redir = encodeURIComponent(re_uri);
         //location.href="https://open.weixin.qq.com/connect/oauth2/authorize?appid="+ APPID+ "&redirect_uri=" +redir+  "&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect";
     };

+ 22 - 16
sourcecode/h5app/vue/src/views/PresentRegister.vue

@@ -113,6 +113,7 @@
                 tag: 0,
                 photo: null,
                 loading: false,
+                imgUrl : "",
                 giftDo: {}
             }
         },
@@ -303,6 +304,9 @@
                 let present = giftDo;
                 // console.log('----- Present Info -----');
                 // console.log(present);
+                if(present.id == null || present.id == undefined){
+                    return;
+                }
                 this.presentId = present.id;
                 this.gender = present.gender.toString();
                 this.presentName = present.name;
@@ -317,27 +321,29 @@
                 this.$router.push('login');
                 return;
             }
+            let that = this;
             let presentId = this.$route.query.presentId;
             if(presentId == null || presentId == undefined){
-                presentId = BasicFunction.utils_get_parm("presentId");
+                presentId = BasicFunction.utils_get_param("presentId");
             }
             if(presentId == undefined || presentId == null){
-                Toast.fail('请重新进入礼物页哦');
-                this.$router.push('index');
-            }
-
-            let that = this;
-            BasicFunction.get_data('smartGoods/list?goodId=' + presentId, function (res) {
-                if (res.ret === '10000') {
-                    if(res.model === undefined || res.model == null || res.model.list == undefined || res.model.list.length <= 0){
-                        Toast.fail('礼物查看遇到问题,请稍等一下再试吧');
-                        that.$router.push('index');
-                        return;
+                // do nothing
+                that.giftDo = {};
+                that.onReadExisting(that.giftDo);
+            } else {
+                let that = this;
+                BasicFunction.get_data('smartGoods/list?goodId=' + presentId, function (res) {
+                    if (res.ret === '10000') {
+                        if (res.model === undefined || res.model == null || res.model.list == undefined || res.model.list.length <= 0) {
+                            Toast.fail('礼物查看遇到问题,请稍等一下再试吧');
+                            that.$router.push('index');
+                            return;
+                        }
+                        that.giftDo = res.model.list[0];
+                        that.onReadExisting(that.giftDo);
                     }
-                    that.giftDo = res.model.list[0];
-                    that.onReadExisting(that.giftDo);
-                }
-            }, {});
+                }, {});
+            }
         }
     }
 

+ 2 - 2
sourcecode/h5app/vue/src/views/giftDetail.vue

@@ -152,7 +152,7 @@
             loadGift(){
                 let presentId = this.$route.query.presentId;
                 if(presentId == null || presentId == undefined){
-                    presentId = BasicFunction.utils_get_parm("presentId");
+                    presentId = BasicFunction.utils_get_param("presentId");
                 }
                 if(presentId == undefined || presentId == null){
                     Toast.fail('请重新进入礼物页哦');
@@ -215,7 +215,7 @@
                 try {
                     if (res.ret === '10000' && !(res.model === undefined || res.model == null || res.model.list == undefined || res.model.list.length <= 0)){
                         that.identityDo = res.model.list[0];
-                        this.loadGift();
+                        that.loadGift();
                     } else Toast.fail('获取信息失败');
                 } catch (e) {
                     console.warn(e);