refactor: router guard
This commit is contained in:
@@ -40,15 +40,6 @@ export const userClient = new Request({
|
||||
|
||||
export const ndmClient = new Request({
|
||||
requestInterceptor: async (config) => {
|
||||
// 当OCC的token失效时,虽然不会影响车站请求,但是需要重新登录,所以在车站请求之前需要校验OCC的登录状态
|
||||
const [err] = await userClient.post<void>(`/api/ndm/ndmKeepAlive/verify`, {}, { timeout: 5000 });
|
||||
if (err) {
|
||||
window.$message.error('登录超时,请重新登录');
|
||||
const userStore = useUserStore();
|
||||
userStore.resetStore();
|
||||
router.push('/login');
|
||||
return Promise.reject(err);
|
||||
}
|
||||
const userStore = useUserStore();
|
||||
const { lampAuthorization, lampClientId, lampClientSecret } = getAppEnvConfig();
|
||||
const newAuthorization = window.btoa(`${lampClientId}:${lampClientSecret}`);
|
||||
|
||||
Reference in New Issue
Block a user