diff --git a/public/GwKDMM6vRz.txt b/public/GwKDMM6vRz.txt new file mode 100644 index 0000000..4eb0182 --- /dev/null +++ b/public/GwKDMM6vRz.txt @@ -0,0 +1 @@ +70011ed2d63c3cfa7094f5cb2a9aafea \ No newline at end of file diff --git a/public/MP_verify_sfIpUAfcT78BnMBv.txt b/public/MP_verify_sfIpUAfcT78BnMBv.txt new file mode 100644 index 0000000..ee9eb0f --- /dev/null +++ b/public/MP_verify_sfIpUAfcT78BnMBv.txt @@ -0,0 +1 @@ +sfIpUAfcT78BnMBv \ No newline at end of file diff --git a/src/App.vue b/src/App.vue index ac4eab5..af3ba29 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,6 +1,5 @@ diff --git a/src/pages.json b/src/pages.json index 0027213..5f6c315 100644 --- a/src/pages.json +++ b/src/pages.json @@ -1,13 +1,19 @@ { "pages": [ { - "path": "pages/register/register", + "path": "pages/index/scan", "style": { "navigationStyle": "custom" } }, { - "path": "pages/index/scan", + "path": "pages/auth/loading", + "style": { + "navigationStyle": "custom" + } + }, + { + "path": "pages/register/register", "style": { "navigationStyle": "custom" } @@ -43,4 +49,4 @@ "navigationBarBackgroundColor": "#F8F8F8", "backgroundColor": "#F8F8F8" } -} \ No newline at end of file +} diff --git a/src/pages/auth/loading.vue b/src/pages/auth/loading.vue new file mode 100644 index 0000000..9000b71 --- /dev/null +++ b/src/pages/auth/loading.vue @@ -0,0 +1,193 @@ + + + + + diff --git a/src/pages/index/scan.vue b/src/pages/index/scan.vue index d8f7e3f..30dc544 100644 --- a/src/pages/index/scan.vue +++ b/src/pages/index/scan.vue @@ -67,7 +67,15 @@ export default { }; }, onLoad(options) { - // 1. query 参数中携带设备编号 + // 1. 检查 JWT(App.vue 已处理首次跳转,这里兜底) + const token = uni.getStorageSync('token'); + if (!token) { + // 无 JWT → 跳转授权 Loading 页 + uni.redirectTo({ url: '/pages/auth/loading' }); + return; + } + + // 2. 有 JWT + query 参数中携带设备编号 if (options.device_id) { uni.redirectTo({ url: '/pages/index/index?device_id=' + options.device_id, @@ -76,7 +84,7 @@ export default { } // #ifdef H5 - // 2. URL 路径中携带设备编号(如 http://xxx/A1036) + // 3. URL 路径中携带设备编号(如 http://xxx/A1036) const path = window.location.pathname; const segments = path.split('/').filter(Boolean); if (segments.length > 0) { diff --git a/src/pages/register/register.vue b/src/pages/register/register.vue index f74e765..1555e90 100644 --- a/src/pages/register/register.vue +++ b/src/pages/register/register.vue @@ -6,6 +6,12 @@ 请输入手机号获取验证码完成注册 + + + + {{ authInfo.nickname }} + + @@ -62,8 +68,7 @@