提交 7fea649d 编写于 作者: Mr.奇淼('s avatar Mr.奇淼(

Merge branch 'gva_gormv2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gva_workflow

......@@ -32,7 +32,7 @@ clean:
@if [ -f ${GVA} ] ; then rm ${GVA} ; fi
help:
@echo "make - 格式化 Go 代码, 并编译生成二进制文件"
@echo "make - 生成gva终端工具,初始化数据后删除gva终端工具"
@echo "make linux-build - 编译 Go 代码, 生成Linux系统的二进制文件"
@echo "make windows-build - 编译 Go 代码, 生成Windows系统的exe文件"
@echo "make mac-build - 编译 Go 代码, 生成Mac系统的二进制文件"
......
......@@ -18,7 +18,7 @@ var DataAuthorityId = []SysDataAuthorityId{
}
func InitSysDataAuthorityId(db *gorm.DB) (err error) {
return db.Transaction(func(tx *gorm.DB) error {
return db.Table("sys_data_authority_id").Transaction(func(tx *gorm.DB) error {
if tx.Create(&DataAuthorityId).Error != nil { // 遇到错误时回滚事务
return err
}
......
......@@ -66,7 +66,7 @@ var AuthorityMenus = []SysAuthorityMenus{
}
func InitSysAuthorityMenus(db *gorm.DB) (err error) {
return db.Transaction(func(tx *gorm.DB) error {
return db.Table("sys_authority_menus").Transaction(func(tx *gorm.DB) error {
if tx.Create(&AuthorityMenus).Error != nil { // 遇到错误时回滚事务
return err
}
......
......@@ -42,6 +42,7 @@ var Carbines = []gormadapter.CasbinRule{
{PType: "p", V0: "888", V1: "/jwt/jsonInBlacklist", V2: "POST"},
{PType: "p", V0: "888", V1: "/system/getSystemConfig", V2: "POST"},
{PType: "p", V0: "888", V1: "/system/setSystemConfig", V2: "POST"},
{PType: "p", V0: "888", V1: "/system/getServerInfo", V2: "POST"},
{PType: "p", V0: "888", V1: "/customer/customer", V2: "POST"},
{PType: "p", V0: "888", V1: "/customer/customer", V2: "PUT"},
{PType: "p", V0: "888", V1: "/customer/customer", V2: "DELETE"},
......@@ -69,6 +70,9 @@ var Carbines = []gormadapter.CasbinRule{
{PType: "p", V0: "888", V1: "/sysOperationRecord/deleteSysOperationRecordByIds", V2: "DELETE"},
{PType: "p", V0: "888", V1: "/user/setUserInfo", V2: "PUT"},
{PType: "p", V0: "888", V1: "/email/emailTest", V2: "POST"},
{PType: "p", V0: "888", V1: "/simpleUploader/upload", V2: "POST"},
{PType: "p", V0: "888", V1: "/simpleUploader/checkFileMd5", V2: "GET"},
{PType: "p", V0: "888", V1: "/simpleUploader/mergeFileMd5", V2: "GET"},
{PType: "p", V0: "8881", V1: "/base/login", V2: "POST"},
{PType: "p", V0: "8881", V1: "/base/register", V2: "POST"},
{PType: "p", V0: "8881", V1: "/api/createApi", V2: "POST"},
......
......@@ -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.JWTAuth(), middleware.CasbinHandler())
{
SystemRouter.POST("getSystemConfig", v1.GetSystemConfig) // 获取配置文件内容
SystemRouter.POST("setSystemConfig", v1.SetSystemConfig) // 设置配置文件内容
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册