Skip to content

Commit 0dff268

Browse files
committed
Merge branch 'main' of https://github.com/Sxc92/SynapseUI
* 'main' of https://github.com/Sxc92/SynapseUI: (58 commits) chore: 更新依赖 chore(deps): bump stylelint-config-recommended from 14.0.1 to 17.0.0 (vbenjs#6901) chore: 替换 lodash-es为 es-toolkit 并调整样式引入方式 (vbenjs#6912) chore(@vben/utils): 移除冗余的 lodash 依赖 chore(@vben/utils): 替换 lodash 工具函数为 es-toolkit 实现 refactor(shared): 替换 lodash 工具函数为 es-toolkit 兼容版本 chore: update depends chore(deps): bump echarts from 5.6.0 to 6.0.0 (vbenjs#6859) feat: add form handleCollapsedChange event (vbenjs#6893) fix: for tdesign feat: sport notification link feat: add read and delete for each notification feat: playground add profile feat: tdesign add profile feat: naive add profile feat: ele add profile fix: types feat: route add profile feat: antdv add profile feat: add profile comps ... # Conflicts: # apps/synapse/src/layouts/basic.vue # apps/web-antd/src/locales/langs/en-US/demos.json # apps/web-antd/src/locales/langs/zh-CN/demos.json # apps/web-antd/src/router/routes/modules/vben.ts # apps/web-ele/src/layouts/auth.vue # apps/web-ele/src/layouts/basic.vue # apps/web-ele/src/locales/langs/en-US/demos.json # apps/web-ele/src/locales/langs/en-US/page.json # apps/web-ele/src/locales/langs/zh-CN/demos.json # apps/web-ele/src/locales/langs/zh-CN/page.json # apps/web-ele/src/router/routes/modules/vben.ts # apps/web-naive/src/layouts/auth.vue # apps/web-naive/src/layouts/basic.vue # apps/web-naive/src/locales/langs/en-US/demos.json # apps/web-naive/src/locales/langs/en-US/page.json # apps/web-naive/src/locales/langs/zh-CN/demos.json # apps/web-naive/src/locales/langs/zh-CN/page.json # apps/web-naive/src/router/routes/modules/vben.ts # docs/.vitepress/components/preview-group.vue # docs/package.json # docs/src/components/common-ui/vben-form.md # docs/src/demos/vben-vxe-table/custom-cell/index.vue # docs/src/en/guide/essentials/development.md # docs/src/en/guide/essentials/settings.md # docs/src/en/guide/introduction/thin.md # docs/src/guide/essentials/development.md # docs/src/guide/essentials/settings.md # docs/src/guide/introduction/thin.md # pnpm-lock.yaml # vben-admin.code-workspace
2 parents 060a81a + 605e0ea commit 0dff268

File tree

329 files changed

+9596
-369
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

329 files changed

+9596
-369
lines changed

.github/workflows/deploy.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
run: pnpm build:play
3131

3232
- name: Sync Playground files
33-
uses: SamKirkland/FTP-Deploy-Action@v4.3.5
33+
uses: SamKirkland/FTP-Deploy-Action@v4.3.6
3434
with:
3535
server: ${{ secrets.PRO_FTP_HOST }}
3636
username: ${{ secrets.WEB_PLAYGROUND_FTP_ACCOUNT }}
@@ -54,7 +54,7 @@ jobs:
5454
run: pnpm build:docs
5555

5656
- name: Sync Docs files
57-
uses: SamKirkland/FTP-Deploy-Action@v4.3.5
57+
uses: SamKirkland/FTP-Deploy-Action@v4.3.6
5858
with:
5959
server: ${{ secrets.PRO_FTP_HOST }}
6060
username: ${{ secrets.WEBSITE_FTP_ACCOUNT }}
@@ -85,7 +85,7 @@ jobs:
8585
run: pnpm run build:antd
8686

8787
- name: Sync files
88-
uses: SamKirkland/FTP-Deploy-Action@v4.3.5
88+
uses: SamKirkland/FTP-Deploy-Action@v4.3.6
8989
with:
9090
server: ${{ secrets.PRO_FTP_HOST }}
9191
username: ${{ secrets.WEB_ANTD_FTP_ACCOUNT }}
@@ -116,7 +116,7 @@ jobs:
116116
run: pnpm run build:ele
117117

118118
- name: Sync files
119-
uses: SamKirkland/FTP-Deploy-Action@v4.3.5
119+
uses: SamKirkland/FTP-Deploy-Action@v4.3.6
120120
with:
121121
server: ${{ secrets.PRO_FTP_HOST }}
122122
username: ${{ secrets.WEB_ELE_FTP_ACCOUNT }}
@@ -147,7 +147,7 @@ jobs:
147147
run: pnpm run build:naive
148148

149149
- name: Sync files
150-
uses: SamKirkland/FTP-Deploy-Action@v4.3.5
150+
uses: SamKirkland/FTP-Deploy-Action@v4.3.6
151151
with:
152152
server: ${{ secrets.PRO_FTP_HOST }}
153153
username: ${{ secrets.WEB_NAIVE_FTP_ACCOUNT }}

.npmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
registry = "https://registry.npmmirror.com"
1+
registry=https://registry.npmmirror.com
22
public-hoist-pattern[]=lefthook
33
public-hoist-pattern[]=eslint
44
public-hoist-pattern[]=prettier

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<h1>Vue Vben Admin</h1>
1111
</div>
1212

