# kefu-front **Repository Path**: liubb8280/kefu-front ## Basic Information - **Project Name**: kefu-front - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-02-23 - **Last Updated**: 2026-02-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 客服前端系统 Vue 3 + Vite 前端,支持登录与退出。 ## 功能 - **登录**:用户名 + 密码(当前为前端模拟,可替换为真实接口) - **退出**:清除登录状态并跳转登录页 - **路由守卫**:未登录访问首页会重定向到登录页,登录后可回到原目标页 ## 开发 ```bash npm install npm run dev ``` 浏览器打开终端提示的地址(一般为 http://localhost:5173)。 ## 构建 ```bash npm run build npm run preview # 预览构建结果 ``` ## 对接真实登录接口 在 `src/views/Login.vue` 的 `handleLogin` 中,将模拟逻辑替换为你的 API 调用,例如: ```js const res = await fetch('/api/login', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ username: username.value, password: password.value }), }) const data = await res.json() if (!res.ok) throw new Error(data.message || '登录失败') auth.login(data.token, data.user) ``` 并确保退出时如需要可调用后端登出接口后再执行 `auth.logout()`。