From c232a25c5dbff0804bb711664cdbe0896eed184a Mon Sep 17 00:00:00 2001 From: hxhxhx <2357034401@qq.com> Date: Wed, 7 May 2025 18:19:14 +0800 Subject: [PATCH] 1 --- static/js/getIsUser.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/static/js/getIsUser.js b/static/js/getIsUser.js index ac245ad..d790164 100644 --- a/static/js/getIsUser.js +++ b/static/js/getIsUser.js @@ -51,16 +51,20 @@ function publikRequesFunction(api,type,params){ data: params, success(res) { resolve(res) - if(res.code === 401){ - window.localStorage.clear(); - window.location.href = 'login.html' - }else{ - resolve(res) - } }, error(rej){ console.log(rej,'错误请求'); if(rej.status === 401){ + let language = window.localStorage.getItem("languageNow"); + let message = language == 'zh' ? '請重新登入' : 'Please log in again'; + const html ="
" + document.body.innerHTML += html + const item = document.getElementById('customizeBox'); + item.classList.add('show') + setTimeout(()=>{ + const item = document.getElementById('customizeBox') + item.classList.remove('show') + },2000) window.localStorage.clear(); window.location.href = 'login.html' }else{