diff --git a/config/config.ts b/config/config.ts index 9a3c3b8a..6b94b56b 100644 --- a/config/config.ts +++ b/config/config.ts @@ -6,7 +6,7 @@ export default { title: 'Jetlinks', // 浏览器标签页title layout: { title: '物联网平台', // 平台title - logo: '/icons/icon-192x192.png', // 平台logo + logo: '/logo.png', // 平台logo siderWidth: 208, // 左侧菜单栏宽度 headerHeight: 48, // 头部高度 collapsedWidth: 48, diff --git a/src/router/index.ts b/src/router/index.ts index 1ecbc43e..1641803e 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,5 +1,5 @@ import { createRouter, createWebHashHistory } from 'vue-router' -import menus, { AccountCenterBindPath, InitHomePath, LoginPath } from './menu' +import menus, { AccountCenterBindPath, InitHomePath, LoginPath, OauthPath } from './menu' import { cleanToken, getToken } from '@/utils/comm' import { useUserInfo } from '@/store/userInfo' import { useSystem } from '@/store/system' @@ -14,12 +14,13 @@ const router = createRouter({ } }) -const filterPath = [ InitHomePath, AccountCenterBindPath ] +const filterPath = [ InitHomePath ] +const noTokenPath = [ AccountCenterBindPath, OauthPath ] router.beforeEach((to, from, next) => { // TODO 切换路由取消请求 const token = getToken() - if (to.path === AccountCenterBindPath) { + if (noTokenPath.includes(to.path)) { next() } else if (token) { if (to.path === LoginPath) { diff --git a/src/utils/request.ts b/src/utils/request.ts index 9676b40d..f6b2d6ed 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -13,7 +13,16 @@ interface AxiosResponseRewrite extends AxiosResponse { export const SUCCESS_CODE = 200 // 成功代码 -const filterApiUrl = ['/system/version', '/system/config/front', '/authorize/captcha/config', '/application/sso/_all', '/authorize/captcha/image', '/application/sso/bind-code', '/authorize/login'] +const filterApiUrl = [ + '/system/version', + '/system/config/front', + '/authorize/captcha/config', + '/application/sso/_all', + '/authorize/captcha/image', + '/application/sso/bind-code', + '/authorize/login', + '/application/' +] export const request = axios.create({ withCredentials: false, @@ -149,10 +158,10 @@ const errorHandler = (error: any) => { } else if (status === 401) { showNotification('Unauthorized', '用户未登录', '401') setTimeout(() => { - cleanToken() - router.replace({ - path: LoginPath - }) + // cleanToken() + // router.replace({ + // path: LoginPath + // }) }, 0) } else if (status === 404) { showNotification(error?.code, error?.response?.data?.message, '404') diff --git a/src/views/oauth/index.vue b/src/views/oauth/index.vue index 547796f1..6fc36ac6 100644 --- a/src/views/oauth/index.vue +++ b/src/views/oauth/index.vue @@ -14,9 +14,10 @@
+

授权登录

- 您正在授权登录,{{ appName }}将获得以下权限: + 您正在授权登录, {{ appName }} 将获得以下权限:
  • 关联{{userName}}账号
  • @@ -32,15 +33,16 @@
    +

    授权登录