|
@@ -1329,8 +1329,8 @@ export default {
|
|
}
|
|
}
|
|
console.log(res);
|
|
console.log(res);
|
|
this.loading = false;
|
|
this.loading = false;
|
|
- if (res && res.code === 0) {
|
|
|
|
- const { spuCode } = res.data;
|
|
|
|
|
|
+ const { code, data, message } = res;
|
|
|
|
+ if (code === 0) {
|
|
const title =
|
|
const title =
|
|
this.type === "add"
|
|
this.type === "add"
|
|
? "新建成功!"
|
|
? "新建成功!"
|
|
@@ -1345,7 +1345,11 @@ export default {
|
|
});
|
|
});
|
|
this.showModelThis = false;
|
|
this.showModelThis = false;
|
|
// 刷新
|
|
// 刷新
|
|
- this.$emit("refresh", { spuCode: spuCode });
|
|
|
|
|
|
+ this.$emit("refresh");
|
|
|
|
+ } else if (code >= 100 && code <= 104) {
|
|
|
|
+ await this.logout();
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.warning(message);
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
console.log(valid);
|
|
console.log(valid);
|
|
@@ -1880,10 +1884,11 @@ export default {
|
|
lead_time: lead_time || "",
|
|
lead_time: lead_time || "",
|
|
sample_day: sample_day || "",
|
|
sample_day: sample_day || "",
|
|
good_thumb_img: good_thumb_img || "",
|
|
good_thumb_img: good_thumb_img || "",
|
|
- good_img: good_img ? Object.prototype.toString.call(good_img) ===
|
|
|
|
- "[object Array]"
|
|
|
|
- ? []
|
|
|
|
- :(good_img || "").split(",") : [],
|
|
|
|
|
|
+ good_img: good_img
|
|
|
|
+ ? Object.prototype.toString.call(good_img) === "[object Array]"
|
|
|
|
+ ? []
|
|
|
|
+ : (good_img || "").split(",")
|
|
|
|
+ : [],
|
|
good_info_img: good_info_img
|
|
good_info_img: good_info_img
|
|
? (Object.prototype.toString.call(good_info_img) ===
|
|
? (Object.prototype.toString.call(good_info_img) ===
|
|
"[object Array]"
|
|
"[object Array]"
|
|
@@ -2113,7 +2118,7 @@ export default {
|
|
if (key === "good_thumb_img") {
|
|
if (key === "good_thumb_img") {
|
|
this.ruleForm[key] = url;
|
|
this.ruleForm[key] = url;
|
|
} else {
|
|
} else {
|
|
- if(this.ruleForm[key].length<10){
|
|
|
|
|
|
+ if (this.ruleForm[key].length < 10) {
|
|
this.ruleForm[key].push(url);
|
|
this.ruleForm[key].push(url);
|
|
}
|
|
}
|
|
}
|
|
}
|