讲师管理bug

This commit is contained in:
zhangsir
2024-11-26 19:21:13 +08:00
parent 67c904c693
commit 62688a0185
16 changed files with 100 additions and 55 deletions

View File

@@ -360,17 +360,18 @@ export function usePage(_url, params, init = true,listing = false) {
...params
});
watch(() => params.keyword, throttle(fetch, 600));
watch(() => params.name, throttle(fetch, 600));
watch(() => params.page, fetch);
function fetch() {
state.loading = true;
if (!params.keyword) {
if (!params.name) {
state.loading = false;
return;
}
return request(_url, params).then(r => {
state.data = params.pageNo === 1 ? r.data.list : [...state.data, ...r.data.list];
console.log(r,'rrrrrrrrrrrrrrrr')
state.data = params.pageNo === 1 ? r.data : [...state.data, ...r.data];
state.totalPage = r.data.total/10 || 1;
state.total = r.data.total;
state.loading = false;
@@ -497,7 +498,7 @@ export async function request(_url, params) {
}).then(res => {
return JSONBigIntStr.parse(res);
}).then(res => {
if (res.code === 0 || res.code === 200) {
if (res.code === 0 || res.code === 200 || res.status === 200) {
return res;
}
if (res.code === 4 ){