forked from github/dataease
perf(X-Pack): 默认登录方式-在默认非普通登录方式场景下增加admin-login路由
This commit is contained in:
parent
fa9c35b520
commit
eaec3cb2a5
29
core/core-frontend/src/assets/svg/401.svg
Normal file
29
core/core-frontend/src/assets/svg/401.svg
Normal file
@ -0,0 +1,29 @@
|
||||
<svg width="101" height="87" viewBox="0 0 101 87" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M2.5 -0.000976562H98.5C99.6046 -0.000976563 100.5 0.894454 100.5 1.99902V84.9038C100.5 86.0084 99.6046 86.9038 98.5 86.9038H2.5C1.39543 86.9038 0.5 86.0084 0.5 84.9038V1.99902C0.5 0.894454 1.39543 -0.000976562 2.5 -0.000976562Z" fill="#D6DAE1"/>
|
||||
<mask id="mask0_262_30765" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="-1" width="101" height="88">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M2.5 -0.000976562H98.5C99.6046 -0.000976563 100.5 0.894454 100.5 1.99902V84.9038C100.5 86.0084 99.6046 86.9038 98.5 86.9038H2.5C1.39543 86.9038 0.5 86.0084 0.5 84.9038V1.99902C0.5 0.894454 1.39543 -0.000976562 2.5 -0.000976562Z" fill="white"/>
|
||||
</mask>
|
||||
<g mask="url(#mask0_262_30765)">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M-3.07178 -7.14453H102.881V14.284H-3.07178V-7.14453Z" fill="#B5BEC8"/>
|
||||
</g>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.8331 9.52411C10.1481 9.52411 11.2141 8.45812 11.2141 7.14316C11.2141 5.8282 10.1481 4.76221 8.8331 4.76221C7.51814 4.76221 6.45215 5.8282 6.45215 7.14316C6.45215 8.45812 7.51814 9.52411 8.8331 9.52411Z" fill="white"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M15.9762 9.52411C17.2911 9.52411 18.3571 8.45812 18.3571 7.14316C18.3571 5.8282 17.2911 4.76221 15.9762 4.76221C14.6612 4.76221 13.5952 5.8282 13.5952 7.14316C13.5952 8.45812 14.6612 9.52411 15.9762 9.52411Z" fill="white"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M23.1187 9.52411C24.4337 9.52411 25.4997 8.45812 25.4997 7.14316C25.4997 5.8282 24.4337 4.76221 23.1187 4.76221C21.8038 4.76221 20.7378 5.8282 20.7378 7.14316C20.7378 8.45812 21.8038 9.52411 23.1187 9.52411Z" fill="white"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M44.5477 22.6187H13.2144C12.1098 22.6187 11.2144 23.5141 11.2144 24.6187V74.1901C11.2144 75.2947 12.1098 76.1901 13.2144 76.1901H52.1263L41.6098 65.3387L49.583 55.2156L41.6098 46.6868L50.9358 33.9282L44.5477 22.6187Z" fill="#F4F5F9"/>
|
||||
<mask id="mask1_262_30765" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="11" y="22" width="42" height="55">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M44.5477 22.6187H13.2144C12.1098 22.6187 11.2144 23.5141 11.2144 24.6187V74.1901C11.2144 75.2947 12.1098 76.1901 13.2144 76.1901H52.1263L41.6098 65.3387L49.583 55.2156L41.6098 46.6868L50.9358 33.9282L44.5477 22.6187Z" fill="white"/>
|
||||
</mask>
|
||||
<g mask="url(#mask1_262_30765)">
|
||||
<rect x="17.9033" y="42.9996" width="63" height="6" rx="1" fill="#E0E4E8"/>
|
||||
<rect x="17.9033" y="31.9985" width="63" height="6" rx="1" fill="#E0E4E8"/>
|
||||
</g>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M48.0167 22.6187H86.5954C87.6999 22.6187 88.5954 23.5141 88.5954 24.6187V74.1901C88.5954 75.2947 87.6999 76.1901 86.5954 76.1901H55.6135L45.583 65.4615L54.0716 54.0824L45.583 46.5528L54.0716 33.9282L48.0167 22.6187Z" fill="#F4F5F9"/>
|
||||
<mask id="mask2_262_30765" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="45" y="22" width="44" height="55">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M48.0167 22.6187H86.5954C87.6999 22.6187 88.5954 23.5141 88.5954 24.6187V74.1901C88.5954 75.2947 87.6999 76.1901 86.5954 76.1901H55.6135L45.583 65.4615L54.0716 54.0824L45.583 46.5528L54.0716 33.9282L48.0167 22.6187Z" fill="white"/>
|
||||
</mask>
|
||||
<g mask="url(#mask2_262_30765)">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M18.9033 31.9985H79.9033C80.4556 31.9985 80.9033 32.3716 80.9033 32.8319V36.1652C80.9033 36.6254 80.4556 36.9985 79.9033 36.9985H18.9033C18.351 36.9985 17.9033 36.6254 17.9033 36.1652V32.8319C17.9033 32.3716 18.351 31.9985 18.9033 31.9985Z" fill="#E0E4E8"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M18.9033 42.9996H79.9033C80.4556 42.9996 80.9033 43.3727 80.9033 43.833V47.1663C80.9033 47.6265 80.4556 47.9996 79.9033 47.9996H18.9033C18.351 47.9996 17.9033 47.6265 17.9033 47.1663V43.833C17.9033 43.3727 18.351 42.9996 18.9033 42.9996Z" fill="#E0E4E8"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M56.9033 57.9996H79.9033C80.4556 57.9996 80.9033 58.3727 80.9033 58.833V62.1663C80.9033 62.6265 80.4556 62.9996 79.9033 62.9996H56.9033C56.351 62.9996 55.9033 62.6265 55.9033 62.1663V58.833C55.9033 58.3727 56.351 57.9996 56.9033 57.9996Z" fill="#E0E4E8"/>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 4.2 KiB |
@ -48,7 +48,8 @@ export default {
|
||||
copy_unsupported: '您的浏览器不支持复制',
|
||||
filter: '筛选',
|
||||
filter_condition: '筛选条件',
|
||||
no_auth_tips: '缺少菜单权限,请联系管理员'
|
||||
no_auth_tips: '缺少菜单权限,请联系管理员',
|
||||
no_menu_tips: '未找到资源 401错误'
|
||||
},
|
||||
dynamic_time: {
|
||||
set_default: '设置默认值',
|
||||
|
@ -22,7 +22,7 @@ const { start, done } = useNProgress()
|
||||
|
||||
const { loadStart, loadDone } = usePageLoading()
|
||||
|
||||
const whiteList = ['/login', '/de-link', '/chart-view', '/notSupport'] // 不重定向白名单
|
||||
const whiteList = ['/login', '/de-link', '/chart-view', '/notSupport', '/admin-login', '/401'] // 不重定向白名单
|
||||
const embeddedWindowWhiteList = ['/dvCanvas', '/dashboard', '/preview', '/dataset-embedded-form']
|
||||
const embeddedRouteWhiteList = ['/dataset-embedded', '/dataset-form', '/dataset-embedded-form']
|
||||
router.beforeEach(async (to, from, next) => {
|
||||
|
@ -50,6 +50,20 @@ export const routes: AppRouteRecordRaw[] = [
|
||||
meta: {},
|
||||
component: () => import('@/views/login/index.vue')
|
||||
},
|
||||
{
|
||||
path: '/admin-login',
|
||||
name: 'admin-login',
|
||||
hidden: true,
|
||||
meta: {},
|
||||
component: () => import('@/views/login/index.vue')
|
||||
},
|
||||
{
|
||||
path: '/401',
|
||||
name: '401',
|
||||
hidden: true,
|
||||
meta: {},
|
||||
component: () => import('@/views/401/index.vue')
|
||||
},
|
||||
{
|
||||
path: '/dvCanvas',
|
||||
name: 'dvCanvas',
|
||||
|
26
core/core-frontend/src/views/401/index.vue
Normal file
26
core/core-frontend/src/views/401/index.vue
Normal file
@ -0,0 +1,26 @@
|
||||
<template>
|
||||
<div class="page-not-found">
|
||||
<Icon className="login-logo-icon" name="401"></Icon>
|
||||
<span class="span-403">{{ t('common.no_menu_tips') }}</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { Icon } from '@/components/icon-custom'
|
||||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
const { t } = useI18n()
|
||||
</script>
|
||||
<style lang="less">
|
||||
.page-not-found {
|
||||
width: 100%;
|
||||
top: calc(50% - 100px);
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
}
|
||||
.span-403 {
|
||||
display: block;
|
||||
margin: 0;
|
||||
font-size: var(--ed-font-size-base);
|
||||
color: var(--ed-text-color-secondary);
|
||||
}
|
||||
</style>
|
@ -229,7 +229,12 @@ onMounted(async () => {
|
||||
loadArrearance()
|
||||
if (!checkPlatform()) {
|
||||
const res = await loginCategoryApi()
|
||||
if (res.data) {
|
||||
const adminLogin = router.currentRoute?.value?.name === 'admin-login'
|
||||
if (adminLogin && !res.data) {
|
||||
router.push('/401')
|
||||
return
|
||||
}
|
||||
if (res.data && !adminLogin) {
|
||||
loadingText.value = '加载中...'
|
||||
document.getElementsByClassName('ed-loading-text')?.length &&
|
||||
(document.getElementsByClassName('ed-loading-text')[0]['innerText'] = loadingText.value)
|
||||
|
Loading…
Reference in New Issue
Block a user