GET请求不传参数
export function getcurveZui() {
return request({
url: '/appneedpowercurve/getcurvedata',
method: 'GET',
});
}
GET请求传参数
export function sitepowercount(startTime, timeUnit) {
return request({
url: '/appSitePowerCount/sitepowercount',
method: 'GET',
data: {
startTime: startTime,
timeUnit: timeUnit,
},
});
}
POST请求
export function addworkorder(endTime, siteId, startTime, taskInfo, tenantId, userId, workOrderType, workerId) {
return request({
url: '/appworkorder/addworkorder',
method: 'POST',
data: {
endTime: endTime,
siteId: siteId,
startTime: startTime,
taskInfo: taskInfo,
tenantId: tenantId,
userId: userId,
workOrderType: workOrderType,
workerId: workerId,
}
});
}
要将以上内容放到一个js文件中,在那个页面调用就引入那个请求