Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
FLIPPED-AURORA
gin-vue-admin
提交
91f4cb28
G
gin-vue-admin
项目概览
FLIPPED-AURORA
/
gin-vue-admin
大约 1 年 前同步成功
通知
343
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,发现更多精彩内容 >>
提交
91f4cb28
编写于
11月 24, 2020
作者:
m0_50812349
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
https://github.com/flipped-aurora/gin-vue-admin
into gva_gormv2_dev
上级
0438ab16
9af429d4
变更
19
隐藏空白更改
内联
并排
Showing
19 changed file
with
45 addition
and
34 deletion
+45
-34
server/config.yaml
server/config.yaml
+1
-1
server/core/server.go
server/core/server.go
+1
-1
server/initialize/router.go
server/initialize/router.go
+1
-1
server/middleware/operation.go
server/middleware/operation.go
+6
-6
server/router/exp_customer.go
server/router/exp_customer.go
+2
-1
server/router/sys_api.go
server/router/sys_api.go
+2
-1
server/router/sys_authority.go
server/router/sys_authority.go
+2
-1
server/router/sys_casbin.go
server/router/sys_casbin.go
+2
-1
server/router/sys_dictionary.go
server/router/sys_dictionary.go
+2
-1
server/router/sys_dictionary_detail.go
server/router/sys_dictionary_detail.go
+2
-1
server/router/sys_email.go
server/router/sys_email.go
+2
-1
server/router/sys_jwt.go
server/router/sys_jwt.go
+2
-1
server/router/sys_menu.go
server/router/sys_menu.go
+2
-1
server/router/sys_operation_record.go
server/router/sys_operation_record.go
+6
-5
server/router/sys_system.go
server/router/sys_system.go
+2
-1
server/router/sys_user.go
server/router/sys_user.go
+2
-1
server/router/sys_workflow.go
server/router/sys_workflow.go
+2
-1
server/service/sys_auto_code.go
server/service/sys_auto_code.go
+5
-7
web/src/main.js
web/src/main.js
+1
-1
未找到文件。
server/config.yaml
浏览文件 @
91f4cb28
...
...
@@ -56,7 +56,7 @@ mysql:
config
:
'
charset=utf8mb4&parseTime=True&loc=Local'
db-name
:
'
qmPlus'
username
:
'
root'
password
:
'
root123
'
password
:
'
Aa@6447985
'
max-idle-conns
:
10
max-open-conns
:
100
log-mode
:
false
...
...
server/core/server.go
浏览文件 @
91f4cb28
...
...
@@ -29,7 +29,7 @@ func RunWindowsServer() {
fmt
.
Printf
(
`
欢迎使用 Gin-Vue-Admin
当前版本:V2.3.
6
当前版本:V2.3.
7
默认自动化文档地址:http://127.0.0.1%s/swagger/index.html
默认前端文件运行地址:http://127.0.0.1:8080
如果项目让您获得了收益,希望您能请团队喝杯可乐:https://www.gin-vue-admin.com/docs/coffee
...
...
server/initialize/router.go
浏览文件 @
91f4cb28
...
...
@@ -29,7 +29,7 @@ func Routers() *gin.Engine {
router
.
InitBaseRouter
(
PublicGroup
)
// 注册基础功能路由 不做鉴权
}
PrivateGroup
:=
Router
.
Group
(
""
)
PrivateGroup
.
Use
(
middleware
.
JWTAuth
())
.
Use
(
middleware
.
CasbinHandler
())
.
Use
(
middleware
.
OperationRecord
())
PrivateGroup
.
Use
(
middleware
.
JWTAuth
())
.
Use
(
middleware
.
CasbinHandler
())
{
router
.
InitApiRouter
(
PrivateGroup
)
// 注册功能api路由
router
.
InitJwtRouter
(
PrivateGroup
)
// jwt相关路由
...
...
server/middleware/operation.go
浏览文件 @
91f4cb28
...
...
@@ -11,7 +11,6 @@ import (
"io/ioutil"
"net/http"
"strconv"
"strings"
"time"
)
...
...
@@ -31,7 +30,7 @@ func OperationRecord() gin.HandlerFunc {
if
claims
,
ok
:=
c
.
Get
(
"claims"
);
ok
{
waitUse
:=
claims
.
(
*
request
.
CustomClaims
)
userId
=
int
(
waitUse
.
ID
)
}
else
{
}
else
{
id
,
err
:=
strconv
.
Atoi
(
c
.
Request
.
Header
.
Get
(
"x-user-id"
))
if
err
!=
nil
{
userId
=
0
...
...
@@ -46,10 +45,11 @@ func OperationRecord() gin.HandlerFunc {
Body
:
string
(
body
),
UserID
:
userId
,
}
values
:=
c
.
Request
.
Header
.
Values
(
"content-type"
)
if
len
(
values
)
>
0
&&
strings
.
Contains
(
values
[
0
],
"boundary"
)
{
record
.
Body
=
"file"
}
// 存在某些未知错误 TODO
//values := c.Request.Header.Values("content-type")
//if len(values) >0 && strings.Contains(values[0], "boundary") {
// record.Body = "file"
//}
writer
:=
responseBodyWriter
{
ResponseWriter
:
c
.
Writer
,
body
:
&
bytes
.
Buffer
{},
...
...
server/router/exp_customer.go
浏览文件 @
91f4cb28
...
...
@@ -2,11 +2,12 @@ package router
import
(
"gin-vue-admin/api/v1"
"gin-vue-admin/middleware"
"github.com/gin-gonic/gin"
)
func
InitCustomerRouter
(
Router
*
gin
.
RouterGroup
)
{
ApiRouter
:=
Router
.
Group
(
"customer"
)
ApiRouter
:=
Router
.
Group
(
"customer"
)
.
Use
(
middleware
.
OperationRecord
())
{
ApiRouter
.
POST
(
"customer"
,
v1
.
CreateExaCustomer
)
// 创建客户
ApiRouter
.
PUT
(
"customer"
,
v1
.
UpdateExaCustomer
)
// 更新客户
...
...
server/router/sys_api.go
浏览文件 @
91f4cb28
...
...
@@ -2,11 +2,12 @@ package router
import
(
"gin-vue-admin/api/v1"
"gin-vue-admin/middleware"
"github.com/gin-gonic/gin"
)
func
InitApiRouter
(
Router
*
gin
.
RouterGroup
)
{
ApiRouter
:=
Router
.
Group
(
"api"
)
ApiRouter
:=
Router
.
Group
(
"api"
)
.
Use
(
middleware
.
OperationRecord
())
{
ApiRouter
.
POST
(
"createApi"
,
v1
.
CreateApi
)
// 创建Api
ApiRouter
.
POST
(
"deleteApi"
,
v1
.
DeleteApi
)
// 删除Api
...
...
server/router/sys_authority.go
浏览文件 @
91f4cb28
...
...
@@ -2,11 +2,12 @@ package router
import
(
"gin-vue-admin/api/v1"
"gin-vue-admin/middleware"
"github.com/gin-gonic/gin"
)
func
InitAuthorityRouter
(
Router
*
gin
.
RouterGroup
)
{
AuthorityRouter
:=
Router
.
Group
(
"authority"
)
AuthorityRouter
:=
Router
.
Group
(
"authority"
)
.
Use
(
middleware
.
OperationRecord
())
{
AuthorityRouter
.
POST
(
"createAuthority"
,
v1
.
CreateAuthority
)
// 创建角色
AuthorityRouter
.
POST
(
"deleteAuthority"
,
v1
.
DeleteAuthority
)
// 删除角色
...
...
server/router/sys_casbin.go
浏览文件 @
91f4cb28
...
...
@@ -2,11 +2,12 @@ package router
import
(
"gin-vue-admin/api/v1"
"gin-vue-admin/middleware"
"github.com/gin-gonic/gin"
)
func
InitCasbinRouter
(
Router
*
gin
.
RouterGroup
)
{
CasbinRouter
:=
Router
.
Group
(
"casbin"
)
CasbinRouter
:=
Router
.
Group
(
"casbin"
)
.
Use
(
middleware
.
OperationRecord
())
{
CasbinRouter
.
POST
(
"updateCasbin"
,
v1
.
UpdateCasbin
)
CasbinRouter
.
POST
(
"getPolicyPathByAuthorityId"
,
v1
.
GetPolicyPathByAuthorityId
)
...
...
server/router/sys_dictionary.go
浏览文件 @
91f4cb28
...
...
@@ -2,11 +2,12 @@ package router
import
(
"gin-vue-admin/api/v1"
"gin-vue-admin/middleware"
"github.com/gin-gonic/gin"
)
func
InitSysDictionaryRouter
(
Router
*
gin
.
RouterGroup
)
{
SysDictionaryRouter
:=
Router
.
Group
(
"sysDictionary"
)
SysDictionaryRouter
:=
Router
.
Group
(
"sysDictionary"
)
.
Use
(
middleware
.
OperationRecord
())
{
SysDictionaryRouter
.
POST
(
"createSysDictionary"
,
v1
.
CreateSysDictionary
)
// 新建SysDictionary
SysDictionaryRouter
.
DELETE
(
"deleteSysDictionary"
,
v1
.
DeleteSysDictionary
)
// 删除SysDictionary
...
...
server/router/sys_dictionary_detail.go
浏览文件 @
91f4cb28
...
...
@@ -2,11 +2,12 @@ package router
import
(
"gin-vue-admin/api/v1"
"gin-vue-admin/middleware"
"github.com/gin-gonic/gin"
)
func
InitSysDictionaryDetailRouter
(
Router
*
gin
.
RouterGroup
)
{
SysDictionaryDetailRouter
:=
Router
.
Group
(
"sysDictionaryDetail"
)
SysDictionaryDetailRouter
:=
Router
.
Group
(
"sysDictionaryDetail"
)
.
Use
(
middleware
.
OperationRecord
())
{
SysDictionaryDetailRouter
.
POST
(
"createSysDictionaryDetail"
,
v1
.
CreateSysDictionaryDetail
)
// 新建SysDictionaryDetail
SysDictionaryDetailRouter
.
DELETE
(
"deleteSysDictionaryDetail"
,
v1
.
DeleteSysDictionaryDetail
)
// 删除SysDictionaryDetail
...
...
server/router/sys_email.go
浏览文件 @
91f4cb28
...
...
@@ -2,11 +2,12 @@ package router
import
(
"gin-vue-admin/api/v1"
"gin-vue-admin/middleware"
"github.com/gin-gonic/gin"
)
func
InitEmailRouter
(
Router
*
gin
.
RouterGroup
)
{
UserRouter
:=
Router
.
Group
(
"email"
)
UserRouter
:=
Router
.
Group
(
"email"
)
.
Use
(
middleware
.
OperationRecord
())
{
UserRouter
.
POST
(
"emailTest"
,
v1
.
EmailTest
)
// 发送测试邮件
}
...
...
server/router/sys_jwt.go
浏览文件 @
91f4cb28
...
...
@@ -2,11 +2,12 @@ package router
import
(
"gin-vue-admin/api/v1"
"gin-vue-admin/middleware"
"github.com/gin-gonic/gin"
)
func
InitJwtRouter
(
Router
*
gin
.
RouterGroup
)
{
ApiRouter
:=
Router
.
Group
(
"jwt"
)
ApiRouter
:=
Router
.
Group
(
"jwt"
)
.
Use
(
middleware
.
OperationRecord
())
{
ApiRouter
.
POST
(
"jsonInBlacklist"
,
v1
.
JsonInBlacklist
)
// jwt加入黑名单
}
...
...
server/router/sys_menu.go
浏览文件 @
91f4cb28
...
...
@@ -2,11 +2,12 @@ package router
import
(
"gin-vue-admin/api/v1"
"gin-vue-admin/middleware"
"github.com/gin-gonic/gin"
)
func
InitMenuRouter
(
Router
*
gin
.
RouterGroup
)
(
R
gin
.
IRoutes
)
{
MenuRouter
:=
Router
.
Group
(
"menu"
)
MenuRouter
:=
Router
.
Group
(
"menu"
)
.
Use
(
middleware
.
OperationRecord
())
{
MenuRouter
.
POST
(
"getMenu"
,
v1
.
GetMenu
)
// 获取菜单树
MenuRouter
.
POST
(
"getMenuList"
,
v1
.
GetMenuList
)
// 分页获取基础menu列表
...
...
server/router/sys_operation_record.go
浏览文件 @
91f4cb28
...
...
@@ -2,17 +2,18 @@ package router
import
(
"gin-vue-admin/api/v1"
"gin-vue-admin/middleware"
"github.com/gin-gonic/gin"
)
func
InitSysOperationRecordRouter
(
Router
*
gin
.
RouterGroup
)
{
SysOperationRecordRouter
:=
Router
.
Group
(
"sysOperationRecord"
)
SysOperationRecordRouter
:=
Router
.
Group
(
"sysOperationRecord"
)
.
Use
(
middleware
.
OperationRecord
())
{
SysOperationRecordRouter
.
POST
(
"createSysOperationRecord"
,
v1
.
CreateSysOperationRecord
)
// 新建SysOperationRecord
SysOperationRecordRouter
.
DELETE
(
"deleteSysOperationRecord"
,
v1
.
DeleteSysOperationRecord
)
// 删除SysOperationRecord
SysOperationRecordRouter
.
POST
(
"createSysOperationRecord"
,
v1
.
CreateSysOperationRecord
)
// 新建SysOperationRecord
SysOperationRecordRouter
.
DELETE
(
"deleteSysOperationRecord"
,
v1
.
DeleteSysOperationRecord
)
// 删除SysOperationRecord
SysOperationRecordRouter
.
DELETE
(
"deleteSysOperationRecordByIds"
,
v1
.
DeleteSysOperationRecordByIds
)
// 批量删除SysOperationRecord
SysOperationRecordRouter
.
GET
(
"findSysOperationRecord"
,
v1
.
FindSysOperationRecord
)
// 根据ID获取SysOperationRecord
SysOperationRecordRouter
.
GET
(
"getSysOperationRecordList"
,
v1
.
GetSysOperationRecordList
)
// 获取SysOperationRecord列表
SysOperationRecordRouter
.
GET
(
"findSysOperationRecord"
,
v1
.
FindSysOperationRecord
)
// 根据ID获取SysOperationRecord
SysOperationRecordRouter
.
GET
(
"getSysOperationRecordList"
,
v1
.
GetSysOperationRecordList
)
// 获取SysOperationRecord列表
}
}
server/router/sys_system.go
浏览文件 @
91f4cb28
...
...
@@ -2,11 +2,12 @@ package router
import
(
"gin-vue-admin/api/v1"
"gin-vue-admin/middleware"
"github.com/gin-gonic/gin"
)
func
InitSystemRouter
(
Router
*
gin
.
RouterGroup
)
{
SystemRouter
:=
Router
.
Group
(
"system"
)
SystemRouter
:=
Router
.
Group
(
"system"
)
.
Use
(
middleware
.
OperationRecord
())
{
SystemRouter
.
POST
(
"getSystemConfig"
,
v1
.
GetSystemConfig
)
// 获取配置文件内容
SystemRouter
.
POST
(
"setSystemConfig"
,
v1
.
SetSystemConfig
)
// 设置配置文件内容
...
...
server/router/sys_user.go
浏览文件 @
91f4cb28
...
...
@@ -2,11 +2,12 @@ package router
import
(
"gin-vue-admin/api/v1"
"gin-vue-admin/middleware"
"github.com/gin-gonic/gin"
)
func
InitUserRouter
(
Router
*
gin
.
RouterGroup
)
{
UserRouter
:=
Router
.
Group
(
"user"
)
UserRouter
:=
Router
.
Group
(
"user"
)
.
Use
(
middleware
.
OperationRecord
())
{
UserRouter
.
POST
(
"register"
,
v1
.
Register
)
UserRouter
.
POST
(
"changePassword"
,
v1
.
ChangePassword
)
// 修改密码
...
...
server/router/sys_workflow.go
浏览文件 @
91f4cb28
...
...
@@ -2,11 +2,12 @@ package router
import
(
"gin-vue-admin/api/v1"
"gin-vue-admin/middleware"
"github.com/gin-gonic/gin"
)
func
InitWorkflowRouter
(
Router
*
gin
.
RouterGroup
)
{
WorkflowRouter
:=
Router
.
Group
(
"workflow"
)
WorkflowRouter
:=
Router
.
Group
(
"workflow"
)
.
Use
(
middleware
.
OperationRecord
())
{
WorkflowRouter
.
POST
(
"createWorkFlow"
,
v1
.
CreateWorkFlow
)
// 创建工作流
}
...
...
server/service/sys_auto_code.go
浏览文件 @
91f4cb28
...
...
@@ -209,7 +209,6 @@ func addAutoMoveFile(data *tplData) {
}
}
//@author: [piexlmax](https://github.com/piexlmax)
//@author: [SliverHorn](https://github.com/SliverHorn)
//@function: CreateApi
...
...
@@ -259,14 +258,13 @@ func AutoCreateApi(a *model.AutoCodeStruct) (err error) {
err
=
global
.
GVA_DB
.
Transaction
(
func
(
tx
*
gorm
.
DB
)
error
{
for
_
,
v
:=
range
apiList
{
var
api
model
.
SysApi
if
err
:=
tx
.
Where
(
"path = ? AND method = ?"
,
v
.
Path
,
v
.
Method
)
.
First
(
&
api
)
.
Error
;
err
!=
nil
{
return
err
}
if
err
:=
tx
.
Create
(
&
v
)
.
Error
;
err
!=
nil
{
// 遇到错误时回滚事务
return
err
if
errors
.
Is
(
tx
.
Where
(
"path = ? AND method = ?"
,
v
.
Path
,
v
.
Method
)
.
First
(
&
api
)
.
Error
,
gorm
.
ErrRecordNotFound
)
{
if
err
:=
tx
.
Create
(
&
v
)
.
Error
;
err
!=
nil
{
// 遇到错误时回滚事务
return
err
}
}
}
return
nil
})
return
err
}
\ No newline at end of file
}
web/src/main.js
浏览文件 @
91f4cb28
...
...
@@ -66,7 +66,7 @@ Vue.prototype.$echarts = echarts;
console
.
log
(
`
欢迎使用 Gin-Vue-Admin
当前版本:V2.3.
6
当前版本:V2.3.
7
默认自动化文档地址:http://127.0.0.1%s/swagger/index.html
默认前端文件运行地址:http://127.0.0.1:8080
如果项目让您获得了收益,希望您能请团队喝杯可乐:https://www.gin-vue-admin.com/docs/coffee
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录