fix: SUPERVISOR 角色打卡查询未设置 teacher_id,添加 debug 日志
- daka store query() SUPERVISOR 与 TEACHER 同等处理 - 添加 console.debug 日志便于 vConsole 排查 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -98,6 +98,7 @@ export default defineComponent({
|
||||
|
||||
const usingUser = useUser();
|
||||
const {store, query, reset} = useDaka();
|
||||
console.debug('[daka] setup, currentRole:', usingUser.store.currentRole);
|
||||
|
||||
const state = reactive({
|
||||
keyword: '',
|
||||
|
||||
+5
-2
@@ -8,6 +8,7 @@ import {
|
||||
Daka,
|
||||
DakaScope,
|
||||
HtyBaseRoles,
|
||||
HtySuperRoles,
|
||||
HtyRoles,
|
||||
Clazz,
|
||||
JihuaQueryParam,
|
||||
@@ -82,7 +83,8 @@ export default function useDaka() {
|
||||
|
||||
async function query(params: JihuaQueryParam): Promise<boolean> {
|
||||
let {current: {hty_id}, currentRole} = usingUser.store;
|
||||
if (currentRole === HtyBaseRoles.TEACHER) {
|
||||
console.debug('[daka query] currentRole:', currentRole, 'hty_id:', hty_id);
|
||||
if (currentRole === HtyBaseRoles.TEACHER || currentRole === HtySuperRoles.SUPERVISOR) {
|
||||
params.teacher_id = hty_id;
|
||||
params.scope = DakaScope.ALL;
|
||||
} else if (currentRole === HtyBaseRoles.STUDENT) {
|
||||
@@ -92,10 +94,11 @@ export default function useDaka() {
|
||||
params.teacher_id = teacherStore.currentTeacherId;
|
||||
}
|
||||
}
|
||||
console.debug('[daka query] params after role setup:', params);
|
||||
store.query_cache = params;
|
||||
load_start()
|
||||
const {r, d, e} = await request({url: '/api/v1/ws/find_dakas_with_sections_by_user_id', params});
|
||||
load_done()
|
||||
console.debug('[daka query] response:', {r, d, e});
|
||||
if (r) {
|
||||
if (params.page === 1) {
|
||||
store.list = [];
|
||||
|
||||
Reference in New Issue
Block a user