chore: 整理项目结构,清理归档文件,更新部署配置

This commit is contained in:
Simon
2026-07-04 21:01:39 +08:00
parent 8bd4ab0366
commit 64ff1bf7d5
508 changed files with 43575 additions and 14129 deletions
+13 -7
View File
@@ -69,24 +69,24 @@ export const useAgentStore = defineStore('agent', () => {
/**
* 坐席登录
* 调用后端登录 API,获取坐席信息和 token
* admin 角色需要 OTP 二次验
* 支持账号密码+OTP认
* 登录成功后自动跳转到工作台页面
*
* @param inputUserId - 企微用户ID
* @param inputName - 坐席姓名
* @param otpCode - OTP 动态码(可选)
* @param inputUserId - 账号/用户名
* @param password - 密码
* @param otpCode - OTP 动态码(可选,首次登录不需要
* @returns 登录数据(包含 require_otp 标记)
*/
async function login(inputUserId: string, inputName: string, otpCode?: string): Promise<any> {
async function login(inputUserId: string, password: string, otpCode?: string): Promise<any> {
try {
logging.value = true
const data = await apiLogin(inputUserId, inputName, otpCode)
const data = await apiLogin(inputUserId, password, otpCode)
// 检查是否需要 OTP 验证
if ('require_otp' in data && data.require_otp) {
// 返回 data,让 Login.vue 处理 require_otp
logging.value = false
return data
throw new Error('require_otp')
}
// 保存登录信息
@@ -106,6 +106,12 @@ export const useAgentStore = defineStore('agent', () => {
router.push('/workspace')
} catch (error) {
console.error('登录失败:', error)
// 如果是 require_otp 错误,直接抛出让 UI 处理
if (error instanceof Error && error.message === 'require_otp') {
throw error
}
// 使用 mock 数据作为 fallback(开发/演示用)
if (import.meta.env.DEV) {
console.warn('[Mock] 使用模拟登录数据')