fix:多次重复请求sys/user/list接口问题修复

This commit is contained in:
wangwenrui
2020-02-06 12:35:29 +08:00
parent fc89f4de66
commit bc50ed0fe7
2 changed files with 13 additions and 9 deletions

View File

@@ -60,7 +60,8 @@
postIdc:{type:Object},
placement:{type:String},
buttonClass:{type:String},
isEdit:{type:Boolean,default:true}
isEdit:{type:Boolean,default:true},
userData:{type:Array}
},
created() {
this.init();
@@ -109,11 +110,14 @@
},
getUserData() {
let temp=this;
temp.$get('sys/user/list').then(response => {
if (response.code === 200) {
temp.principals = response.data.list
}
})
if(!temp.userData||temp.userData.length<1){
temp.$get('sys/user/list').then(response => {
if (response.code === 200) {
temp.principals = response.data.list
console.log("queryUserData")
}
})
}
},
saveOrToEdit:function(){
if (!this.popBox.isEdit) {