13-
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=vbenjs_vue-vben-admin&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=vbenjs_vue-vben-admin) ![codeql](https://github.com/vbenjs/vue-vben-admin/actions/workflows/codeql.yml/badge.svg) ![build](https://github.com/vbenjs/vue-vben-admin/actions/workflows/build.yml/badge.svg) ![ci](https://github.com/vbenjs/vue-vben-admin/actions/workflows/ci.yml/badge.svg) ![deploy](https://github.com/vbenjs/vue-vben-admin/actions/workflows/deploy.yml/badge.svg)
13+
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=vbenjs_vue-vben-admin&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=vbenjs_vue-vben-admin) [![codeql](https://github.com/vbenjs/vue-vben-admin/actions/workflows/codeql.yml/badge.svg)](https://github.com/vbenjs/vue-vben-admin/actions/workflows/codeql.yml) [![build](https://github.com/vbenjs/vue-vben-admin/actions/workflows/build.yml/badge.svg)](https://github.com/vbenjs/vue-vben-admin/actions/workflows/build.yml) [![ci](https://github.com/vbenjs/vue-vben-admin/actions/workflows/ci.yml/badge.svg)](https://github.com/vbenjs/vue-vben-admin/actions/workflows/ci.yml) [![deploy](https://github.com/vbenjs/vue-vben-admin/actions/workflows/deploy.yml/badge.svg)](https://github.com/vbenjs/vue-vben-admin/actions/workflows/deploy.yml)
1414

1515
**English** | [中文](./README.zh-CN.md) | [日本語](./README.ja-JP.md)
1616

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { eventHandler } from 'h3';
2+
import { verifyAccessToken } from '~/utils/jwt-utils';
3+
import { unAuthorizedResponse, useResponseSuccess } from '~/utils/response';
4+
import { getTimezone } from '~/utils/timezone-utils';
5+
6+
export default eventHandler((event) => {
7+
const userinfo = verifyAccessToken(event);
8+
if (!userinfo) {
9+
return unAuthorizedResponse(event);
10+
}
11+
return useResponseSuccess(getTimezone());
12+
});
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { eventHandler } from 'h3';
2+
import { TIME_ZONE_OPTIONS } from '~/utils/mock-data';
3+
import { useResponseSuccess } from '~/utils/response';
4+
5+
export default eventHandler(() => {
6+
const data = TIME_ZONE_OPTIONS.map((o) => ({
7+
label: `${o.timezone} (GMT${o.offset >= 0 ? `+${o.offset}` : o.offset})`,
8+
value: o.timezone,
9+
}));
10+
return useResponseSuccess(data);
11+
});
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { eventHandler, readBody } from 'h3';
2+
import { verifyAccessToken } from '~/utils/jwt-utils';
3+
import { TIME_ZONE_OPTIONS } from '~/utils/mock-data';
4+
import { unAuthorizedResponse, useResponseSuccess } from '~/utils/response';
5+
import { setTimezone } from '~/utils/timezone-utils';
6+
7+
export default eventHandler(async (event) => {
8+
const userinfo = verifyAccessToken(event);
9+
if (!userinfo) {
10+
return unAuthorizedResponse(event);
11+
}
12+
const body = await readBody<{ timezone?: unknown }>(event);
13+
const timezone =
14+
typeof body?.timezone === 'string' ? body.timezone : undefined;
15+
const allowed = TIME_ZONE_OPTIONS.some((o) => o.timezone === timezone);
16+
if (!timezone || !allowed) {
17+
setResponseStatus(event, 400);
18+
return useResponseError('Bad Request', 'Invalid timezone');
19+
}
20+
setTimezone(timezone);
21+
return useResponseSuccess({});
22+
});

apps/backend-mock/utils/mock-data.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ export interface UserInfo {
77
homePath?: string;
88
}
99

10+
export interface TimezoneOption {
11+
offset: number;
12+
timezone: string;
13+
}
14+
1015
export const MOCK_USERS: UserInfo[] = [
1116
{
1217
id: 0,
@@ -388,3 +393,29 @@ export function getMenuIds(menus: any[]) {
388393
});
389394
return ids;
390395
}
396+
397+
/**
398+
* 时区选项
399+
*/
400+
export const TIME_ZONE_OPTIONS: TimezoneOption[] = [
401+
{
402+
offset: -5,
403+
timezone: 'America/New_York',
404+
},
405+
{
406+
offset: 0,
407+
timezone: 'Europe/London',
408+
},
409+
{
410+
offset: 8,
411+
timezone: 'Asia/Shanghai',
412+
},
413+
{
414+
offset: 9,
415+
timezone: 'Asia/Tokyo',
416+
},
417+
{
418+
offset: 9,
419+
timezone: 'Asia/Seoul',
420+
},
421+
];
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
let mockTimeZone: null | string = null;
2+
3+
export const setTimezone = (timeZone: string) => {
4+
mockTimeZone = timeZone;
5+
};
6+
7+
export const getTimezone = () => {
8+
return mockTimeZone;
9+
};

apps/synapse/src/layouts/auth.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ import { $t } from '#/locales';
88
99
const appName = computed(() => preferences.app.name);
1010
const logo = computed(() => preferences.logo.source);
11+
const logoDark = computed(() => preferences.logo.sourceDark);
1112
</script>
1213

1314
<template>
1415
<AuthPageLayout
1516
:app-name="appName"
1617
:logo="logo"
18+
:logo-dark="logoDark"
1719
:page-description="$t('authentication.pageDesc')"
1820
:page-title="$t('authentication.pageTitle')"
1921
>

apps/synapse/src/locales/langs/en-US/page.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"register": "Register",
55
"codeLogin": "Code Login",
66
"qrcodeLogin": "Qr Code Login",
7-
"forgetPassword": "Forget Password"
7+
"forgetPassword": "Forget Password",
8+
"profile": "Profile"
89
},
910
"dashboard": {
1011
"title": "Dashboard",

0 commit comments

Comments
 (0)