This commit is contained in:
qitmac000249 2017-08-10 12:14:40 +08:00
commit c204913521
2 changed files with 43 additions and 34 deletions

View File

@ -52,168 +52,173 @@ const INTERFACE_CONFIG = {
const routerConfig = { const routerConfig = {
"group": [ "group": [
{ {
"action": "list", "action": "list",
"path": "list", "path": "list",
"method": "get" "method": "get"
}, },
{ {
"action": "add", "action": "add",
"path": "add", "path": "add",
"method": "post" "method": "post"
}, },
{ {
"action": "up", "action": "up",
"path": "up", "path": "up",
"method": "post" "method": "post"
}, },
{ {
"action": "del", "action": "del",
"path": "del", "path": "del",
"method": "post" "method": "post"
}, },
{ {
"action": "addMember", "action": "addMember",
"path": "add_member", "path": "add_member",
"method": "post" "method": "post"
}, },
{ {
"action": "delMember", "action": "delMember",
"path": "del_member", "path": "del_member",
"method": "post" "method": "post"
}, },
{ {
"action": "getMemberList", "action": "getMemberList",
"path": "members", "path": "members",
"method": "get" "method": "get"
} }
], ],
"user": [ "user": [
{ {
"action": "login", "action": "login",
"path": "login", "path": "login",
"method": "post" "method": "post"
}, },
{ {
"action": "reg", "action": "reg",
"path": "reg", "path": "reg",
"method": "post" "method": "post"
}, },
{ {
"action": "list", "action": "list",
"path": "list", "path": "list",
"method": "get" "method": "get"
}, },
{ {
"action": "findById", "action": "findById",
"path": "find", "path": "find",
"method": "get" "method": "get"
}, },
{ {
"action": "update", "action": "update",
"path": "update", "path": "update",
"method": "post" "method": "post"
}, },
{ {
"action": "del", "action": "del",
"path": "del", "path": "del",
"method": "post" "method": "post"
}, },
{ {
"action": "getLoginStatus", "action": "getLoginStatus",
"path": "status", "path": "status",
"method": "get" "method": "get"
}, },
{ {
"action": "logout", "action": "logout",
"path": "logout", "path": "logout",
"method": "get" "method": "get"
}, },
{ {
"action": "loginByToken", "action": "loginByToken",
"path": "login_by_token", "path": "login_by_token",
"method": "post" "method": "post"
}, },
{ {
"action": "changePassword", "action": "changePassword",
"path": "change_password", "path": "change_password",
"method": "post" "method": "post"
}, },
{ {
"action": "search", "action": "search",
"path": "search", "path": "search",
"method": "get" "method": "get"
}, },
{ {
"action": "nav", "action": "nav",
"path": "nav", "path": "nav",
"method": "get" "method": "get"
} }
], ],
"project": [ "project": [
{ {
"action": "add", "action": "add",
"path": "add", "path": "add",
"method": "post" "method": "post"
}, },
{ {
"action": "list", "action": "list",
"path": "list", "path": "list",
"method": "get" "method": "get"
}, },
{ {
"action": "get", "action": "get",
"path": "get", "path": "get",
"method": "get" "method": "get"
}, },
{ {
"action": "up", "action": "up",
"path": "up", "path": "up",
"method": "post" "method": "post"
}, },
{ {
"action": "del", "action": "del",
"path": "del", "path": "del",
"method": "post" "method": "post"
}, },
{ {
"action": "addMember", "action": "addMember",
"path": "add_member", "path": "add_member",
"method": "post" "method": "post"
}, },
{ {
"action": "delMember", "action": "delMember",
"path": "del_member", "path": "del_member",
"method": "post" "method": "post"
}, },
{ {
"action": "getMemberList", "action": "getMemberList",
"path": "get_member_list", "path": "get_member_list",
"method": "get" "method": "get"
}, },
{ {
"action": "search", "action": "search",
"path": "search", "path": "search",
"method": "get" "method": "get"
},
{
"action": "download",
"path": "download",
"method": "get"
} }
], ],
"interface": [ "interface": [
{ {
"action": "add", "action": "add",
"path": "add", "path": "add",
"method": "post" "method": "post"
}, },
{ {
"action": "list", "action": "list",
"path": "list", "path": "list",
"method": "get" "method": "get"
}, },
{ {
"action": "get", "action": "get",
"path": "get", "path": "get",
"method": "get" "method": "get"
}, },
{ {
"action": "up", "action": "up",
"path": "up", "path": "up",
"method": "post" "method": "post"
@ -289,7 +294,7 @@ for(let ctrl in routerConfig){
actions.forEach( (item) => { actions.forEach( (item) => {
createAction(ctrl, item.action, item.path, item.method); createAction(ctrl, item.action, item.path, item.method);
} ) } )
} }
/** /**
* *
@ -312,4 +317,4 @@ function createAction(controller, action, path, method) {
}); });
} }
module.exports = router; module.exports = router;

View File

@ -202,6 +202,10 @@ var routerConfig = {
"action": "search", "action": "search",
"path": "search", "path": "search",
"method": "get" "method": "get"
}, {
"action": "download",
"path": "download",
"method": "get"
}], }],
"interface": [{ "interface": [{
"action": "add", "action": "add",