Explorar el Código

blog edit page loading when posting image

fengchang hace 1 año
padre
commit
2ab6a8f306
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      hichina-main-front-mobile-first/src/pages/BlogEditPage.vue

+ 3 - 0
hichina-main-front-mobile-first/src/pages/BlogEditPage.vue

@@ -81,12 +81,15 @@ export default {
             formData.append("imageFile", file);
             formData.append("expectedType", "blogImage");
 
+            gp.$showLoading($q);
             api
               .post("/api/v1/image/upload", formData)
               .then((res) => {
                 resolve(res.data.data);
+                gp.$hideLoading($q);
               })
               .catch((err) => {
+                gp.$hideLoading($q);
                 reject("Upload failed");
                 console.error("Error:", err);
               });