mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
refactor(rest) onGet
This commit is contained in:
parent
d85117cc68
commit
4dc038b277
1 changed files with 8 additions and 7 deletions
|
|
@ -184,12 +184,12 @@
|
|||
* @param pParams {command, method, body, requrest, response}
|
||||
*/
|
||||
function onGET(pParams) {
|
||||
var ret = main.checkParams(pParams);
|
||||
var p, cmd, json, ret = main.checkParams(pParams);
|
||||
if (ret) {
|
||||
var p = pParams,
|
||||
lCmd = p.command;
|
||||
p = pParams,
|
||||
cmd = p.command;
|
||||
|
||||
switch(lCmd) {
|
||||
switch(cmd) {
|
||||
case '':
|
||||
p.data = {
|
||||
info: 'Cloud Commander API v1'
|
||||
|
|
@ -198,10 +198,11 @@
|
|||
break;
|
||||
|
||||
default:
|
||||
p.data = {
|
||||
json = Util.stringifyJSON({
|
||||
error: 'command not found'
|
||||
};
|
||||
send(p);
|
||||
});
|
||||
|
||||
sendError(p, json);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue