xiongzhu 4 anni fa
parent
commit
d15d5136c9

+ 1 - 0
src/main/nine-space/package.json

@@ -19,6 +19,7 @@
         "dayjs": "^1.10.7",
         "echarts": "^4.9.0",
         "element-ui": "^2.15.6",
+        "eruda": "^2.4.1",
         "html2canvas": "^1.3.2",
         "lodash": "^4.17.21",
         "mathjs": "^9.5.1",

+ 0 - 2
src/main/nine-space/public/index.html

@@ -28,7 +28,5 @@
         </noscript>
         <div id="app"></div>
         <!-- built files will be auto injected -->
-        <script src="//cdn.jsdelivr.net/npm/eruda"></script>
-        <script>eruda.init();</script>
     </body>
 </html>

+ 6 - 36
src/main/nine-space/src/main.js

@@ -19,46 +19,16 @@ import common from './mixins/common';
 import VueClipboard from 'vue-clipboard2';
 import queryString from 'query-string';
 import PageBar from './components/PageBar';
+import eruda from 'eruda';
+
+let showConsole = localStorage.getItem('showConsole');
+if (showConsole && parseInt(showConsole) > new Date().getTime()) {
+    eruda.init();
+}
 store.commit('setFirstUrl', location.href);
 
 import ImgContent from './components/ImgContent.vue';
 
-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)
     .use(Vant)
     .use(http)

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

@@ -4,6 +4,7 @@ import { Page } from './Page';
 import { Dialog } from 'vant';
 import http from '../plugins/http';
 
+jsapiSign();
 function jsapiSign() {
     if (/micromessenger/i.test(navigator.userAgent) && !/localhost|(192\.168)/i.test(location.host)) {
         return;

+ 21 - 2
src/main/nine-space/src/views/account/Setting.vue

@@ -42,7 +42,7 @@
                     <van-uploader class="avatar" :after-read="afterRead2" result-type="file" />
                 </template>
             </van-cell>
-            <van-cell class="not" title="编码" :value="userInfo.id" />
+            <van-cell class="not" title="编码" :value="userInfo.id" @click="showConsole" />
         </van-cell-group>
 
         <van-action-sheet
@@ -58,6 +58,7 @@
 <script>
 import { mapState } from 'vuex';
 import { ref } from 'vue';
+import eruda from 'eruda';
 export default {
     computed: {
         ...mapState(['userInfo'])
@@ -69,7 +70,9 @@ export default {
 
         return {
             show,
-            actions
+            actions,
+            clickNum: 0,
+            timeout: null
         };
     },
     methods: {
@@ -97,6 +100,22 @@ export default {
                     this.$toast.clear();
                 });
             });
+        },
+        showConsole() {
+            this.clickNum++;
+            if (this.clickNum >= 10) {
+                localStorage.setItem('showConsole', new Date().getTime() + 60 * 60 * 1000);
+                eruda.init();
+                this.clickNum = 0;
+                return;
+            } else {
+                if (this.timeout) {
+                    clearTimeout(this.timeout);
+                }
+                this.timeout = setTimeout(() => {
+                    this.clickNum = 0;
+                }, 1000);
+            }
         }
     }
 };

+ 5 - 0
src/main/nine-space/yarn.lock

@@ -3812,6 +3812,11 @@ error-stack-parser@^2.0.2:
   dependencies:
     stackframe "^1.1.1"
 
+eruda@^2.4.1:
+  version "2.4.1"
+  resolved "https://registry.nlark.com/eruda/download/eruda-2.4.1.tgz#dedc9b78546feb827d6ccafbfd7dae480509d2a2"
+  integrity sha1-3tybeFRv64J9bMr7/X2uSAUJ0qI=
+
 es-abstract@^1.17.2, es-abstract@^1.19.1:
   version "1.19.1"
   resolved "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.1.tgz"