diff --git a/src/App.vue b/src/App.vue index 3352c54..874dca4 100644 --- a/src/App.vue +++ b/src/App.vue @@ -83,7 +83,17 @@ export default { } } }; - paintingDetail(); + setTimeout(() => { + if (window.plus) { + if (plus?.webview.getWebviewById("wv").tokenScan) { + paintingDetail(); + } + } else { + if (uni.getStorageSync("store-token")) { + paintingDetail(); + } + } + }, 200); }, onHide: function () { console.log("App Hide"); diff --git a/src/pages.json b/src/pages.json index 52e2e02..df703ea 100644 --- a/src/pages.json +++ b/src/pages.json @@ -9,13 +9,7 @@ } }, "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages - { - "path": "pages/login/index", - "style": { - "navigationBarTitleText": "登录", - "enablePullDownRefresh": false - } - }, + { "path": "pages/index/index", "style": { @@ -23,7 +17,13 @@ "enablePullDownRefresh": false } }, - + { + "path": "pages/login/index", + "style": { + "navigationBarTitleText": "登录", + "enablePullDownRefresh": false + } + }, { "path": "pages/painting/index", "style": { diff --git a/src/pages/login/index.vue b/src/pages/login/index.vue index ad8bafb..d1a3eef 100644 --- a/src/pages/login/index.vue +++ b/src/pages/login/index.vue @@ -121,12 +121,16 @@ onLoad((options) => { state.pid = options.pid; // 已经登录了 setTimeout(() => { - if ( - window?.plus?.webview.getWebviewById("wv").tokenScan || - uni.getStorageSync("store-token") - ) { - paintingDetail(); - getBtngetRules(); + if (window.plus) { + if (plus?.webview.getWebviewById("wv").tokenScan) { + paintingDetail(); + getBtngetRules(); + } + } else { + if (uni.getStorageSync("store-token")) { + paintingDetail(); + getBtngetRules(); + } } }, 200); }