changes
This commit is contained in:
@@ -83,7 +83,7 @@ export default {
|
||||
form.append("type", "image");
|
||||
form.append("size", 100);
|
||||
form.append("user", this.$store.state.login.id);
|
||||
let result = await this.$insertapi("upload", form);
|
||||
let result = await this.$insertapi("upload", { data: form });
|
||||
if (result === "error") return;
|
||||
let row = result.rows[0];
|
||||
const file = new File([blod], name, { type: "image/png" });
|
||||
|
||||
@@ -129,7 +129,7 @@ export default {
|
||||
form.append("type", "file");
|
||||
form.append("size", this.selected.size);
|
||||
form.append("user", this.$store.state.login.id);
|
||||
let result = await this.$insertapi("upload", form);
|
||||
let result = await this.$insertapi("upload", { data: form });
|
||||
this.loading = false;
|
||||
if (result === "error") return;
|
||||
this.$emit("modalevent", { name: "image", data: result.rows[0] });
|
||||
|
||||
@@ -70,7 +70,7 @@ export default {
|
||||
return { ref: this.row.id, file: v.id };
|
||||
});
|
||||
let found = this.$findapi(this.api);
|
||||
let rs = await this.$insertapi(this.api, arr, found.params.values);
|
||||
let rs = await this.$insertapi(this.api, { data: arr, values: found.params.values });
|
||||
if (rs !== "error") {
|
||||
this.files = this.files.concat(rs);
|
||||
this.vbind = undefined;
|
||||
|
||||
@@ -54,7 +54,7 @@ export default {
|
||||
return { ref: this.row.id, file: v.id };
|
||||
});
|
||||
let found = this.$findapi(this.api);
|
||||
let rs = await this.$insertapi(this.api, arr, found.params.values);
|
||||
let rs = await this.$insertapi(this.api, { data: arr, values: found.params.values });
|
||||
if (rs === "error") return;
|
||||
this.files = this.files.concat(rs);
|
||||
this.$store.commit("updateState", {
|
||||
|
||||
@@ -80,7 +80,7 @@ export default {
|
||||
return { ref: this.row.id, file: v.id };
|
||||
});
|
||||
let found = this.$findapi(this.api);
|
||||
let rs = await this.$insertapi(this.api, arr, found.params.values);
|
||||
let rs = await this.$insertapi(this.api, { data: arr, values: found.params.values });
|
||||
if (rs === "error") return;
|
||||
this.files = this.files.concat(rs);
|
||||
if (this.pagename) {
|
||||
|
||||
@@ -275,7 +275,7 @@ async function attachFiles(files) {
|
||||
product: isForProduct.value ? product.id : undefined,
|
||||
}));
|
||||
|
||||
const result = await $insertapi(isForProduct.value ? "productfile" : "projectfile", payload);
|
||||
const result = await $insertapi(isForProduct.value ? "productfile" : "projectfile", { data: payload });
|
||||
if (result === "error") {
|
||||
throw new Error("Không thể liên kết tệp");
|
||||
}
|
||||
|
||||
@@ -349,14 +349,14 @@ export default {
|
||||
form.append("type", "image");
|
||||
form.append("size", 100);
|
||||
form.append("user", this.$store.login.id);
|
||||
let result = await this.$insertapi("upload", form);
|
||||
let result = await this.$insertapi("upload", { data: form });
|
||||
if (result === "error") return;
|
||||
this.updateImage(result.rows[0]);
|
||||
this.showUrl = false;
|
||||
},
|
||||
async uploadImage(file) {
|
||||
this.loading = true;
|
||||
let result = await this.$insertapi("upload", file.form);
|
||||
let result = await this.$insertapi("upload", { data: file.form });
|
||||
this.data.splice(0, 0, result.rows[0]);
|
||||
this.loading = false;
|
||||
},
|
||||
|
||||
@@ -56,7 +56,7 @@ if (!found) upload();
|
||||
|
||||
async function doUpload(v, i) {
|
||||
const file = props.files[i];
|
||||
const rs = await $insertapi("upload", file.form, undefined, false);
|
||||
const rs = await $insertapi("upload", { data: file.form, notify: false });
|
||||
v.status = rs === "error" ? "error" : "success";
|
||||
vfiles.value[i] = v;
|
||||
const obj = rs.rows[0];
|
||||
|
||||
Reference in New Issue
Block a user