fix fetch

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-07-24 11:39:09 +07:00
parent 1888ce2f8b
commit 6824988322
9 changed files with 111 additions and 61 deletions

View file

@ -5,6 +5,7 @@ import { useQuasar, type QTableProps } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import { useDataStore } from "@/stores/data";
import { useCounterMixin } from "@/stores/mixin";
import type {
@ -17,7 +18,7 @@ const { showLoader, hideLoader, messageError } = mixin;
const router = useRouter();
const $q = useQuasar();
const dataStore = useDataStore();
const profilId = ref<string>("");
const currentPage = ref<number>(1);
const page = ref<number>(1);
@ -123,19 +124,22 @@ function onEdit(id: string) {
// );
async function getProfileId() {
showLoader();
await http
.get(config.API.profilePosition())
.then(async (res) => {
profilId.value = res.data.result.profileId;
await getData();
})
.catch((e) => {
if (dataStore.profileId) {
profilId.value = dataStore.profileId;
} else {
showLoader();
try {
const res = await http.get(config.API.profilePosition());
dataStore.profileId = res.data.result.profileId;
profilId.value = dataStore.profileId;
} catch (e) {
messageError($q, e);
})
.finally(() => {
} finally {
hideLoader();
});
}
}
await getData();
}
function convertType(val: string) {