用户授权/验证文件上传
Uni-app H5 Deploy (Prod + Staging) / deploy (release) Successful in 45s

This commit is contained in:
kk
2026-07-02 18:25:23 +08:00
parent 127834e8dc
commit 525f94cb80
9 changed files with 356 additions and 264 deletions
+10 -2
View File
@@ -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) {