给token区分环境
This commit is contained in:
@@ -15,7 +15,9 @@ export const checkConnection = () => {
|
||||
data: JSON.stringify({ event: "ping", data: {} }),
|
||||
fail: () => {
|
||||
websocket.closeWebSocket();
|
||||
const token = uni.getStorageSync("token");
|
||||
const token = uni.getStorageSync(
|
||||
`${uni.getAccountInfoSync().miniProgram.envVersion}_token`
|
||||
);
|
||||
if (!token) return;
|
||||
// 如果发送失败,说明连接已断开,需要重新连接
|
||||
websocket.createWebSocket(token, (content) => {
|
||||
|
||||
Reference in New Issue
Block a user