24 lines
617 B
JavaScript
24 lines
617 B
JavaScript
function get (params) {
|
|
YDUI.dialog.loading.open('正在请求数据...');
|
|
$.ajax({
|
|
url: `http://127.0.0.1:3000${params.url}`,
|
|
type: 'GET',
|
|
data: params.data,
|
|
success: function (res) {
|
|
YDUI.dialog.loading.close();
|
|
if(res.resultcode == "200") {
|
|
params.callback(res.result)
|
|
} else {
|
|
YDUI.dialog.toast(res.reason, 'error', 3000);
|
|
}
|
|
},
|
|
error: function(err) {
|
|
YDUI.dialog.loading.close();
|
|
YDUI.dialog.toast('抱歉,请求失败,请稍后重试', 'error', 3000);
|
|
}
|
|
})
|
|
}
|
|
|
|
function returnId() {
|
|
return location.search.split("=")[1]
|
|
} |