xiongzhu 4 år sedan
förälder
incheckning
65086fc624
2 ändrade filer med 35 tillägg och 1 borttagningar
  1. 35 0
      src/main/nine-space/src/main.js
  2. 0 1
      src/main/nine-space/src/router/index.js

+ 35 - 0
src/main/nine-space/src/main.js

@@ -18,6 +18,41 @@ import queryString from 'query-string';
 import VConsole from 'vconsole';
 import VConsole from 'vconsole';
 const vConsole = new VConsole();
 const vConsole = new VConsole();
 console.log('mainUrl::', location);
 console.log('mainUrl::', location);
+http.http
+    .get('/wx/jsapiSign', { url: location.href })
+    .then(res => {
+        wx.config({
+            debug: false,
+            appId: res.appId,
+            timestamp: res.timestamp,
+            nonceStr: res.nonceStr,
+            signature: res.signature,
+            jsApiList: [
+                'chooseWXPay',
+                'updateAppMessageShareData',
+                'updateTimelineShareData',
+                'hideAllNonBaseMenuItem',
+                'scanQRCode'
+            ]
+        });
+        wx.error(function (res) {
+            console.log(res);
+        });
+        wx.ready(function () {
+            wx.updateAppMessageShareData({
+                title: '第九空间',
+                desc: '全球首个基于区块链的游戏资产集换中心',
+                link: location.origin + '/9th',
+                imgUrl: 'https://9space-2021.oss-cn-shenzhen.aliyuncs.com/nft/2021-11-05-15-58-30YwqLzMjy.jpg'
+            });
+            wx.updateTimelineShareData({
+                title: '第九空间-全球首个基于区块链的游戏资产集换中心',
+                link: location.origin + '/9th',
+                imgUrl: 'https://9space-2021.oss-cn-shenzhen.aliyuncs.com/nft/2021-11-05-15-58-30YwqLzMjy.jpg'
+            });
+        });
+    })
+    .catch(e => {});
 createApp(App)
 createApp(App)
     .use(Vant)
     .use(Vant)
     .use(http)
     .use(http)

+ 0 - 1
src/main/nine-space/src/router/index.js

@@ -4,7 +4,6 @@ import { Page } from './Page';
 import { Dialog } from 'vant';
 import { Dialog } from 'vant';
 import http from '../plugins/http';
 import http from '../plugins/http';
 
 
-console.log(http);
 function jsapiSign() {
 function jsapiSign() {
     if (/micromessenger/i.test(navigator.userAgent)) {
     if (/micromessenger/i.test(navigator.userAgent)) {
         http.http
         http.http