Files
guilixu-admin/.workbuddy/memory/2026-07-18.md
赵忠林 f65b8a945d fix(login): 互换登录页右上角扫码与手机图标
- 调整扫码模式下显示手机图标,账号/手机模式显示二维码图标
- 解决图标显示与目标模式相反的问题
- 优化用户界面切换按钮的视觉表达
2026-07-18 19:43:54 +08:00

50 lines
2.4 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 2026-07-18 工作日志
## 手机号登录改用 loginBySuperAdminSms 接口
### 改动文件
1. `src/api/passport/login/index.ts`
- 新增 `loginBySuperAdminSms()` 方法,调用 `/loginBySuperAdminSms` 接口
- 保留原有 `loginBySms()` 方法(其他页面如 register/dealer 仍在使用)
- 新方法逻辑与 `loginBySms` 一致:成功后 setToken + 存 TenantId/UserId
2. `src/views/passport/login/index.vue`
- import 替换:`loginBySms``loginBySuperAdminSms`
- `onLoginBySms()` 函数中调用替换:`loginBySms(form)``loginBySuperAdminSms(form)`
- 多租户选择逻辑(`listAdminsByPhoneAll`)保持不变
### 注意
- 仅改了管理后台登录页注册页面register/dealer仍用 `loginBySms`
## 账号登录合并邮箱/用户ID登录
### 需求
账号登录输入框同时支持「邮箱」和「用户ID」邮箱 → `https://server.websoft.top/api/loginByEmail`,纯数字 → `https://server.websoft.top/api/loginByUserId`
### 改动文件
1. `src/api/passport/login/model/index.ts`
- `LoginParam` 新增 `email?: string``userId?: string | number`
2. `src/api/passport/login/index.ts`
- 新增 `loginByEmail()` / `loginByUserId()`,逻辑同 `login()`setToken + 存 TenantId/UserId
3. `src/views/passport/login/index.vue`
- 表单字段 `userId``account`(新增 `LoginForm = User & { account?: string }` 类型)
- 输入框 placeholder 改为「邮箱 / 用户ID」form-item name 改为 `account`
- 校验规则 `userId``account`
- `submit()` 用正则判断邮箱(`/^[^\s@]+@[^\s@]+\.[^\s@]+$/`) / 纯数字(`/^\d+$/`)路由到对应接口格式不符提示「请输入正确的邮箱或用户ID」
- 移除未使用的 `login` 导入
### 注意
- 外部接口用绝对 URL`https://server.websoft.top/api/...`),未走 SERVER_API_URL 代理
- `vue-tsc` 全量检查仍有大量历史错误ByteMdEditor、shopActivity 等),本次改动无新增错误
## 登录页右上角切换图标互换
### 需求
`src/views/passport/login/index.vue` 右上角扫码/手机切换按钮,图标原本与「目标模式」相反,需互换。
### 改动
- 第 65-66 行:`v-if="loginType === 'scan'"` 显示 `QrcodeOutlined` → 改为 `MobileOutlined``v-else` 显示 `MobileOutlined` → 改为 `QrcodeOutlined`
- 即:扫码模式下显示手机图标(切回账号/手机),账号/手机模式显示二维码图标(切到扫码)