From f83bf197d2d11bf5e9b57284b4925d3ac61bc4d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=8B=E7=93=9C=E4=B8=80=E5=8D=81=E9=9B=AA?= Date: Thu, 14 Nov 2024 22:02:15 +0800 Subject: [PATCH] feat: QQLogin --- napcat.webui/package.json | 1 + napcat.webui/src/App.vue | 22 ++- napcat.webui/src/components/HelloWorld.vue | 41 ----- napcat.webui/src/components/QQLogin.vue | 167 +++++++++++++++++++++ napcat.webui/src/components/WebUiLogin.vue | 19 +-- napcat.webui/src/main.ts | 12 +- 6 files changed, 204 insertions(+), 58 deletions(-) delete mode 100644 napcat.webui/src/components/HelloWorld.vue create mode 100644 napcat.webui/src/components/QQLogin.vue diff --git a/napcat.webui/package.json b/napcat.webui/package.json index b57951d1..fb89a689 100644 --- a/napcat.webui/package.json +++ b/napcat.webui/package.json @@ -9,6 +9,7 @@ "preview": "vite preview" }, "dependencies": { + "qrcode": "^1.5.4", "tdesign-vue-next": "^1.10.3", "vue": "^3.5.12" }, diff --git a/napcat.webui/src/App.vue b/napcat.webui/src/App.vue index 1a6e94b8..3c266b8b 100644 --- a/napcat.webui/src/App.vue +++ b/napcat.webui/src/App.vue @@ -1,9 +1,25 @@ - @@ -22,22 +21,16 @@ import { reactive, ref } from 'vue'; import { MessagePlugin } from 'tdesign-vue-next'; import { LockOnIcon } from 'tdesign-icons-vue-next'; -const formData = reactive({ - password: '', -}); -const errorMessage = ref(''); +const formData = reactive({ + token: '', +}); const onSubmit = async ({ validateResult, firstError }) => { if (validateResult === true) { - errorMessage.value = ''; - try { - // 处理表单提交逻辑 - } catch (error) { - errorMessage.value = '登录失败,请重试'; - } + MessagePlugin.success('登录中...'); } else { - errorMessage.value = firstError; + MessagePlugin.error('登录失败'); } }; diff --git a/napcat.webui/src/main.ts b/napcat.webui/src/main.ts index 91b995ec..484b8eea 100644 --- a/napcat.webui/src/main.ts +++ b/napcat.webui/src/main.ts @@ -1,12 +1,22 @@ import { createApp } from 'vue' import './style.css' import App from './App.vue' -import { Button as TButton, Input as TInput, Form as TForm, FormItem as TFormItem } from 'tdesign-vue-next'; +import { + Button as TButton, + Input as TInput, + Form as TForm, + FormItem as TFormItem, + Select as TSelect, + Option as TOption + +} from 'tdesign-vue-next'; const app = createApp(App); app.use(TButton); app.use(TInput); app.use(TForm); app.use(TFormItem); +app.use(TSelect); +app.use(TOption); app.mount('#app'); \ No newline at end of file