Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async getUsers() {
const res = await ams.request({
url: `${prefix}getUser`,
method: 'GET'
});
if (
res.data &&
res.data.code === 0
) {
this.data.userImg = res.data.data.userImg;
this.data.userName = res.data.data.userName;
} else {
this.$message.error(`${res.data.msg}(${res.data.code})`);
}
},
// 退出登录函数
// page: 1,
// pageSize: 20
};
if (item) {
params.params[this.field.props['idKey']] = item;
params.params[this.field.props['nameKey']] = item;
params.params[this.field.props['subNameKey']] = item;
}
}
const resource = ams.resources[ams.blocks[this.name].resource];
if (typeof props.withCredentials !== 'undefined') {
params.withCredentials = props.withCredentials;
} else if (typeof resource.api.withCredentials !== 'undefined') {
params.withCredentials = resource.api.withCredentials;
}
const res = await ams.request(params);
const successCode = typeof props.successCode === 'number' ? props.successCode : resource.api.successCode;
// 默认successCode
if (
res.data &&
res.data.code === successCode &&
res.data.data &&
res.data.data.list
) {
return res.data.data.list;
}
return [];
}
}