diff --git a/frontend/components.d.ts b/frontend/components.d.ts index b9b837b..b532055 100644 --- a/frontend/components.d.ts +++ b/frontend/components.d.ts @@ -66,6 +66,7 @@ declare module 'vue' { EditType: typeof import('./src/components/builtin/EditType.vue')['default'] ElAside: typeof import('element-plus/es')['ElAside'] ElAvatar: typeof import('element-plus/es')['ElAvatar'] + ElB: typeof import('element-plus/es')['ElB'] ElBadge: typeof import('element-plus/es')['ElBadge'] ElButton: typeof import('element-plus/es')['ElButton'] ElCard: typeof import('element-plus/es')['ElCard'] @@ -90,6 +91,7 @@ declare module 'vue' { ElIcon: typeof import('element-plus/es')['ElIcon'] ElImage: typeof import('element-plus/es')['ElImage'] ElInput: typeof import('element-plus/es')['ElInput'] + ElItem: typeof import('element-plus/es')['ElItem'] ElMain: typeof import('element-plus/es')['ElMain'] ElMenu: typeof import('element-plus/es')['ElMenu'] ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] @@ -140,6 +142,7 @@ declare module 'vue' { MessageIcon: typeof import('./src/components/taskbar/MessageIcon.vue')['default'] Mobile: typeof import('./src/components/desktop/mobile/Mobile.vue')['default'] MobileApp: typeof import('./src/components/desktop/mobile/MobileApp.vue')['default'] + MobileTemplate: typeof import('./src/components/window/MobileTemplate.vue')['default'] MusicStore: typeof import('./src/components/builtin/MusicStore.vue')['default'] MusicViewer: typeof import('./src/components/builtin/MusicViewer.vue')['default'] NasClient: typeof import('./src/components/setting/NasClient.vue')['default'] diff --git a/frontend/pnpm-lock.yaml b/frontend/pnpm-lock.yaml index 5236b5e..bea3482 100644 --- a/frontend/pnpm-lock.yaml +++ b/frontend/pnpm-lock.yaml @@ -14,6 +14,9 @@ importers: '@liripeng/vue-audio-player': specifier: ^1.6.2 version: 1.6.2(typescript@5.6.3) + '@onlyoffice/document-editor-vue': + specifier: ^1.4.0 + version: 1.4.0(vue@3.5.12(typescript@5.6.3)) cherry-markdown: specifier: ^0.8.52 version: 0.8.52 @@ -44,6 +47,12 @@ importers: pinia-plugin-persist: specifier: ^1.0.0 version: 1.0.0(pinia@2.2.4(typescript@5.6.3)(vue@3.5.12(typescript@5.6.3)))(vue@3.5.12(typescript@5.6.3)) + swiper: + specifier: ^11.1.15 + version: 11.2.0 + vant: + specifier: ^4.9.15 + version: 4.9.15(vue@3.5.12(typescript@5.6.3)) vue: specifier: ^3.4.31 version: 3.5.12(typescript@5.6.3) @@ -317,6 +326,11 @@ packages: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} engines: {node: '>= 8'} + '@onlyoffice/document-editor-vue@1.4.0': + resolution: {integrity: sha512-Fg5gSc1zF6bmpRapUd7rMpm7kEDF7mQIHQKfcsfJcILdFX9bwIhnkXEucETEA9zdt92nWMS6qiAgVeT61TdCyw==} + peerDependencies: + vue: ^3.0.0 + '@parcel/watcher-android-arm64@2.4.1': resolution: {integrity: sha512-LOi/WTbbh3aTn2RYddrO8pnapixAziFl6SMxHM69r3tvdSm94JtCenaKgk1GRg5FJ5wpMCpHeW+7yqPlvZv7kg==} engines: {node: '>= 10.0.0'} @@ -533,6 +547,14 @@ packages: '@types/web-bluetooth@0.0.16': resolution: {integrity: sha512-oh8q2Zc32S6gd/j50GowEjKLoOVOwHP/bWVjKJInBwQqdOYMdPrf1oVlelTlyfFK3CKxL1uahMDAr+vy8T7yMQ==} + '@vant/popperjs@1.3.0': + resolution: {integrity: sha512-hB+czUG+aHtjhaEmCJDuXOep0YTZjdlRR+4MSmIFnkCQIxJaXLQdSsR90XWvAI2yvKUI7TCGqR8pQg2RtvkMHw==} + + '@vant/use@1.6.0': + resolution: {integrity: sha512-PHHxeAASgiOpSmMjceweIrv2AxDZIkWXyaczksMoWvKV2YAYEhoizRuk/xFnKF+emUIi46TsQ+rvlm/t2BBCfA==} + peerDependencies: + vue: ^3.0.0 + '@vitejs/plugin-vue@5.1.4': resolution: {integrity: sha512-N2XSI2n3sQqp5w7Y/AN/L2XDjBIRGqXko+eDp42sydYSBeJuSm5a1sLf8zakmo8u7tA8NmBgoDLA1HeOESjp9A==} engines: {node: ^18.0.0 || >=20.0.0} @@ -572,6 +594,9 @@ packages: '@vue/shared@3.5.12': resolution: {integrity: sha512-L2RPSAwUFbgZH20etwrXyVyCBu9OxRSi8T/38QsvnkJyvq2LufW2lDCOzm7t/U9C1mkhJGWYfCuFBCmIuNivrg==} + '@vue/shared@3.5.13': + resolution: {integrity: sha512-/hnE/qP5ZoGpol0a5mDi45bOd7t3tjYJBjsgCsivow7D48cJeV5l05RD82lPqi7gRiphZM37rnhW1l6ZoCNNnQ==} + '@vueuse/core@9.13.0': resolution: {integrity: sha512-pujnclbeHWxxPRqXWmdkKV5OX4Wk4YeK7wusHqRwU0Q7EFusHoqNA/aPhB6KCh9hEqJkLAJo7bb0Lh9b+OIVzw==} @@ -1270,6 +1295,10 @@ packages: stylis@4.3.4: resolution: {integrity: sha512-osIBl6BGUmSfDkyH2mB7EFvCJntXDrLhKjHTRj/rK6xLH0yuPrHULDRQzKokSOD4VoorhtKpfcfW1GAntu8now==} + swiper@11.2.0: + resolution: {integrity: sha512-rjjAKgDEs+grR2eQshVDCcE4KNPC7CI294nfcbV9gE8WCsLdvOYXDeZKUYevqAZZp8j5hE7kpT3dAGVKFBWlxQ==} + engines: {node: '>= 4.7.0'} + symbol-tree@3.2.4: resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==} @@ -1366,6 +1395,11 @@ packages: resolution: {integrity: sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==} hasBin: true + vant@4.9.15: + resolution: {integrity: sha512-XyIAnoGu2P/dc5R2NnjIJgKwfOTTVM2FJW/8WpsZA0FUBL6Lu+KHBaAY/x3IduwbowkaCIUUPViUopI2JSjbug==} + peerDependencies: + vue: ^3.0.0 + vite@5.4.9: resolution: {integrity: sha512-20OVpJHh0PAM0oSOELa5GaZNWeDjcAvQjGXy2Uyr+Tp+/D2/Hdz6NLgpJLsarPTA2QJ6v8mX2P1ZfbsSKvdMkg==} engines: {node: ^18.0.0 || >=20.0.0} @@ -1667,6 +1701,10 @@ snapshots: '@nodelib/fs.scandir': 2.1.5 fastq: 1.17.1 + '@onlyoffice/document-editor-vue@1.4.0(vue@3.5.12(typescript@5.6.3))': + dependencies: + vue: 3.5.12(typescript@5.6.3) + '@parcel/watcher-android-arm64@2.4.1': optional: true @@ -1813,6 +1851,12 @@ snapshots: '@types/web-bluetooth@0.0.16': {} + '@vant/popperjs@1.3.0': {} + + '@vant/use@1.6.0(vue@3.5.12(typescript@5.6.3))': + dependencies: + vue: 3.5.12(typescript@5.6.3) + '@vitejs/plugin-vue@5.1.4(vite@5.4.9(@types/node@20.16.13)(sass@1.80.3)(terser@5.36.0))(vue@3.5.12(typescript@5.6.3))': dependencies: vite: 5.4.9(@types/node@20.16.13)(sass@1.80.3)(terser@5.36.0) @@ -1874,6 +1918,8 @@ snapshots: '@vue/shared@3.5.12': {} + '@vue/shared@3.5.13': {} + '@vueuse/core@9.13.0(vue@3.5.12(typescript@5.6.3))': dependencies: '@types/web-bluetooth': 0.0.16 @@ -2696,6 +2742,8 @@ snapshots: stylis@4.3.4: optional: true + swiper@11.2.0: {} + symbol-tree@3.2.4: {} terser@5.36.0: @@ -2811,6 +2859,13 @@ snapshots: uuid@9.0.1: optional: true + vant@4.9.15(vue@3.5.12(typescript@5.6.3)): + dependencies: + '@vant/popperjs': 1.3.0 + '@vant/use': 1.6.0(vue@3.5.12(typescript@5.6.3)) + '@vue/shared': 3.5.13 + vue: 3.5.12(typescript@5.6.3) + vite@5.4.9(@types/node@20.16.13)(sass@1.80.3)(terser@5.36.0): dependencies: esbuild: 0.21.5 diff --git a/frontend/src/assets/login/QQ.png b/frontend/src/assets/login/QQ.png deleted file mode 100644 index 715df9b..0000000 Binary files a/frontend/src/assets/login/QQ.png and /dev/null differ diff --git a/frontend/src/assets/login/dingding.png b/frontend/src/assets/login/dingding.png new file mode 100644 index 0000000..d915019 Binary files /dev/null and b/frontend/src/assets/login/dingding.png differ diff --git a/frontend/src/assets/login/gitee.png b/frontend/src/assets/login/gitee.png index 8d8c122..b218efe 100644 Binary files a/frontend/src/assets/login/gitee.png and b/frontend/src/assets/login/gitee.png differ diff --git a/frontend/src/assets/login/phone.png b/frontend/src/assets/login/phone.png new file mode 100644 index 0000000..f00f2b7 Binary files /dev/null and b/frontend/src/assets/login/phone.png differ diff --git a/frontend/src/assets/login/qywechat.png b/frontend/src/assets/login/qywechat.png new file mode 100644 index 0000000..1a8d327 Binary files /dev/null and b/frontend/src/assets/login/qywechat.png differ diff --git a/frontend/src/assets/login/sina.png b/frontend/src/assets/login/sina.png deleted file mode 100644 index 7653ece..0000000 Binary files a/frontend/src/assets/login/sina.png and /dev/null differ diff --git a/frontend/src/assets/login/wechat.png b/frontend/src/assets/login/wechat.png deleted file mode 100644 index e0c0b23..0000000 Binary files a/frontend/src/assets/login/wechat.png and /dev/null differ diff --git a/frontend/src/components/chat/Chat.vue b/frontend/src/components/chat/Chat.vue index f2a1f2e..2fcfac3 100644 --- a/frontend/src/components/chat/Chat.vue +++ b/frontend/src/components/chat/Chat.vue @@ -1,46 +1,46 @@ @@ -48,13 +48,24 @@ watch( - + - + - + - + @@ -67,7 +78,7 @@ watch( - + @@ -75,35 +86,68 @@ watch( - - + + - + - + - + - + - + {{ option.label }} @@ -111,169 +155,175 @@ watch( - 取消 - 确定 + 取消 + 确定 diff --git a/frontend/src/components/chat/ChatMenu.vue b/frontend/src/components/chat/ChatMenu.vue index d7cb073..122c410 100644 --- a/frontend/src/components/chat/ChatMenu.vue +++ b/frontend/src/components/chat/ChatMenu.vue @@ -8,7 +8,7 @@ const store = useChatStore(); - + diff --git a/frontend/src/components/desktop/LockDesktop.vue b/frontend/src/components/desktop/LockDesktop.vue index d9c10f0..da8c935 100644 --- a/frontend/src/components/desktop/LockDesktop.vue +++ b/frontend/src/components/desktop/LockDesktop.vue @@ -15,134 +15,153 @@ /> - - - - - - - - 登录 + - - 第三方登录 - - - - - - 注册新用户 + + + + + + 登录 - 切换角色 - - - - - - - - - - - - - - - - - - - - - - 注册 + 第三方登录 + + + + + + 注册新用户 + 切换角色 + + + - - 返回登录 + + + + + + + + + + + + + + + + + + 注册 - - + + 返回登录 + + + + + + + + + + 确定 + + + @@ -153,7 +172,7 @@ import { getSystemConfig, setSystemConfig } from "@/system/config"; import router from "@/system/router"; import { RestartApp } from "@/util/goutil"; - import { notifyError } from "@/util/msg"; + import { notifyError, notifySuccess } from "@/util/msg"; import { onMounted, ref, watchEffect } from "vue"; import { useRoute } from "vue-router"; const route = useRoute(); @@ -164,19 +183,52 @@ const lockClassName = ref("screen-show"); const isRegisterMode = ref(false); + onMounted(() => { + getThirdpartyList(); + }); + + const getThirdpartyList = async () => { + const result = await fetch( + config.userInfo.url + "/user/thirdparty/list" + ); + if (result.ok) { + const data = await result.json(); + console.log(data, "data"); + } + }; + + const setPhone = async () => { + console.log("123"); + const res = await fetch(config.userInfo.url + "/user/editdata", { + method: "POST", + body: JSON.stringify({ + phone: userName.value, + }), + headers: { + ClientID: store.tempClientId, + Authorization: store.tempToken, + }, + }); + if (res.ok) { + notifySuccess("手机号设置成功"); + } else { + notifyError("手机号设置失败"); + } + }; + const thirdPartyPlatforms = [ - // { - // name: "wechat", - // icon: new URL("@/assets/login/wechat.png", import.meta.url).href, - // }, - // { - // name: "qq", - // icon: new URL("@/assets/login/qq.png", import.meta.url).href, - // }, - // { - // name: "sina", - // icon: new URL("@/assets/login/sina.png", import.meta.url).href, - // }, + { + name: "qywechat", + icon: new URL("@/assets/login/qywechat.png", import.meta.url).href, + }, + { + name: "dingding", + icon: new URL("@/assets/login/dingding.png", import.meta.url).href, + }, + { + name: "phone", + icon: new URL("@/assets/login/phone.png", import.meta.url).href, + }, { name: "github", icon: new URL("@/assets/login/github.png", import.meta.url).href, @@ -211,55 +263,46 @@ watchEffect(() => { const code = route.query.code; if (code) { - console.log(code, "---"); + console.log("code:", code); onLogin(); } }); - const onLogin = async () => { - //localStorage.removeItem("godoosClientId"); + async function onLogin() { if (loginCallback) { - const platform = store.ThirdPartyPlatform; + const platform = localStorage.getItem("ThirdPartyPlatform"); const code = router.currentRoute.value.query.code as string; + console.log(platform, "platform"); // 使用映射对象,将平台名称映射到相应的参数名称 const platformCodeMap: Record = { - github: "github_code", - gitee: "gitee_code", - wechat: "wechat_code", - qq: "qq_code", + github: "github", + gitee: "gitee", + wechat: "wechat", + qq: "qq", }; // 获取对应的参数名称 const codeParam = platform ? platformCodeMap[platform] : null; - let res; - if (codeParam) { - // 第三方登录统一调用 - const returnedState = router.currentRoute.value.query - .state as string; + // 根据登录类型传递参数 + const login_type = codeParam ? codeParam : "password"; + console.log(login_type, "login_type"); - if (returnedState !== store.State) { - notifyError("登录失败,请重试"); - return; - } + const param = codeParam + ? { code: code } + : { username: userName.value, password: userPassword.value }; - res = await loginCallback(userName.value, userPassword.value, { - [codeParam]: code, - }); - } else { - // 普通登录 - res = await loginCallback(userName.value, userPassword.value); - } + const res = await loginCallback(login_type, param); if (res) { - store.ThirdPartyPlatform = null; + localStorage.removeItem("ThirdPartyPlatform"); loginSuccess(); } else { notifyError("登录失败,请重试"); } } - }; + } const toggleRegister = () => { isRegisterMode.value = !isRegisterMode.value; @@ -365,36 +408,21 @@ }; const onThirdPartyLogin = async (platform: string) => { + localStorage.setItem("ThirdPartyPlatform", platform); let loginFunction: (() => Promise) | undefined; - // 当前选择的第三方登录方式 - store.ThirdPartyPlatform = platform; + switch (platform) { case "github": - // 跳转到 GitHub 授权页面 loginFunction = async function () { return await authWithGithub(); }; break; - case "wechat": - loginFunction = async function () { - return await authWithWechat(); - }; - break; - case "qq": - loginFunction = async function () { - return await authWithQQ(); - }; - break; - case "sina": - loginFunction = async function () { - return await authWithSina(); - }; - break; case "gitee": loginFunction = async function () { return await authWithGitee(); }; break; + // 其他平台的处理 default: notifyError("不支持的第三方登录平台"); return; @@ -414,7 +442,8 @@ store.State = state; // 获取当前页面url当做回调参数 const currentUrl = window.location.href; - const url = config.userInfo.url + "/github/authorize?state=" + state; + const url = + config.userInfo.url + "/user/github/authorize?state=" + state; const res: any = await fetch(url, { method: "POST", body: JSON.stringify({ @@ -461,7 +490,8 @@ store.State = state; // 获取当前页面url当做回调参数 const currentUrl = window.location.href; - const url = config.userInfo.url + "/gitee/authorize?state=" + state; + const url = + config.userInfo.url + "/user/gitee/authorize?state=" + state; const res: any = await fetch(url, { method: "POST", body: JSON.stringify({ @@ -487,6 +517,8 @@ notifyError("获取授权URL失败"); return false; } + // store.page = "phone"; + // return true; }; diff --git a/frontend/src/components/setting/SetSystem.vue b/frontend/src/components/setting/SetSystem.vue index da33df0..bafcc7c 100644 --- a/frontend/src/components/setting/SetSystem.vue +++ b/frontend/src/components/setting/SetSystem.vue @@ -2,53 +2,87 @@ - + {{ item }} - + 存储方式 - + 存储地址 - + 自定义端口 - + 自定义路径 - + 服务器地址 - + 允许跨域 - + 服务器地址 - + 登陆用户名 @@ -56,30 +90,46 @@ 登陆密码 - + - + {{ t("confirm") }} - + 编辑器类型 - + 地址 - +