Skip to content

Commit 2cedd3a

Browse files
committed
[Bug] vue router-name bug fixed.
1 parent 171a197 commit 2cedd3a

File tree

10 files changed

+32
-35
lines changed

10 files changed

+32
-35
lines changed

streampark-console/streampark-console-webapp/src/components/Application/src/AppDarkModeToggle.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@
6363
height: 18px;
6464
background-color: #fff;
6565
border-radius: 50%;
66-
transition: transform 0.5s, background-color 0.5s;
66+
transition:
67+
transform 0.5s,
68+
background-color 0.5s;
6769
will-change: transform;
6870
}
6971

streampark-console/streampark-console-webapp/src/components/ContextMenu/src/ContextMenu.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,9 @@
179179
background-color: @component-background;
180180
border: 1px solid rgb(0 0 0 / 8%);
181181
border-radius: 0.25rem;
182-
box-shadow: 0 2px 2px 0 rgb(0 0 0 / 14%), 0 3px 1px -2px rgb(0 0 0 / 10%),
182+
box-shadow:
183+
0 2px 2px 0 rgb(0 0 0 / 14%),
184+
0 3px 1px -2px rgb(0 0 0 / 10%),
183185
0 1px 5px 0 rgb(0 0 0 / 6%);
184186
background-clip: padding-box;
185187
user-select: none;

