1.get请求只需拼接在接口后边即可
_that.$http.get('/syncResourceService/getSyncConfig?serviceIndexCode='+this.serviceIndexCode).then(function(res) {
if (res && res.data && res.data.code == 0) {
let data = res.data.data;
_that.supportList = data.supportList;
_that.typeCodes = data.configList;
} else {
_that.$message.error(res.data.msg);
}
}, function() {});
2.post请求及需要对象方式传参
params = {
typeCodes:_that.typeCodes,
serviceIndexCode:_that.serviceIndexCode
};
_that.$http.post('/syncResourceService/updateSyncConfig',params).then(function(res) {
if (res && res.data && res.data.code == 0) {
_that.$message({
message: '自动同步设置修改成功',
type: 'success'
});
_that.dialogVisible = false;
} else {
_that.$message.error(res.data.msg);
}
}, function() {});