scTable,scUpload 增加自定义successCode
This commit is contained in:
parent
22d98bfee9
commit
3e0e47003a
|
@ -155,7 +155,7 @@
|
||||||
this.emptyText = "数据格式错误";
|
this.emptyText = "数据格式错误";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if(response.code != 200){
|
if(response.code != config.successCode){
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.emptyText = response.msg;
|
this.emptyText = response.msg;
|
||||||
}else{
|
}else{
|
||||||
|
|
|
@ -131,7 +131,7 @@
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
var response = config.parseData(res);
|
var response = config.parseData(res);
|
||||||
if(response.code != 200){
|
if(response.code != config.successCode){
|
||||||
this.$message.warning(response.msg || "上传文件未知错误")
|
this.$message.warning(response.msg || "上传文件未知错误")
|
||||||
}else{
|
}else{
|
||||||
this.img = response.src;
|
this.img = response.src;
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
import tool from '@/utils/tool'
|
import tool from '@/utils/tool'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
successCode: 200, //请求完成代码
|
||||||
pageSize: 20, //表格每一页条数
|
pageSize: 20, //表格每一页条数
|
||||||
parseData: function (res) { //数据分析
|
parseData: function (res) { //数据分析
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -4,6 +4,7 @@ import API from "@/api";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
apiObj: API.common.upload, //上传请求API对象
|
apiObj: API.common.upload, //上传请求API对象
|
||||||
|
successCode: 200, //请求完成代码
|
||||||
maxSize: 10, //最大文件大小 默认10MB
|
maxSize: 10, //最大文件大小 默认10MB
|
||||||
parseData: function (res) {
|
parseData: function (res) {
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in New Issue