streampark-console/streampark-console-webapp/src/components/Form/src/BasicForm.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
});
114114
115115
const getBindValue = computed(
116-
() => ({ ...attrs, ...props, ...unref(getProps) } as Recordable),
116+
() => ({ ...attrs, ...props, ...unref(getProps) }) as Recordable,
117117
);
118118
119119
const getSchema = computed((): FormSchema[] => {

streampark-console/streampark-console-webapp/src/components/Page/src/PageFooter.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@
3939
line-height: 44px;
4040
background-color: @component-background;
4141
border-top: 1px solid @border-color-base;
42-
box-shadow: 0 -6px 16px -8px rgb(0 0 0 / 8%), 0 -9px 28px 0 rgb(0 0 0 / 5%),
42+
box-shadow:
43+
0 -6px 16px -8px rgb(0 0 0 / 8%),
44+
0 -9px 28px 0 rgb(0 0 0 / 5%),
4345
0 -12px 48px 16px rgb(0 0 0 / 3%);
4446
transition: width 0.2s;
4547

streampark-console/streampark-console-webapp/src/components/Table/src/components/HeaderCell.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
props: {
2323
column: {
2424
type: Object as PropType<BasicColumn>,
25-
default: () => ({} as BasicColumn),
25+
default: () => ({}) as BasicColumn,
2626
},
2727
},
2828
setup(props) {

streampark-console/streampark-console-webapp/src/hooks/web/useLockPage.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,12 @@ export function useLockPage() {
3232
}
3333
clear();
3434

35-
timeId = setTimeout(() => {
36-
lockPage();
37-
}, lockTime * 60 * 1000);
35+
timeId = setTimeout(
36+
() => {
37+
lockPage();
38+
},
39+
lockTime * 60 * 1000,
40+
);
3841
}
3942

4043
function lockPage(): void {

streampark-console/streampark-console-webapp/src/router/guard/permissionGuard.ts

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import { useUserStoreWithOut } from '/@/store/modules/user';
77

88
import { PAGE_NOT_FOUND_ROUTE } from '/@/router/routes/basic';
99

10+
import { PAGE_NOT_FOUND_NAME } from '/@/router/constant';
11+
1012
import { RootRoute } from '/@/router/routes';
1113

1214
const LOGIN_PATH = PageEnum.BASE_LOGIN;
@@ -18,12 +20,7 @@ const whitePathList: PageEnum[] = [LOGIN_PATH];
1820
export function createPermissionGuard(router: Router) {
1921
const userStore = useUserStoreWithOut();
2022
const permissionStore = usePermissionStoreWithOut();
21-
2223
router.beforeEach(async (to, from, next) => {
23-
const isPageNoFound = [
24-
PAGE_NOT_FOUND_ROUTE.name,
25-
PAGE_NOT_FOUND_ROUTE.name + '_CHILD',
26-
].includes(to.name as string);
2724
if (
2825
from.path === ROOT_PATH &&
2926
to.path === PageEnum.BASE_HOME &&
@@ -33,7 +30,6 @@ export function createPermissionGuard(router: Router) {
3330
next(userStore.getUserInfo.homePath);
3431
return;
3532
}
36-
3733
const token = userStore.getToken;
3834
// Whitelist can be directly entered
3935
if (whitePathList.includes(to.path as PageEnum)) {
@@ -77,23 +73,13 @@ export function createPermissionGuard(router: Router) {
7773
// Jump to the 404 page after processing the login
7874
if (
7975
from.path === LOGIN_PATH &&
80-
isPageNoFound &&
76+
to.name === PAGE_NOT_FOUND_NAME &&
8177
to.fullPath !== (userStore.getUserInfo.homePath || PageEnum.BASE_HOME)
8278
) {
8379
next(userStore.getUserInfo.homePath || PageEnum.BASE_HOME);
8480
return;
8581
}
8682

87-
// get userinfo while last fetch time is empty
88-
// if (userStore.getLastUpdateTime === 0) {
89-
// try {
90-
// await userStore.getUserInfoAction();
91-
// } catch (err) {
92-
// next();
93-
// return;
94-
// }
95-
// }
96-
9783
if (permissionStore.getIsDynamicAddedRoute) {
9884
next();
9985
return;
@@ -108,7 +94,7 @@ export function createPermissionGuard(router: Router) {
10894

10995
permissionStore.setDynamicAddedRoute(true);
11096

111-
if (isPageNoFound) {
97+
if (to.name === PAGE_NOT_FOUND_NAME) {
11298
// After dynamically adding the route, it should be redirected to fullPath here, otherwise the 404 page content will load
11399
next({ path: to.fullPath, replace: true, query: to.query });
114100
} else {

streampark-console/streampark-console-webapp/src/router/routes/basic.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
// 404 on a page
1111
export const PAGE_NOT_FOUND_ROUTE: AppRouteRecordRaw = {
1212
path: '/:path(.*)*',
13-
name: PAGE_NOT_FOUND_NAME,
13+
name: PAGE_NOT_FOUND_NAME + '_PARENT',
1414
component: LAYOUT,
1515
meta: {
1616
title: 'ErrorPage',
@@ -20,7 +20,7 @@ export const PAGE_NOT_FOUND_ROUTE: AppRouteRecordRaw = {
2020
children: [
2121
{
2222
path: '/:path(.*)*',
23-
name: PAGE_NOT_FOUND_NAME + '_CHILD',
23+
name: PAGE_NOT_FOUND_NAME,
2424
component: EXCEPTION_COMPONENT,
2525
meta: {
2626
title: 'ErrorPage',

streampark-console/streampark-console-webapp/src/utils/props.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ export const buildProps = <
175175
: never;
176176
};
177177

178-
export const definePropType = <T>(val: any) => ({ [wrapperKey]: val } as PropWrapper<T>);
178+
export const definePropType = <T>(val: any) => ({ [wrapperKey]: val }) as PropWrapper<T>;
179179

180180
export const keyOf = <T extends Object>(arr: T) => Object.keys(arr) as Array<keyof T>;
181181
export const mutable = <T extends readonly any[] | Record<string, unknown>>(val: T) =>

streampark-console/streampark-console-webapp/src/views/flink/app/View.vue

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,9 @@
294294
allow-clear
295295
v-model:value="searchRef.tags"
296296
@change="() => handleResetReload()"
297-
:options="(tagsOptions || []).map((t: Recordable) => ({ label: t, value: t }))"
297+
:options="
298+
(tagsOptions || []).map((t: Recordable) => ({ label: t, value: t }))
299+
"
298300
/>
299301
</Form.Item>
300302
</Col>
@@ -322,11 +324,11 @@
322324
v-model:value="searchRef.userId"
323325
@change="() => handleResetReload()"
324326
:options="
325-
(users || []).map((u: Recordable) => ({
326-
label: u.nickName || u.username,
327-
value: u.userId,
328-
}))
329-
"
327+
(users || []).map((u: Recordable) => ({
328+
label: u.nickName || u.username,
329+
value: u.userId,
330+
}))
331+
"
330332
/>
331333
</Form.Item>
332334
</Col>

0 commit comments

Comments
 (0)