设置超时时间

This commit is contained in:
liang.chao 2025-04-14 16:24:54 +08:00
parent d0f74a4d5f
commit 22ccfcf2c4
1 changed files with 21 additions and 19 deletions

View File

@ -220,26 +220,28 @@ function setProjectValue(data) {
// 根据id获取用户信息 // 根据id获取用户信息
function getUserById() { function getUserById() {
let loadingMsg = layer.msg("数据加载中,请稍候...", {icon: 16, scrollbar: true, time: 0,}); let loadingMsg = layer.msg("数据加载中,请稍候...", {icon: 16, scrollbar: true, time: 0,});
let url = dataUrl + "/users/getById"; setTimeout(() => {
let params = { let url = dataUrl + "/users/getById";
id: idParam let params = {
} id: idParam
console.log(params)
params = {
encryptedData: encryptCBC(JSON.stringify(params))
}
ajaxRequest(url, "POST", params, true, function () {
}, function (result) {
layer.close(loadingMsg); // 关闭提示层
if (result.code === 200) {
setFormData(result.data);
} else if (result.code === 500) {
layer.alert(result.msg, {icon: 2})
} }
}, function (xhr) { console.log(params)
layer.close(loadingMsg); // 关闭提示层 params = {
error(xhr) encryptedData: encryptCBC(JSON.stringify(params))
}); }
ajaxRequest(url, "POST", params, true, function () {
}, function (result) {
layer.close(loadingMsg); // 关闭提示层
if (result.code === 200) {
setFormData(result.data);
} else if (result.code === 500) {
layer.alert(result.msg, {icon: 2})
}
}, function (xhr) {
layer.close(loadingMsg); // 关闭提示层
error(xhr)
});
}, 100)
} }
// 设置表单内容 // 设置表单内容