Skip to content

Commit 2baf392

Browse files
committed
system add middleware, update markfile, add data
1 parent d478246 commit 2baf392

File tree

5 files changed

+9
-4
lines changed

5 files changed

+9
-4
lines changed

server/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ clean:
3232
@if [ -f ${GVA} ] ; then rm ${GVA} ; fi
3333

3434
help:
35-
@echo "make - 格式化 Go 代码, 并编译生成二进制文件"
35+
@echo "make - 生成gva终端工具,初始化数据后删除gva终端工具"
3636
@echo "make linux-build - 编译 Go 代码, 生成Linux系统的二进制文件"
3737
@echo "make windows-build - 编译 Go 代码, 生成Windows系统的exe文件"
3838
@echo "make mac-build - 编译 Go 代码, 生成Mac系统的二进制文件"

server/cmd/datas/authority_Ids.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ var DataAuthorityId = []SysDataAuthorityId{
1818
}
1919

2020
func InitSysDataAuthorityId(db *gorm.DB) (err error) {
21-
return db.Transaction(func(tx *gorm.DB) error {
21+
return db.Table("sys_data_authority_id").Transaction(func(tx *gorm.DB) error {
2222
if tx.Create(&DataAuthorityId).Error != nil { // 遇到错误时回滚事务
2323
return err
2424
}

server/cmd/datas/authority_menus.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ var AuthorityMenus = []SysAuthorityMenus{
6666
}
6767

6868
func InitSysAuthorityMenus(db *gorm.DB) (err error) {
69-
return db.Transaction(func(tx *gorm.DB) error {
69+
return db.Table("sys_authority_menus").Transaction(func(tx *gorm.DB) error {
7070
if tx.Create(&AuthorityMenus).Error != nil { // 遇到错误时回滚事务
7171
return err
7272
}

server/cmd/datas/casbins.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ var Carbines = []gormadapter.CasbinRule{
4242
{PType: "p", V0: "888", V1: "/jwt/jsonInBlacklist", V2: "POST"},
4343
{PType: "p", V0: "888", V1: "/system/getSystemConfig", V2: "POST"},
4444
{PType: "p", V0: "888", V1: "/system/setSystemConfig", V2: "POST"},
45+
{PType: "p", V0: "888", V1: "/system/getServerInfo", V2: "POST"},
4546
{PType: "p", V0: "888", V1: "/customer/customer", V2: "POST"},
4647
{PType: "p", V0: "888", V1: "/customer/customer", V2: "PUT"},
4748
{PType: "p", V0: "888", V1: "/customer/customer", V2: "DELETE"},
@@ -69,6 +70,9 @@ var Carbines = []gormadapter.CasbinRule{
6970
{PType: "p", V0: "888", V1: "/sysOperationRecord/deleteSysOperationRecordByIds", V2: "DELETE"},
7071
{PType: "p", V0: "888", V1: "/user/setUserInfo", V2: "PUT"},
7172
{PType: "p", V0: "888", V1: "/email/emailTest", V2: "POST"},
73+
{PType: "p", V0: "888", V1: "/simpleUploader/upload", V2: "POST"},
74+
{PType: "p", V0: "888", V1: "/simpleUploader/checkFileMd5", V2: "GET"},
75+
{PType: "p", V0: "888", V1: "/simpleUploader/mergeFileMd5", V2: "GET"},
7276
{PType: "p", V0: "8881", V1: "/base/login", V2: "POST"},
7377
{PType: "p", V0: "8881", V1: "/base/register", V2: "POST"},
7478
{PType: "p", V0: "8881", V1: "/api/createApi", V2: "POST"},

server/router/sys_system.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ package router
22

33
import (
44
"gin-vue-admin/api/v1"
5+
"gin-vue-admin/middleware"
56
"github.com/gin-gonic/gin"
67
)
78

89
func InitSystemRouter(Router *gin.RouterGroup) {
9-
SystemRouter := Router.Group("system")
10+
SystemRouter := Router.Group("system").Use(middleware.JWTAuth(), middleware.CasbinHandler())
1011
{
1112
SystemRouter.POST("getSystemConfig", v1.GetSystemConfig) // 获取配置文件内容
1213
SystemRouter.POST("setSystemConfig", v1.SetSystemConfig) // 设置配置文件内容

0 commit comments

Comments
 (0)