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