修改ws token替换问题

This commit is contained in:
龙运模
2024-09-03 15:09:34 +08:00
parent 9d0d5e6b94
commit d4a90bdb7d
4 changed files with 47 additions and 35 deletions
+7 -5
View File
@@ -139,11 +139,13 @@ function webSocketOnMessage(msg) {
global_callback(result);
}
}
if (result.type == -1 || result.type == 0 || result.type == 8 || result.type == 9) {
if(result.type == -1 || result.type == 0){
if(result.data && result.data.token){
tool.cookie.set("TOKEN", result.data.token);
if (result.data && (result.data.type == -1 || result.data.type == 0 || result.data.type == 8 || result.data.type == 9)) {
if(result.data.type == -1 || result.data.type == 0){
if(result.data && result.data.data.token){
console.log(result.data.data.token)
// tool.cookie.set("TOKEN", result.data.data.token);
let reToken = result.data.data.token.replace(/Bearer /g, "");
tool.cookie.set("TOKEN", reToken);
}
}else{
showNot = ElNotification.error({