-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaccount.api
More file actions
executable file
·45 lines (43 loc) · 946 Bytes
/
account.api
File metadata and controls
executable file
·45 lines (43 loc) · 946 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?
delete input.body;
const service=service_require("server/account/account.new");
const {jsonStringify}=globals.functions;
const want=String(input.want).toLowerCase();
let result="no result";
if(want=="login"){
result=service.login(input);
}
else if(want=="createaccount"){
result=service.createAccount(input);
}
else if(want=="setvar"){
result=service.setVarByInput(input);
}
else if(want=="getvar"){
result=service.getVarByInput(input);
}
else if(want=="createtoken"){
result=service.createTokenByInput(input);
}
else if(want=="logoutdevice"){
result=service.logoutDevice(input);
}
else if(want=="getmyranks"){
result=service.getRanksByInput(input);
}
else if(want=="getranks"){
result=service.getRanks();
}
?><?=
typeof(result)!="object"?
result:
(
input.debug?
"SERVER-Response:\n"+jsonStringify(result):
jsonStringify(result,false)
)
?><?=
input.debug?
"\n\n\n\nCLIENT-Request:\n"+jsonStringify(input):
""
?>