优化:登录页面长时间停留导致 CSRF 失效时自动显示中文提示并刷新
This commit is contained in:
@@ -452,6 +452,14 @@
|
||||
body
|
||||
})))
|
||||
.then(result => {
|
||||
if (result.status === 419 || (result.body && result.body.message === 'CSRF token mismatch.')) {
|
||||
showAlert('安全令牌已过期,正在自动刷新...', 'error');
|
||||
setTimeout(() => {
|
||||
window.location.reload();
|
||||
}, 1500);
|
||||
return;
|
||||
}
|
||||
|
||||
if (result.status === 200 && result.body.status === 'success') {
|
||||
showAlert(result.body.message, 'success');
|
||||
const chatUrl = '/room/' + roomId;
|
||||
|
||||
Reference in New Issue
Block a user