|
@@ -117,7 +117,7 @@ export const useMainStore = defineStore("MainStoreId", {
|
|
|
const response = await api.qrAddTime(this.token, code);
|
|
|
return response;
|
|
|
} catch (error) {
|
|
|
- console.log('error',error);
|
|
|
+ console.log('error', error);
|
|
|
return error;
|
|
|
}
|
|
|
},
|
|
@@ -314,21 +314,33 @@ export const useMainStore = defineStore("MainStoreId", {
|
|
|
mainStore.addNotification(loadingNotification);
|
|
|
const response = (
|
|
|
await Promise.all([
|
|
|
- api.uploadPlot(mainStore.token, video_data, file),
|
|
|
+ await api.uploadPlot(mainStore.token, video_data, file),
|
|
|
await new Promise<void>((resolve, _) => setTimeout(() => resolve(), 0)),
|
|
|
])
|
|
|
);
|
|
|
mainStore.removeNotification(loadingNotification);
|
|
|
- mainStore.addNotification({
|
|
|
- content: i18n.global.t("fileReceived"),
|
|
|
- color: "success",
|
|
|
- })
|
|
|
+ if (response[0].data.accepted !== false) {
|
|
|
+ mainStore.addNotification({
|
|
|
+ content: i18n.global.t("fileReceived"),
|
|
|
+ color: "success",
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ mainStore.addNotification({
|
|
|
+ content: i18n.global.t("uploadFailed"),
|
|
|
+ color: "error",
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // mainStore.removeNotification(loadingNotification);
|
|
|
+ // mainStore.addNotification({
|
|
|
+ // content: i18n.global.t("fileReceived"),
|
|
|
+ // color: "success",
|
|
|
+ // })
|
|
|
this.actionGetVideos();
|
|
|
return response[0].data;
|
|
|
} catch (error) {
|
|
|
await mainStore.checkApiError(error);
|
|
|
}
|
|
|
- const ret: VideoUploaded = {accepted:false, error_message:"api error", video_info: null}
|
|
|
+ const ret: VideoUploaded = { accepted: false, error_message: "api error", video_info: null }
|
|
|
return ret
|
|
|
},
|
|
|
async uploadImage(file: File[]) {
|