Kaynağa Gözat

getSigned(apiList, callback)

jason.lu 6 yıl önce
ebeveyn
işleme
69e6f3650e

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

@@ -431,11 +431,20 @@ var BasicFunction = new (function () {
         return "";
     };
 
-    this.getSigned = function() {
-        var APPID = "wx47691e7aabf77631";
-        var re_uri = "https://gift.fogice.com/wxjs/oauth.php?otp=" + this.utils_get_parm("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";
+    this.getSigned = function(apilist, func) {
+        let that = func;
+        this.get_data("!!/wxjs/signed.php?purl=" + encodeURIComponent(location.href),
+        function(ret){
+            wx.config({
+                debug: false,
+                appId: ret.appId,
+                timestamp: ret.timestamp,
+                nonceStr: ret.nonceStr,
+                signature: ret.signature,
+                jsApiList: apilist
+            });
+            that();
+        }, "");
     };
 
     this.gotoJsLogin = function() {