This commit is contained in:
zlwu committed 2026-07-18 09:14:02 +08:00
1 parent a903fcf6d4
commit 259c55cc23
80 files changed
+6090 -123

No files matched your search

+2 -6
View File
@@ -3,7 +3,8 @@ import { API_BASE, TOKEN_KEY, REFRESH_TOKEN_KEY, USER_INFO_KEY } from '@/config/
let clearingAuth = false
// TODO(config-hardcoded): 以下加密参数为临时写死,后续应迁移至构建期注入或安全配置下发。
// 写死配置:不从环境变量读取,避免小程序端注入差异导致行为不一致。
let API_ENCRYPT_ENABLED = true
// 移动端(H5 + 微信小程序)统一走明文 JSON,便于联调排查入参;Web 管理端仍可单独开加密。
const API_ENCRYPT_ENABLED = false
const API_ENCRYPT_FAIL_OPEN = false
const API_ENCRYPT_FIXED_SECRET = 'shanxia-web-api-crypto-fixed-secret'
// TODO(config-hardcoded): 排除路径清单后续改为集中配置,避免多端重复维护。
@@ -14,11 +15,6 @@ const API_ENCRYPT_EXCLUDE_PATHS = String(
.map((item) => item.trim())
.filter(Boolean)
// #ifdef MP-WEIXIN
// 微信小程序运行时不保证 WebCrypto(getRandomValues/subtle),关闭前端加密避免全链路请求失败。
API_ENCRYPT_ENABLED = false
// #endif
function appendTimestampQuery(url) {
const base = String(url || '')
const ts = Date.now()