给token区分环境

This commit is contained in:
kron
2025-09-12 17:49:26 +08:00
parent 24b776f327
commit 0a151de3c9
6 changed files with 36 additions and 15 deletions

View File

@@ -102,7 +102,9 @@ function reconnect(onMessage) {
reconnectTimer && clearTimeout(reconnectTimer);
closeWebSocket(); // 确保关闭旧连接
const token = uni.getStorageSync("token");
const token = uni.getStorageSync(
`${uni.getAccountInfoSync().miniProgram.envVersion}_token`
);
if (!token) return;
reconnectTimer = setTimeout(() => {