Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
FLIPPED-AURORA
gin-vue-admin
提交
a799d414
G
gin-vue-admin
项目概览
FLIPPED-AURORA
/
gin-vue-admin
大约 1 年 前同步成功
通知
342
Star
18155
Fork
5506
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gin-vue-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a799d414
编写于
7月 05, 2020
作者:
G
Granty1
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update method of operation record
上级
521f28c8
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
81 addition
and
86 deletion
+81
-86
server/config.yaml
server/config.yaml
+1
-9
server/config/config.go
server/config/config.go
+0
-5
server/db/qmplus.sql
server/db/qmplus.sql
+2
-22
server/initialize/router.go
server/initialize/router.go
+0
-1
server/middleware/operation.go
server/middleware/operation.go
+44
-40
server/model/sys_operation_record.go
server/model/sys_operation_record.go
+2
-0
server/router/exp_customer.go
server/router/exp_customer.go
+4
-1
server/router/sys_authority.go
server/router/sys_authority.go
+4
-1
server/router/sys_auto_code.go
server/router/sys_auto_code.go
+4
-1
server/router/sys_casbin.go
server/router/sys_casbin.go
+4
-1
server/router/sys_dictionary.go
server/router/sys_dictionary.go
+4
-1
server/router/sys_dictionary_detail.go
server/router/sys_dictionary_detail.go
+4
-1
server/router/sys_operation_record.go
server/router/sys_operation_record.go
+3
-1
server/router/sys_user.go
server/router/sys_user.go
+4
-1
server/service/sys_operation_record.go
server/service/sys_operation_record.go
+1
-1
未找到文件。
server/config.yaml
浏览文件 @
a799d414
...
...
@@ -58,12 +58,4 @@ log:
prefix
:
'
[GIN-VUE-ADMIN]'
log-file
:
true
stdout
:
'
DEBUG'
file
:
'
DEBUG'
# operation record configuration
operation
:
skip-paths
:
-
'
/base/login'
-
'
/base/register'
-
'
/sysOperationRecord/getSysOperationRecordList'
-
'
/sysOperationRecord/deleteSysOperationRecord'
\ No newline at end of file
file
:
'
DEBUG'
\ No newline at end of file
server/config/config.go
浏览文件 @
a799d414
...
...
@@ -10,7 +10,6 @@ type Server struct {
JWT
JWT
`mapstructure:"jwt" json:"jwt" yaml:"jwt"`
Captcha
Captcha
`mapstructure:"captcha" json:"captcha" yaml:"captcha"`
Log
Log
`mapstructure:"log" json:"log" yaml:"log"`
Operation
Operation
`mapstructure:"operation" json:"operation" yaml:"operation"`
}
type
System
struct
{
...
...
@@ -71,7 +70,3 @@ type Sqlite struct {
Config
string
`mapstructure:"config" json:"config" yaml:"config"`
LogMode
bool
`mapstructure:"log-mode" json:"logMode" yaml:"log-mode"`
}
type
Operation
struct
{
SkipPaths
[]
string
`mapstructure:"skip-paths" json:"skipPaths" yaml:"skip-paths"`
}
server/db/qmplus.sql
浏览文件 @
a799d414
...
...
@@ -654,33 +654,13 @@ CREATE TABLE `sys_operation_records` (
`latency`
bigint
(
20
)
NULL
DEFAULT
NULL
,
`agent`
varchar
(
255
)
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_bin
NULL
DEFAULT
NULL
,
`error_message`
varchar
(
255
)
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_bin
NULL
DEFAULT
NULL
,
`body`
varchar
(
255
)
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_bin
NULL
DEFAULT
NULL
COMMENT
'请求Body'
,
`body`
varchar
(
4096
)
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_bin
NULL
DEFAULT
NULL
COMMENT
'请求Body'
,
`resp`
varchar
(
4096
)
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_bin
NULL
DEFAULT
NULL
COMMENT
'响应Body'
,
`user_id`
int
(
11
)
NULL
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
)
USING
BTREE
,
INDEX
`idx_sys_operation_records_deleted_at`
(
`deleted_at`
)
USING
BTREE
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
18
CHARACTER
SET
=
utf8mb4
COLLATE
=
utf8mb4_bin
ROW_FORMAT
=
Compact
;
-- ----------------------------
-- Records of sys_operation_records
-- ----------------------------
INSERT
INTO
`sys_operation_records`
VALUES
(
1
,
'2020-07-02 14:26:18'
,
'2020-07-02 14:26:18'
,
NULL
,
'127.0.0.1'
,
'POST'
,
'/menu/getMenu'
,
200
,
15621200
,
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36'
,
''
,
''
,
0
);
INSERT
INTO
`sys_operation_records`
VALUES
(
2
,
'2020-07-02 14:26:18'
,
'2020-07-02 14:26:18'
,
NULL
,
'127.0.0.1'
,
'POST'
,
'/authority/getAuthorityList'
,
200
,
13668800
,
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36'
,
''
,
'{
\"
page
\"
:1,
\"
pageSize
\"
:999}'
,
0
);
INSERT
INTO
`sys_operation_records`
VALUES
(
3
,
'2020-07-02 14:30:20'
,
'2020-07-02 14:30:20'
,
NULL
,
'127.0.0.1'
,
'POST'
,
'/menu/getMenu'
,
200
,
19526100
,
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36'
,
''
,
''
,
0
);
INSERT
INTO
`sys_operation_records`
VALUES
(
4
,
'2020-07-02 14:31:18'
,
'2020-07-02 14:31:18'
,
NULL
,
'127.0.0.1'
,
'POST'
,
'/menu/getMenu'
,
200
,
21476700
,
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 Edge/18.18363'
,
''
,
''
,
0
);
INSERT
INTO
`sys_operation_records`
VALUES
(
5
,
'2020-07-02 14:31:20'
,
'2020-07-02 14:31:20'
,
NULL
,
'127.0.0.1'
,
'POST'
,
'/menu/getMenu'
,
200
,
15621000
,
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36'
,
''
,
''
,
0
);
INSERT
INTO
`sys_operation_records`
VALUES
(
6
,
'2020-07-02 14:31:23'
,
'2020-07-02 14:31:23'
,
NULL
,
'127.0.0.1'
,
'POST'
,
'/menu/getMenuList'
,
200
,
12692200
,
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36'
,
''
,
'{
\"
page
\"
:1,
\"
pageSize
\"
:999}'
,
0
);
INSERT
INTO
`sys_operation_records`
VALUES
(
7
,
'2020-07-02 14:31:29'
,
'2020-07-02 14:31:29'
,
NULL
,
'127.0.0.1'
,
'POST'
,
'/menu/getBaseMenuById'
,
200
,
15621600
,
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36'
,
''
,
'{
\"
id
\"
:52}'
,
0
);
INSERT
INTO
`sys_operation_records`
VALUES
(
8
,
'2020-07-02 14:31:40'
,
'2020-07-02 14:31:40'
,
NULL
,
'127.0.0.1'
,
'POST'
,
'/menu/getMenuList'
,
200
,
10743400
,
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36'
,
''
,
'{
\"
page
\"
:1,
\"
pageSize
\"
:999}'
,
0
);
INSERT
INTO
`sys_operation_records`
VALUES
(
9
,
'2020-07-02 14:31:43'
,
'2020-07-02 14:31:43'
,
NULL
,
'127.0.0.1'
,
'POST'
,
'/menu/getMenu'
,
200
,
14646100
,
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36'
,
''
,
''
,
0
);
INSERT
INTO
`sys_operation_records`
VALUES
(
10
,
'2020-07-02 14:31:43'
,
'2020-07-02 14:31:43'
,
NULL
,
'127.0.0.1'
,
'POST'
,
'/menu/getMenuList'
,
200
,
14645000
,
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36'
,
''
,
'{
\"
page
\"
:1,
\"
pageSize
\"
:999}'
,
0
);
INSERT
INTO
`sys_operation_records`
VALUES
(
11
,
'2020-07-02 14:33:41'
,
'2020-07-02 14:33:41'
,
NULL
,
'127.0.0.1'
,
'POST'
,
'/menu/getMenu'
,
200
,
19525200
,
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36'
,
''
,
''
,
0
);
INSERT
INTO
`sys_operation_records`
VALUES
(
12
,
'2020-07-02 14:33:41'
,
'2020-07-02 14:33:41'
,
NULL
,
'127.0.0.1'
,
'POST'
,
'/menu/getMenu'
,
200
,
28313500
,
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 Edge/18.18363'
,
''
,
''
,
0
);
INSERT
INTO
`sys_operation_records`
VALUES
(
13
,
'2020-07-02 14:34:40'
,
'2020-07-02 14:34:40'
,
NULL
,
'127.0.0.1'
,
'POST'
,
'/menu/getMenu'
,
200
,
14646300
,
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36'
,
''
,
''
,
0
);
INSERT
INTO
`sys_operation_records`
VALUES
(
14
,
'2020-07-02 14:34:41'
,
'2020-07-02 14:34:41'
,
NULL
,
'127.0.0.1'
,
'GET'
,
'/sysDictionary/getSysDictionaryList?page=1&pageSize=10'
,
200
,
11715200
,
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36'
,
''
,
''
,
0
);
INSERT
INTO
`sys_operation_records`
VALUES
(
15
,
'2020-07-02 14:51:13'
,
'2020-07-02 14:51:13'
,
NULL
,
'127.0.0.1'
,
'POST'
,
'/menu/getMenu'
,
200
,
26360200
,
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36'
,
''
,
''
,
0
);
INSERT
INTO
`sys_operation_records`
VALUES
(
16
,
'2020-07-02 14:51:57'
,
'2020-07-02 14:51:57'
,
NULL
,
'127.0.0.1'
,
'POST'
,
'/menu/getMenu'
,
200
,
18549000
,
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36'
,
''
,
''
,
0
);
INSERT
INTO
`sys_operation_records`
VALUES
(
17
,
'2020-07-02 14:52:31'
,
'2020-07-02 14:52:31'
,
NULL
,
'127.0.0.1'
,
'POST'
,
'/menu/getMenu'
,
200
,
14646500
,
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36'
,
''
,
''
,
0
);
-- ----------------------------
-- Table structure for sys_users
-- ----------------------------
...
...
server/initialize/router.go
浏览文件 @
a799d414
...
...
@@ -16,7 +16,6 @@ func Routers() *gin.Engine {
var
Router
=
gin
.
Default
()
// Router.Use(middleware.LoadTls()) // 打开就能玩https了
global
.
GVA_LOG
.
Debug
(
"use middleware logger"
)
Router
.
Use
(
middleware
.
RecordRequestBody
(),
middleware
.
OperationRecord
())
// 跨域
Router
.
Use
(
middleware
.
Cors
())
global
.
GVA_LOG
.
Debug
(
"use middleware cors"
)
...
...
server/middleware/operation.go
浏览文件 @
a799d414
...
...
@@ -9,56 +9,60 @@ import (
"io/ioutil"
"net/http"
"strconv"
"
strings
"
"
time
"
)
var
body
[]
byte
func
RecordRequestBody
()
gin
.
HandlerFunc
{
func
OperationRecord
()
gin
.
HandlerFunc
{
return
func
(
c
*
gin
.
Context
)
{
var
body
[]
byte
if
c
.
Request
.
Method
!=
http
.
MethodGet
{
var
err
error
body
,
err
=
ioutil
.
ReadAll
(
c
.
Request
.
Body
)
if
err
!=
nil
{
global
.
GVA_LOG
.
Error
(
err
)
global
.
GVA_LOG
.
Error
(
"read body from request error:"
,
err
)
}
else
{
c
.
Request
.
Body
=
ioutil
.
NopCloser
(
bytes
.
NewBuffer
(
body
))
}
c
.
Request
.
Body
=
ioutil
.
NopCloser
(
bytes
.
NewBuffer
(
body
))
}
else
{
body
=
nil
}
userId
,
err
:=
strconv
.
Atoi
(
c
.
Request
.
Header
.
Get
(
"x-user-id"
))
if
err
!=
nil
{
userId
=
0
}
record
:=
model
.
SysOperationRecord
{
Ip
:
c
.
ClientIP
(),
Method
:
c
.
Request
.
Method
,
Path
:
c
.
Request
.
URL
.
Path
,
Agent
:
c
.
Request
.
UserAgent
(),
Body
:
string
(
body
),
UserId
:
userId
,
}
writer
:=
responseBodyWriter
{
ResponseWriter
:
c
.
Writer
,
body
:
&
bytes
.
Buffer
{},
}
c
.
Writer
=
writer
now
:=
time
.
Now
()
c
.
Next
()
latency
:=
time
.
Now
()
.
Sub
(
now
)
record
.
ErrorMessage
=
c
.
Errors
.
ByType
(
gin
.
ErrorTypePrivate
)
.
String
()
record
.
Status
=
c
.
Writer
.
Status
()
record
.
Latency
=
latency
record
.
Resp
=
writer
.
body
.
String
()
if
err
:=
service
.
CreateSysOperationRecord
(
record
);
err
!=
nil
{
global
.
GVA_LOG
.
Error
(
"create operation record error:"
,
err
)
}
}
}
func
OperationRecord
()
gin
.
HandlerFunc
{
return
gin
.
LoggerWithConfig
(
gin
.
LoggerConfig
{
Formatter
:
func
(
param
gin
.
LogFormatterParams
)
string
{
// 防止加载查询参数,再次过滤
for
_
,
v
:=
range
global
.
GVA_CONFIG
.
Operation
.
SkipPaths
{
if
strings
.
Contains
(
param
.
Path
,
v
)
{
return
""
}
}
userId
,
err
:=
strconv
.
Atoi
(
param
.
Request
.
Header
.
Get
(
"x-user-id"
))
if
err
!=
nil
{
userId
=
0
}
err
=
service
.
CreateSysOperationRecord
(
model
.
SysOperationRecord
{
Ip
:
param
.
ClientIP
,
Method
:
param
.
Method
,
Path
:
param
.
Path
,
Status
:
param
.
StatusCode
,
Latency
:
param
.
Latency
,
Agent
:
param
.
Request
.
UserAgent
(),
ErrorMessage
:
param
.
ErrorMessage
,
Body
:
string
(
body
),
UserId
:
userId
,
})
if
err
!=
nil
{
global
.
GVA_LOG
.
Error
(
err
)
}
return
""
},
Output
:
nil
,
SkipPaths
:
global
.
GVA_CONFIG
.
Operation
.
SkipPaths
,
})
type
responseBodyWriter
struct
{
gin
.
ResponseWriter
body
*
bytes
.
Buffer
}
func
(
r
responseBodyWriter
)
Write
(
b
[]
byte
)
(
int
,
error
)
{
r
.
body
.
Write
(
b
)
return
r
.
ResponseWriter
.
Write
(
b
)
}
server/model/sys_operation_record.go
浏览文件 @
a799d414
...
...
@@ -17,5 +17,7 @@ type SysOperationRecord struct {
Agent
string
`json:"agent" form:"agent" gorm:"column:agent;comment:''"`
ErrorMessage
string
`json:"error_message" form:"error_message" gorm:"column:error_message;comment:''"`
Body
string
`json:"body" form:"body" gorm:"column:body;comment:'请求Body'"`
Resp
string
`json:"resp" form:"resp" gorm:"column:resp;comment:'响应Body'"`
UserId
int
`json:"user_id" form:"user_id" gorm:"column:user_id;comment:''"`
User
SysUser
`json:"user"`
}
server/router/exp_customer.go
浏览文件 @
a799d414
...
...
@@ -7,7 +7,10 @@ import (
)
func
InitCustomerRouter
(
Router
*
gin
.
RouterGroup
)
{
ApiRouter
:=
Router
.
Group
(
"customer"
)
.
Use
(
middleware
.
JWTAuth
())
.
Use
(
middleware
.
CasbinHandler
())
ApiRouter
:=
Router
.
Group
(
"customer"
)
.
Use
(
middleware
.
JWTAuth
())
.
Use
(
middleware
.
CasbinHandler
())
.
Use
(
middleware
.
OperationRecord
())
{
ApiRouter
.
POST
(
"customer"
,
v1
.
CreateExaCustomer
)
// 创建客户
ApiRouter
.
PUT
(
"customer"
,
v1
.
UpdateExaCustomer
)
// 更新客户
...
...
server/router/sys_authority.go
浏览文件 @
a799d414
...
...
@@ -7,7 +7,10 @@ import (
)
func
InitAuthorityRouter
(
Router
*
gin
.
RouterGroup
)
{
AuthorityRouter
:=
Router
.
Group
(
"authority"
)
.
Use
(
middleware
.
JWTAuth
())
.
Use
(
middleware
.
CasbinHandler
())
AuthorityRouter
:=
Router
.
Group
(
"authority"
)
.
Use
(
middleware
.
JWTAuth
())
.
Use
(
middleware
.
CasbinHandler
())
.
Use
(
middleware
.
OperationRecord
())
{
AuthorityRouter
.
POST
(
"createAuthority"
,
v1
.
CreateAuthority
)
// 创建角色
AuthorityRouter
.
POST
(
"deleteAuthority"
,
v1
.
DeleteAuthority
)
// 删除角色
...
...
server/router/sys_auto_code.go
浏览文件 @
a799d414
...
...
@@ -7,7 +7,10 @@ import (
)
func
InitAutoCodeRouter
(
Router
*
gin
.
RouterGroup
)
{
AutoCodeRouter
:=
Router
.
Group
(
"autoCode"
)
.
Use
(
middleware
.
JWTAuth
())
.
Use
(
middleware
.
CasbinHandler
())
AutoCodeRouter
:=
Router
.
Group
(
"autoCode"
)
.
Use
(
middleware
.
JWTAuth
())
.
Use
(
middleware
.
CasbinHandler
())
.
Use
(
middleware
.
OperationRecord
())
{
AutoCodeRouter
.
POST
(
"createTemp"
,
v1
.
CreateTemp
)
// 创建自动化代码
}
...
...
server/router/sys_casbin.go
浏览文件 @
a799d414
...
...
@@ -7,7 +7,10 @@ import (
)
func
InitCasbinRouter
(
Router
*
gin
.
RouterGroup
)
{
CasbinRouter
:=
Router
.
Group
(
"casbin"
)
.
Use
(
middleware
.
JWTAuth
())
.
Use
(
middleware
.
CasbinHandler
())
CasbinRouter
:=
Router
.
Group
(
"casbin"
)
.
Use
(
middleware
.
JWTAuth
())
.
Use
(
middleware
.
CasbinHandler
())
.
Use
(
middleware
.
OperationRecord
())
{
CasbinRouter
.
POST
(
"updateCasbin"
,
v1
.
UpdateCasbin
)
CasbinRouter
.
POST
(
"getPolicyPathByAuthorityId"
,
v1
.
GetPolicyPathByAuthorityId
)
...
...
server/router/sys_dictionary.go
浏览文件 @
a799d414
...
...
@@ -7,7 +7,10 @@ import (
)
func
InitSysDictionaryRouter
(
Router
*
gin
.
RouterGroup
)
{
SysDictionaryRouter
:=
Router
.
Group
(
"sysDictionary"
)
.
Use
(
middleware
.
JWTAuth
())
.
Use
(
middleware
.
CasbinHandler
())
SysDictionaryRouter
:=
Router
.
Group
(
"sysDictionary"
)
.
Use
(
middleware
.
JWTAuth
())
.
Use
(
middleware
.
CasbinHandler
())
.
Use
(
middleware
.
OperationRecord
())
{
SysDictionaryRouter
.
POST
(
"createSysDictionary"
,
v1
.
CreateSysDictionary
)
// 新建SysDictionary
SysDictionaryRouter
.
DELETE
(
"deleteSysDictionary"
,
v1
.
DeleteSysDictionary
)
// 删除SysDictionary
...
...
server/router/sys_dictionary_detail.go
浏览文件 @
a799d414
...
...
@@ -7,7 +7,10 @@ import (
)
func
InitSysDictionaryDetailRouter
(
Router
*
gin
.
RouterGroup
)
{
SysDictionaryDetailRouter
:=
Router
.
Group
(
"sysDictionaryDetail"
)
.
Use
(
middleware
.
JWTAuth
())
.
Use
(
middleware
.
CasbinHandler
())
SysDictionaryDetailRouter
:=
Router
.
Group
(
"sysDictionaryDetail"
)
.
Use
(
middleware
.
JWTAuth
())
.
Use
(
middleware
.
CasbinHandler
())
.
Use
(
middleware
.
OperationRecord
())
{
SysDictionaryDetailRouter
.
POST
(
"createSysDictionaryDetail"
,
v1
.
CreateSysDictionaryDetail
)
// 新建SysDictionaryDetail
SysDictionaryDetailRouter
.
DELETE
(
"deleteSysDictionaryDetail"
,
v1
.
DeleteSysDictionaryDetail
)
// 删除SysDictionaryDetail
...
...
server/router/sys_operation_record.go
浏览文件 @
a799d414
...
...
@@ -7,7 +7,9 @@ import (
)
func
InitSysOperationRecordRouter
(
Router
*
gin
.
RouterGroup
)
{
SysOperationRecordRouter
:=
Router
.
Group
(
"sysOperationRecord"
)
.
Use
(
middleware
.
JWTAuth
())
.
Use
(
middleware
.
CasbinHandler
())
SysOperationRecordRouter
:=
Router
.
Group
(
"sysOperationRecord"
)
.
Use
(
middleware
.
JWTAuth
())
.
Use
(
middleware
.
CasbinHandler
())
{
SysOperationRecordRouter
.
POST
(
"createSysOperationRecord"
,
v1
.
CreateSysOperationRecord
)
// 新建SysOperationRecord
SysOperationRecordRouter
.
DELETE
(
"deleteSysOperationRecord"
,
v1
.
DeleteSysOperationRecord
)
// 删除SysOperationRecord
...
...
server/router/sys_user.go
浏览文件 @
a799d414
...
...
@@ -7,7 +7,10 @@ import (
)
func
InitUserRouter
(
Router
*
gin
.
RouterGroup
)
{
UserRouter
:=
Router
.
Group
(
"user"
)
.
Use
(
middleware
.
JWTAuth
())
.
Use
(
middleware
.
CasbinHandler
())
UserRouter
:=
Router
.
Group
(
"user"
)
.
Use
(
middleware
.
JWTAuth
())
.
Use
(
middleware
.
CasbinHandler
())
.
Use
(
middleware
.
OperationRecord
())
{
UserRouter
.
POST
(
"changePassword"
,
v1
.
ChangePassword
)
// 修改密码
UserRouter
.
POST
(
"uploadHeaderImg"
,
v1
.
UploadHeaderImg
)
// 上传头像
...
...
server/service/sys_operation_record.go
浏览文件 @
a799d414
...
...
@@ -74,6 +74,6 @@ func GetSysOperationRecordInfoList(info request.SysOperationRecordSearch) (err e
db
=
db
.
Where
(
"status = ?"
,
info
.
Status
)
}
err
=
db
.
Count
(
&
total
)
.
Error
err
=
db
.
Limit
(
limit
)
.
Offset
(
offset
)
.
Find
(
&
sysOperationRecords
)
.
Error
err
=
db
.
Order
(
"id desc"
)
.
Limit
(
limit
)
.
Offset
(
offset
)
.
Preload
(
"User"
)
.
Find
(
&
sysOperationRecords
)
.
Error
return
err
,
sysOperationRecords
,
total
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录