diff --git a/.env.example b/.env.example index ed8952d..e356fa4 100644 --- a/.env.example +++ b/.env.example @@ -6,12 +6,15 @@ VITE_MODE_NAME=development # 资源 CDN 前缀 -VITE_RES_URL=http://localhost:3000/ +VITE_RES_URL=http://localhost:5173/ # 后端 API 基础地址 -# dev: http://localhost:8080/auth +# ⚠️ 本地必须写前端自己(http://localhost:5173),由 Vite proxy 转发 +# 写 http://localhost:8080/auth 会让浏览器绕过 proxy 直连 8080 +# dev: http://localhost:5173 +# dev (K8s): https://dev.violin-home.cn # prod: https://www.violin-home.cn -VITE_APP_URL=http://localhost:8080/auth +VITE_APP_URL=http://localhost:5173 # 应用元信息 VITE_APP_TITLE=violin-home @@ -35,7 +38,7 @@ VITE_OIDC_ISSUER=https://auth.violin-work.online VITE_OIDC_CLIENT_ID= # 回调 URI(必须与 Authentik 后台配置的完全一致) -# dev: http://localhost:3000/auth/callback +# dev: http://localhost:5173/auth/callback # prod: https://www.violin-home.cn/auth/callback VITE_OIDC_REDIRECT_URI= diff --git a/package-lock.json b/package-lock.json index 1d84a81..6586716 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "copy-to-clipboard": "^3.3.3", "dayjs": "^1.11.13", "echarts": "^5.5.1", - "element-plus": "^2.8.4", + "element-plus": "^2.14.1", "js-cookie": "^3.0.5", "lodash-es": "^4.17.21", "md-editor-v3": "^4.20.1", diff --git a/package.json b/package.json index 825ede9..8276085 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "copy-to-clipboard": "^3.3.3", "dayjs": "^1.11.13", "echarts": "^5.5.1", - "element-plus": "^2.8.4", + "element-plus": "^2.14.1", "js-cookie": "^3.0.5", "lodash-es": "^4.17.21", "md-editor-v3": "^4.20.1", diff --git a/src/api/calendar.ts b/src/api/calendar.ts index 436c67b..8c3fe17 100644 --- a/src/api/calendar.ts +++ b/src/api/calendar.ts @@ -1,26 +1,50 @@ import { service } from '../utils/request' -const headers = { - 'Content-Type': 'application/json;charsetset=UTF-8' -} - -const put_event = (data: Object) => { +/** + * 日历事件 API + * 对应后端 CalendarController: /api/v1/events + */ +const post_event = (data: { + eventDate: string + title: string + eventInfo?: string +}) => { return service({ - url: '/calendar/api/v1/event', - method: 'PUT', - data: data + url: '/calendar/api/v1/events', + method: 'POST', + data }) } const get_event = () => { return service({ - url: '/calendar/api/v1/event', - method: 'GET', - headers: headers + url: '/calendar/api/v1/events', + method: 'GET' + }) +} + +const put_event = (id: number, data: { + eventDate: string + title: string + eventInfo?: string +}) => { + return service({ + url: `/calendar/api/v1/events/${id}`, + method: 'PUT', + data + }) +} + +const delete_event = (id: number) => { + return service({ + url: `/calendar/api/v1/events/${id}`, + method: 'DELETE' }) } export { get_event, + post_event, put_event, -} \ No newline at end of file + delete_event, +} diff --git a/src/components/layout/Layout.vue b/src/components/layout/Layout.vue index 57c2d7c..4c3d62a 100644 --- a/src/components/layout/Layout.vue +++ b/src/components/layout/Layout.vue @@ -12,12 +12,14 @@ - - 管祥玮的个人网站 ©Copyright 2022-2022 - - 辽ICP备2022003637号-2 -
- + + @@ -30,6 +32,7 @@ import MainApp from '../layout/MainApp.vue' import NavBar from "../layout/NavBar.vue" import SideBar from "../layout/SideBar.vue" import { settingsStore } from "@/store/modules/settings" +import { SITE_NAME, COPYRIGHT_TEXT, ICP_NUMBER, ICP_QUERY_URL } from "@/const/site" // -- IMPORT -- const useSettingsStore = settingsStore() @@ -62,8 +65,7 @@ const openGithub = () => { } const openSiteQuery = () => { - let href = 'https://beian.miit.gov.cn/#/Integrated/index' - window.open(href, '_blank') + window.open(ICP_QUERY_URL, '_blank') } /** @@ -81,9 +83,12 @@ iniPage() } .el-main { + /* 让 main 区占满 header 与 footer 之间的剩余空间, + 内容多了 main 内部滚动,footer 永远钉在 layout 底部 */ padding: 16px; - overflow: hidden; - height: 100%; + flex: 1; + min-height: 0; /* flex item 默认 min-height: auto 会阻止收缩 */ + overflow-y: auto; } .el-aside { @@ -93,13 +98,50 @@ iniPage() } .el-footer { + /* flex: 0 0 auto 让 footer 保持自身高度(不撑开、不收缩) */ + flex: 0 0 auto; margin-top: 20px; display: flex; - justify-content: space-around; + justify-content: space-between; + align-items: center; + padding: 12px 24px; + border-top: 1px solid rgba(151, 151, 151, 0.2); + font-size: 16px; + color: #666; +} + +.footer-left { + display: flex; + align-items: center; + gap: 8px; +} + +.footer-right { + display: flex; + align-items: center; +} + +.separator { + color: #ccc; +} + +.icp-link { + cursor: pointer; + user-select: none; +} + +.icp-link:hover { + color: #409eff; +} + +.github-icon { + /* 跟 footer 文字 baseline 对齐 */ + vertical-align: middle; + cursor: pointer; } .main_container { - /* height: 100%; */ + height: 100%; } .homeWrap { diff --git a/src/components/login/login.vue b/src/components/login/login.vue index a47e426..4fb5bb4 100644 --- a/src/components/login/login.vue +++ b/src/components/login/login.vue @@ -18,10 +18,15 @@
@@ -29,6 +34,7 @@