修改接口名称和文件目录
This commit is contained in:
parent
d315fa4ad2
commit
6177a66193
|
|
@ -2,8 +2,8 @@
|
|||
### 接口相关控制,接口文件需要使用jwt进行token验证 ###
|
||||
######################################################
|
||||
#用户认证登陆相关
|
||||
location /api/auth {
|
||||
content_by_lua_file '${APP_PATH}/src/api/auth/auth.lua';
|
||||
location /api/user {
|
||||
content_by_lua_file '${APP_PATH}/src/api/system/auth.lua';
|
||||
}
|
||||
|
||||
#账号信息数据接口
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
--解析url路由过滤库
|
||||
local radix = require("resty.radixtree")
|
||||
--数据表业务处理
|
||||
local authService = require("service.auth.auth")
|
||||
local authService = require("service.system.auth")
|
||||
|
||||
--定义相关路由,前端接口url地址
|
||||
local routes = {
|
||||
|
|
@ -15,31 +15,31 @@ local routes = {
|
|||
--------------------------------------------
|
||||
--用户登录路由接口
|
||||
{
|
||||
paths = { "/api/auth/login" },
|
||||
paths = { "/api/user/login" },
|
||||
methods = { "POST" },
|
||||
handler = authService.login,
|
||||
},
|
||||
--用户注册路由接口
|
||||
{
|
||||
paths = { "/api/auth/signup" },
|
||||
paths = { "/api/user/signup" },
|
||||
methods = { "POST" },
|
||||
handler = authService.signup,
|
||||
},
|
||||
--用户退出路由接口
|
||||
{
|
||||
paths = { "/api/auth/logout" },
|
||||
paths = { "/api/user/logout" },
|
||||
methods = { "POST" },
|
||||
handler = authService.logout,
|
||||
},
|
||||
--根据token信息获取用户信息数据
|
||||
{
|
||||
paths = { "/api/auth/user" },
|
||||
paths = { "/api/user/user" },
|
||||
methods = { "GET" },
|
||||
handler = authService.user,
|
||||
},
|
||||
--根据token信息获取用户权限数据
|
||||
{
|
||||
paths = { "/api/auth/permission" },
|
||||
paths = { "/api/user/permission" },
|
||||
methods = { "GET" },
|
||||
handler = authService.permission,
|
||||
},
|
||||
|
|
@ -11,6 +11,7 @@ local systemUser = require("service.system.user")
|
|||
--定义相关路由,前端接口url地址
|
||||
local routes = {
|
||||
--用户相关路由接口
|
||||
--获取所有用户信息数据
|
||||
{
|
||||
paths = { "/api/system/users" },
|
||||
methods = { "GET" },
|
||||
|
|
@ -20,6 +21,7 @@ local routes = {
|
|||
end,
|
||||
handler = systemUser.getSystemUsers,
|
||||
},
|
||||
--根据用户id获取用户详情信息
|
||||
{
|
||||
paths = { "/api/system/users/:id" },
|
||||
methods = { "GET" },
|
||||
|
|
@ -29,6 +31,7 @@ local routes = {
|
|||
end,
|
||||
handler = systemUser.getSystemUser,
|
||||
},
|
||||
--根据增加新的用户信息
|
||||
{
|
||||
paths = { "/api/system/users" },
|
||||
methods = { "POST" },
|
||||
|
|
@ -38,6 +41,7 @@ local routes = {
|
|||
end,
|
||||
handler = systemUser.addSystemUser,
|
||||
},
|
||||
--根据用户id删除用户信息
|
||||
{
|
||||
paths = { "/api/system/users/:id" },
|
||||
methods = { "DELETE" },
|
||||
|
|
@ -47,6 +51,7 @@ local routes = {
|
|||
end,
|
||||
handler = systemUser.deleteSystemUser,
|
||||
},
|
||||
--根据用户id编辑用户信息
|
||||
{
|
||||
paths = { "/api/system/users/:id" },
|
||||
methods = { "PUT" },
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
--- 用于
|
||||
local resp = require("util.response")
|
||||
local authDao = require("dao.auth")
|
||||
local validator = require("validator.auth.auth")
|
||||
local validator = require("validator.system.auth")
|
||||
local cjson = require("cjson.safe")
|
||||
local token = require("util.token")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user