diff --git a/frontend/web/index.html b/frontend/web/index.html index b19040a..4c929da 100644 --- a/frontend/web/index.html +++ b/frontend/web/index.html @@ -3,6 +3,7 @@ + Vite App diff --git a/frontend/web/src/App.vue b/frontend/web/src/App.vue index af331b0..59f2b39 100644 --- a/frontend/web/src/App.vue +++ b/frontend/web/src/App.vue @@ -11,7 +11,7 @@ diff --git a/frontend/web/src/components/Layout.vue b/frontend/web/src/components/Layout.vue deleted file mode 100644 index c00ea60..0000000 --- a/frontend/web/src/components/Layout.vue +++ /dev/null @@ -1,262 +0,0 @@ - - - - - \ No newline at end of file diff --git a/frontend/web/src/components/Window.vue b/frontend/web/src/components/Window.vue new file mode 100644 index 0000000..874c1aa --- /dev/null +++ b/frontend/web/src/components/Window.vue @@ -0,0 +1,136 @@ + + + + + diff --git a/frontend/web/src/router/index.js b/frontend/web/src/router/index.js index 29e07eb..7fef57a 100644 --- a/frontend/web/src/router/index.js +++ b/frontend/web/src/router/index.js @@ -1,6 +1,11 @@ import { createRouter, createWebHistory } from 'vue-router' +import MainView from '@/views/Main.vue' -const routes = [{ path: '/auth/login', component: () => import('@/views/auth/Login.vue') }] +const routes = [ + { path: '/auth/login', component: () => import('@/views/auth/Login.vue') }, + { path: '/', component: MainView }, + { path: '/index', component: MainView }, +] const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), diff --git a/frontend/web/src/views/Main.vue b/frontend/web/src/views/Main.vue new file mode 100644 index 0000000..265a33b --- /dev/null +++ b/frontend/web/src/views/Main.vue @@ -0,0 +1,829 @@ + + + + + \ No newline at end of file diff --git a/frontend/web/src/views/auth/Login.vue b/frontend/web/src/views/auth/Login.vue index 7bd501e..f5667df 100644 --- a/frontend/web/src/views/auth/Login.vue +++ b/frontend/web/src/views/auth/Login.vue @@ -1,58 +1,76 @@ @@ -62,325 +80,185 @@ import { ref } from 'vue' const username = ref('') const password = ref('') +const remember = ref(false) const errorMsg = ref('') +const loading = ref(false) + +const usernameFocused = ref(false) +const passwordFocused = ref(false) const handleLogin = () => { - if (!username.value || !password.value) { + errorMsg.value = '' + if (!username.value.trim() || !password.value) { errorMsg.value = '用户名或密码不能为空' return } - - if (username.value === 'admin' && password.value === '123456') { - alert('登录成功!') - errorMsg.value = '' - // TODO: 跳转到IM主界面 - } else { - errorMsg.value = '用户名或密码错误' - } + loading.value = true + // 模拟登录延迟(客户端示例),生产中替换为 API 调用 + setTimeout(() => { + loading.value = false + if (username.value === 'admin' && password.value === '123456') { + errorMsg.value = '' + alert('登录成功!') + // TODO: 跳转到 IM 主界面 + } else { + errorMsg.value = '用户名或密码错误' + } + }, 700) } \ No newline at end of file +