mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
feature(main) sendResponse: params, data, notLog -> data, params, notLog
This commit is contained in:
parent
391db5f83f
commit
73fa821b37
3 changed files with 8 additions and 9 deletions
|
|
@ -257,7 +257,7 @@
|
|||
if (error)
|
||||
main.sendError(error, p);
|
||||
else
|
||||
main.sendResponse(p, data, NOT_LOG);
|
||||
main.sendResponse(data, p, NOT_LOG);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -303,13 +303,13 @@
|
|||
* @param Data - данные
|
||||
* @param pName - имя отсылаемого файла
|
||||
*/
|
||||
function sendResponse(params, data, notLog) {
|
||||
function sendResponse(data, params, notLog) {
|
||||
var p, isGzip, head,
|
||||
ret = checkParams(params);
|
||||
|
||||
if (ret) {
|
||||
p = params;
|
||||
data = p.data || data;
|
||||
data = data;
|
||||
isGzip = p.gzip && isGZIP(p.request);
|
||||
|
||||
head = generateHeaders({
|
||||
|
|
@ -377,14 +377,13 @@
|
|||
* send error response
|
||||
*/
|
||||
function sendError(error, params) {
|
||||
var p, ret = checkParams(params);
|
||||
var data, ret = checkParams(params);
|
||||
|
||||
if (ret) {
|
||||
p = params;
|
||||
p.status = FILE_NOT_FOUND;
|
||||
p.data = error.message || '' + error;
|
||||
params.status = FILE_NOT_FOUND;
|
||||
data = error.message || '' + error;
|
||||
|
||||
sendResponse(p);
|
||||
sendResponse(data, params);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@
|
|||
if (error)
|
||||
main.sendError(error, params);
|
||||
else
|
||||
main.sendResponse(params, data, options.notLog);
|
||||
main.sendResponse(data, params, options.notLog);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue