登录框拆成「学生登录 / 管理员登录」两个页签。学生页签选完班级选姓名, ks 前缀提交时自动拼,选完姓名焦点直接跳到密码框,回车登录;上次选的班级 记在 localStorage 下次自动填好(姓名不记 —— 同一台机器换个人坐就是别人)。 管理员页签只有用户名+密码,不拼前缀。 「没有我所在的班级」保留在班级列表末尾,往届的班级从后台 class_list 里删掉后 学生仍能从这里写完整用户名登录。为了把「还没选」和「没有我所在的班级」分开, loginForm.class 的初值从空串改成 null —— 原来两者都是空串,一打开就默认落在 「没有我所在的班级」那一档、显示文本框,正好和「方便学生」相反。username 同样 改成 nullable:空串在 n-select 里是「选了一个空值」,占位符不显示。 clearProfile 的 storage.clear() 给 LOGIN_CLASS 开了个口子:机房一台机器对一个班, 下课登出、下节课再来还是同一个班,清掉的话每个人都得重新选一遍。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YQCLjAmz6pPXMNGoZmvAmC
This commit is contained in:
1 parent
ec35400249
commit
047e6dd7d3
4 files changed
+258
-112
No files matched your search
@@ -10,9 +10,11 @@ export const useAuthModalStore = defineStore("authModal", () => {
|
||||
const signupModalOpen = ref(false)
|
||||
|
||||
// ==================== 登录表单状态 ====================
|
||||
// class 为 null 表示还没选,别用空串 —— 空串是「没有我所在的班级」那一项的值。
|
||||
// username 同理用 null:空串在 n-select 里是「选了一个空值」,占位符不显示。
|
||||
const loginForm = reactive({
|
||||
class: "",
|
||||
username: "",
|
||||
class: null as string | null,
|
||||
username: null as string | null,
|
||||
password: "",
|
||||
})
|
||||
|
||||
|
||||
Reference in new issue
Block a user