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