fix(VnUserLink): initialize isWorker to false and simplify error handling
gitea/salix-front/pipeline/pr-master There was a failure building this commit
Details
gitea/salix-front/pipeline/pr-master There was a failure building this commit
Details
This commit is contained in:
parent
8f1533d496
commit
ebfc9daacd
|
@ -9,7 +9,7 @@ const $props = defineProps({
|
||||||
workerId: { type: Number, default: null },
|
workerId: { type: Number, default: null },
|
||||||
defaultName: { type: Boolean, default: false },
|
defaultName: { type: Boolean, default: false },
|
||||||
});
|
});
|
||||||
const isWorker = ref();
|
const isWorker = ref(false);
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
try {
|
try {
|
||||||
|
@ -18,10 +18,7 @@ onMounted(async () => {
|
||||||
} = await axios(`/Workers/${$props.workerId}/exists`);
|
} = await axios(`/Workers/${$props.workerId}/exists`);
|
||||||
isWorker.value = exists;
|
isWorker.value = exists;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.status === 403) {
|
if (error.status === 403) return;
|
||||||
isWorker.value = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue