Browse Source

fix: casbin gorm-adapter has no sqlite3 support

Signed-off-by: closetool <c299999999@qq.com>
main
closetool 4 years ago
parent
commit
0c461a94fe
  1. 4
      server/api/v1/exa_breakpoint_continue.go
  2. 2
      server/api/v1/exa_simple_uploader.go
  3. 5
      server/api/v1/sys_api.go
  4. 1
      server/api/v1/sys_casbin.go
  5. 4
      server/api/v1/sys_menu.go
  6. 2
      server/config/excel.go
  7. 2
      server/config/gorm.go
  8. 2
      server/config/redis.go
  9. 2
      server/core/server_other.go
  10. 2
      server/core/server_win.go
  11. 2
      server/global/global.go
  12. 12
      server/go.mod
  13. 2
      server/initialize/redis.go
  14. 8
      server/model/request/sys_dictionary.go
  15. 8
      server/model/request/sys_dictionary_detail.go
  16. 2
      server/model/sys_authority.go
  17. 12
      server/router/sys_api.go
  18. 2
      server/router/sys_system.go
  19. 44
      server/service/exa_excel_parse.go
  20. 8
      server/service/sys_api.go
  21. 6
      server/service/sys_casbin.go
  22. 7
      server/service/sys_system.go
  23. 5
      server/service/sys_user.go
  24. 2
      server/source/api.go
  25. 297
      server/source/casbin.go
  26. 2
      server/source/file.go
  27. 2
      server/utils/constant.go
  28. 2
      server/utils/directory.go
  29. 2
      server/utils/rotatelogs_unix.go
  30. 2
      server/utils/rotatelogs_windows.go
  31. 9
      server/utils/server.go
  32. 1
      server/utils/upload/local.go
  33. 6
      server/utils/upload/qiniu.go

4
server/api/v1/exa_breakpoint_continue.go

@ -82,7 +82,7 @@ func FindFile(c *gin.Context) {
global.GVA_LOG.Error("查找失败!", zap.Any("err", err))
response.FailWithMessage("查找失败", c)
} else {
response.OkWithDetailed(response.FileResponse{File: file},"查找成功", c)
response.OkWithDetailed(response.FileResponse{File: file}, "查找成功", c)
}
}
@ -122,7 +122,7 @@ func RemoveChunk(c *gin.Context) {
err = service.DeleteFileChunk(fileMd5, fileName, filePath)
if err != nil {
global.GVA_LOG.Error("缓存切片删除失败!", zap.Any("err", err))
response.FailWithDetailed(response.FilePathResponse{FilePath: filePath},"缓存切片删除失败", c)
response.FailWithDetailed(response.FilePathResponse{FilePath: filePath}, "缓存切片删除失败", c)
} else {
response.OkWithDetailed(response.FilePathResponse{FilePath: filePath}, "缓存切片删除成功", c)
}

2
server/api/v1/exa_simple_uploader.go

@ -69,7 +69,7 @@ func CheckFileMd5(c *gin.Context) {
response.OkWithDetailed(gin.H{
"chunks": chunks,
"isDone": isDone,
},"查询成功", c)
}, "查询成功", c)
}
}

5
server/api/v1/sys_api.go

@ -148,7 +148,6 @@ func GetAllApis(c *gin.Context) {
}
}
// @Tags SysApi
// @Summary 删除选中Api
// @Security ApiKeyAuth
@ -164,6 +163,6 @@ func DeleteApisByIds(c *gin.Context) {
global.GVA_LOG.Error("删除失败!", zap.Any("err", err))
response.FailWithMessage("删除失败", c)
} else {
response.OkWithMessage("删除成功",c)
response.OkWithMessage("删除成功", c)
}
}
}

1
server/api/v1/sys_casbin.go

@ -51,4 +51,3 @@ func GetPolicyPathByAuthorityId(c *gin.Context) {
paths := service.GetPolicyPathByAuthorityId(casbin.AuthorityId)
response.OkWithDetailed(response.PolicyPathResponse{Paths: paths}, "获取成功", c)
}

4
server/api/v1/sys_menu.go

@ -214,6 +214,6 @@ func GetMenuList(c *gin.Context) {
Total: total,
Page: pageInfo.Page,
PageSize: pageInfo.PageSize,
},"获取成功", c)
}, "获取成功", c)
}
}
}

2
server/config/excel.go

@ -2,4 +2,4 @@ package config
type Excel struct {
Dir string `mapstructure:"dir" json:"dir" yaml:"dir"`
}
}

2
server/config/gorm.go

@ -14,4 +14,4 @@ type Mysql struct {
func (m *Mysql) Dsn() string {
return m.Username + ":" + m.Password + "@tcp(" + m.Path + ")/" + m.Dbname + "?" + m.Config
}
}

2
server/config/redis.go

@ -4,4 +4,4 @@ type Redis struct {
DB int `mapstructure:"db" json:"db" yaml:"db"`
Addr string `mapstructure:"addr" json:"addr" yaml:"addr"`
Password string `mapstructure:"password" json:"password" yaml:"password"`
}
}

2
server/core/server_other.go

@ -14,4 +14,4 @@ func initServer(address string, router *gin.Engine) server {
s.WriteTimeout = 10 * time.Second
s.MaxHeaderBytes = 1 << 20
return s
}
}

2
server/core/server_win.go

@ -16,4 +16,4 @@ func initServer(address string, router *gin.Engine) server {
WriteTimeout: 10 * time.Second,
MaxHeaderBytes: 1 << 20,
}
}
}

2
server/global/global.go

@ -15,5 +15,5 @@ var (
GVA_CONFIG config.Server
GVA_VP *viper.Viper
//GVA_LOG *oplogging.Logger
GVA_LOG *zap.Logger
GVA_LOG *zap.Logger
)

12
server/go.mod

@ -8,9 +8,8 @@ require (
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751
github.com/aliyun/aliyun-oss-go-sdk v2.1.6+incompatible
github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f // indirect
github.com/casbin/casbin v1.9.1
github.com/casbin/casbin/v2 v2.11.0
github.com/casbin/gorm-adapter/v3 v3.0.2
github.com/casbin/casbin/v2 v2.25.6
github.com/casbin/gorm-adapter/v3 v3.2.5
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239 // indirect
github.com/fsnotify/fsnotify v1.4.9
@ -30,7 +29,6 @@ require (
github.com/lestrrat-go/file-rotatelogs v2.3.0+incompatible
github.com/lestrrat-go/strftime v1.0.3 // indirect
github.com/mailru/easyjson v0.7.1 // indirect
github.com/mitchellh/go-homedir v1.1.0
github.com/mitchellh/mapstructure v1.2.2 // indirect
github.com/mojocn/base64Captcha v1.3.1
github.com/onsi/ginkgo v1.7.0 // indirect
@ -42,8 +40,8 @@ require (
github.com/shirou/gopsutil v3.21.1+incompatible
github.com/spf13/afero v1.2.2 // indirect
github.com/spf13/cast v1.3.1 // indirect
github.com/spf13/cobra v1.1.1
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.7.0
github.com/swaggo/gin-swagger v1.2.0
github.com/swaggo/swag v1.6.7
@ -56,8 +54,6 @@ require (
google.golang.org/protobuf v1.24.0 // indirect
gopkg.in/ini.v1 v1.55.0 // indirect
gopkg.in/yaml.v2 v2.3.0 // indirect
gorm.io/driver/mysql v0.3.0
gorm.io/driver/mysql v1.0.1
gorm.io/gorm v1.20.9
)
replace github.com/casbin/gorm-adapter/v3 => github.com/casbin/gorm-adapter/v3 v3.0.2

2
server/initialize/redis.go

@ -17,7 +17,7 @@ func Redis() {
if err != nil {
global.GVA_LOG.Error("redis connect ping failed, err:", zap.Any("err", err))
} else {
global.GVA_LOG.Info("redis connect ping response:", zap.String("pong",pong))
global.GVA_LOG.Info("redis connect ping response:", zap.String("pong", pong))
global.GVA_REDIS = client
}
}

8
server/model/request/sys_dictionary.go

@ -2,7 +2,7 @@ package request
import "gin-vue-admin/model"
type SysDictionarySearch struct{
model.SysDictionary
PageInfo
}
type SysDictionarySearch struct {
model.SysDictionary
PageInfo
}

8
server/model/request/sys_dictionary_detail.go

@ -2,7 +2,7 @@ package request
import "gin-vue-admin/model"
type SysDictionaryDetailSearch struct{
model.SysDictionaryDetail
PageInfo
}
type SysDictionaryDetailSearch struct {
model.SysDictionaryDetail
PageInfo
}

2
server/model/sys_authority.go

@ -14,5 +14,5 @@ type SysAuthority struct {
DataAuthorityId []SysAuthority `json:"dataAuthorityId" gorm:"many2many:sys_data_authority_id"`
Children []SysAuthority `json:"children" gorm:"-"`
SysBaseMenus []SysBaseMenu `json:"menus" gorm:"many2many:sys_authority_menus;"`
DefaultRouter string `json:"defaultRouter" gorm:"comment:默认菜单;default:dashboard"`
DefaultRouter string `json:"defaultRouter" gorm:"comment:默认菜单;default:dashboard"`
}

12
server/router/sys_api.go

@ -9,12 +9,12 @@ import (
func InitApiRouter(Router *gin.RouterGroup) {
ApiRouter := Router.Group("api").Use(middleware.OperationRecord())
{
ApiRouter.POST("createApi", v1.CreateApi) // 创建Api
ApiRouter.POST("deleteApi", v1.DeleteApi) // 删除Api
ApiRouter.POST("getApiList", v1.GetApiList) // 获取Api列表
ApiRouter.POST("getApiById", v1.GetApiById) // 获取单条Api消息
ApiRouter.POST("updateApi", v1.UpdateApi) // 更新api
ApiRouter.POST("getAllApis", v1.GetAllApis) // 获取所有api
ApiRouter.POST("createApi", v1.CreateApi) // 创建Api
ApiRouter.POST("deleteApi", v1.DeleteApi) // 删除Api
ApiRouter.POST("getApiList", v1.GetApiList) // 获取Api列表
ApiRouter.POST("getApiById", v1.GetApiById) // 获取单条Api消息
ApiRouter.POST("updateApi", v1.UpdateApi) // 更新api
ApiRouter.POST("getAllApis", v1.GetAllApis) // 获取所有api
ApiRouter.DELETE("deleteApisByIds", v1.DeleteApisByIds) // 删除选中api
}
}

2
server/router/sys_system.go

@ -12,6 +12,6 @@ func InitSystemRouter(Router *gin.RouterGroup) {
SystemRouter.POST("getSystemConfig", v1.GetSystemConfig) // 获取配置文件内容
SystemRouter.POST("setSystemConfig", v1.SetSystemConfig) // 设置配置文件内容
SystemRouter.POST("getServerInfo", v1.GetServerInfo) // 获取服务器信息
SystemRouter.POST("reloadSystem", v1.ReloadSystem) // 重启服务
SystemRouter.POST("reloadSystem", v1.ReloadSystem) // 重启服务
}
}

44
server/service/exa_excel_parse.go

@ -11,29 +11,29 @@ import (
func ParseInfoList2Excel(infoList []model.SysBaseMenu, filePath string) error {
excel := excelize.NewFile()
excel.SetSheetRow("Sheet1","A1",&[]string{"ID","路由Name","路由Path","是否隐藏","父节点","排序","文件名称"})
for i, menu := range infoList {
axis := fmt.Sprintf("A%d",i+2)
excel.SetSheetRow("Sheet1",axis,&[]interface{}{
menu.ID,
menu.Name,
menu.Path,
menu.Hidden,
menu.ParentId,
menu.Sort,
menu.Component,
})
}
excel.SetSheetRow("Sheet1", "A1", &[]string{"ID", "路由Name", "路由Path", "是否隐藏", "父节点", "排序", "文件名称"})
for i, menu := range infoList {
axis := fmt.Sprintf("A%d", i+2)
excel.SetSheetRow("Sheet1", axis, &[]interface{}{
menu.ID,
menu.Name,
menu.Path,
menu.Hidden,
menu.ParentId,
menu.Sort,
menu.Component,
})
}
excel.SaveAs(filePath)
return nil
}
func ParseExcel2InfoList() ([]model.SysBaseMenu, error) {
skipHeader := true
fixedHeader := []string{"ID","路由Name","路由Path","是否隐藏","父节点","排序","文件名称"}
file, err := excelize.OpenFile(global.GVA_CONFIG.Excel.Dir+"ExcelImport.xlsx")
fixedHeader := []string{"ID", "路由Name", "路由Path", "是否隐藏", "父节点", "排序", "文件名称"}
file, err := excelize.OpenFile(global.GVA_CONFIG.Excel.Dir + "ExcelImport.xlsx")
if err != nil {
return nil, err
return nil, err
}
menus := make([]model.SysBaseMenu, 0)
rows, err := file.Rows("Sheet1")
@ -63,11 +63,11 @@ func ParseExcel2InfoList() ([]model.SysBaseMenu, error) {
GVA_MODEL: global.GVA_MODEL{
ID: uint(id),
},
Name: row[1],
Path: row[2],
Hidden: hidden,
ParentId: row[4],
Sort: sort,
Name: row[1],
Path: row[2],
Hidden: hidden,
ParentId: row[4],
Sort: sort,
Component: row[6],
}
menus = append(menus, menu)
@ -88,4 +88,4 @@ func compareStrSlice(a, b []string) bool {
}
}
return true
}
}

8
server/service/sys_api.go

@ -5,6 +5,7 @@ import (
"gin-vue-admin/global"
"gin-vue-admin/model"
"gin-vue-admin/model/request"
"gorm.io/gorm"
)
@ -130,8 +131,6 @@ func UpdateApi(api model.SysApi) (err error) {
return err
}
//@author: [piexlmax](https://github.com/piexlmax)
//@function: DeleteApis
//@description: 删除选中API
@ -139,7 +138,6 @@ func UpdateApi(api model.SysApi) (err error) {
//@return: err error
func DeleteApisByIds(ids request.IdsReq) (err error) {
err = global.GVA_DB.Delete(&[]model.SysApi{},"id in ?",ids.Ids).Error
err = global.GVA_DB.Delete(&[]model.SysApi{}, "id in ?", ids.Ids).Error
return err
return
}
}

6
server/service/sys_casbin.go

@ -5,11 +5,12 @@ import (
"gin-vue-admin/global"
"gin-vue-admin/model"
"gin-vue-admin/model/request"
"github.com/casbin/casbin/util"
"strings"
"github.com/casbin/casbin/v2"
"github.com/casbin/casbin/v2/util"
gormadapter "github.com/casbin/gorm-adapter/v3"
_ "github.com/go-sql-driver/mysql"
"strings"
)
//@author: [piexlmax](https://github.com/piexlmax)
@ -58,7 +59,6 @@ func UpdateCasbinApi(oldPath string, newPath string, oldMethod string, newMethod
//@param: authorityId string
//@return: pathMaps []request.CasbinInfo
func GetPolicyPathByAuthorityId(authorityId string) (pathMaps []request.CasbinInfo) {
e := Casbin()
list := e.GetFilteredPolicy(0, authorityId)

7
server/service/sys_system.go

@ -41,19 +41,18 @@ func SetSystemConfig(system model.System) (err error) {
func GetServerInfo() (server *utils.Server, err error) {
var s utils.Server
s.Os = utils.InitOS()
if s.Cpu, err = utils.InitCPU(); err != nil{
if s.Cpu, err = utils.InitCPU(); err != nil {
global.GVA_LOG.Error("func utils.InitCPU() Failed!", zap.String("err", err.Error()))
return &s, err
}
if s.Rrm, err = utils.InitRAM(); err != nil{
if s.Rrm, err = utils.InitRAM(); err != nil {
global.GVA_LOG.Error("func utils.InitRAM() Failed!", zap.String("err", err.Error()))
return &s, err
}
if s.Disk, err = utils.InitDisk(); err != nil{
if s.Disk, err = utils.InitDisk(); err != nil {
global.GVA_LOG.Error("func utils.InitDisk() Failed!", zap.String("err", err.Error()))
return &s, err
}
return &s, nil
}

5
server/service/sys_user.go

@ -10,7 +10,6 @@ import (
"gorm.io/gorm"
)
//@author: [piexlmax](https://github.com/piexlmax)
//@function: Register
//@description: 用户注册
@ -125,8 +124,8 @@ func FindUserById(id int) (err error, user *model.SysUser) {
func FindUserByUuid(uuid string) (err error, user *model.SysUser) {
var u model.SysUser
if err = global.GVA_DB.Where("`uuid` = ?", uuid).First(&u).Error; err != nil{
if err = global.GVA_DB.Where("`uuid` = ?", uuid).First(&u).Error; err != nil {
return errors.New("用户不存在"), &u
}
return nil, &u
}
}

2
server/source/api.go

@ -88,8 +88,6 @@ var apis = []model.SysApi{
{global.GVA_MODEL{ID: 85, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/api/deleteApisByIds", "批量删除api", "api", "DELETE"},
}
//@author: [SliverHorn](https://github.com/SliverHorn)
//@description: sys_apis 表数据初始化
func (a *api) Init() error {

297
server/source/casbin.go

@ -2,6 +2,7 @@ package source
import (
"gin-vue-admin/global"
gormadapter "github.com/casbin/gorm-adapter/v3"
"github.com/gookit/color"
"gorm.io/gorm"
@ -12,154 +13,154 @@ var Casbin = new(casbin)
type casbin struct{}
var carbines = []gormadapter.CasbinRule{
{PType: "p", V0: "888", V1: "/base/login", V2: "POST"},
{PType: "p", V0: "888", V1: "/user/register", V2: "POST"},
{PType: "p", V0: "888", V1: "/api/createApi", V2: "POST"},
{PType: "p", V0: "888", V1: "/api/getApiList", V2: "POST"},
{PType: "p", V0: "888", V1: "/api/getApiById", V2: "POST"},
{PType: "p", V0: "888", V1: "/api/deleteApi", V2: "POST"},
{PType: "p", V0: "888", V1: "/api/updateApi", V2: "POST"},
{PType: "p", V0: "888", V1: "/api/getAllApis", V2: "POST"},
{PType: "p", V0: "888", V1: "/authority/createAuthority", V2: "POST"},
{PType: "p", V0: "888", V1: "/authority/deleteAuthority", V2: "POST"},
{PType: "p", V0: "888", V1: "/authority/getAuthorityList", V2: "POST"},
{PType: "p", V0: "888", V1: "/authority/setDataAuthority", V2: "POST"},
{PType: "p", V0: "888", V1: "/authority/updateAuthority", V2: "PUT"},
{PType: "p", V0: "888", V1: "/authority/copyAuthority", V2: "POST"},
{PType: "p", V0: "888", V1: "/menu/getMenu", V2: "POST"},
{PType: "p", V0: "888", V1: "/menu/getMenuList", V2: "POST"},
{PType: "p", V0: "888", V1: "/menu/addBaseMenu", V2: "POST"},
{PType: "p", V0: "888", V1: "/menu/getBaseMenuTree", V2: "POST"},
{PType: "p", V0: "888", V1: "/menu/addMenuAuthority", V2: "POST"},
{PType: "p", V0: "888", V1: "/menu/getMenuAuthority", V2: "POST"},
{PType: "p", V0: "888", V1: "/menu/deleteBaseMenu", V2: "POST"},
{PType: "p", V0: "888", V1: "/menu/updateBaseMenu", V2: "POST"},
{PType: "p", V0: "888", V1: "/menu/getBaseMenuById", V2: "POST"},
{PType: "p", V0: "888", V1: "/user/changePassword", V2: "POST"},
{PType: "p", V0: "888", V1: "/user/getUserList", V2: "POST"},
{PType: "p", V0: "888", V1: "/user/setUserAuthority", V2: "POST"},
{PType: "p", V0: "888", V1: "/user/deleteUser", V2: "DELETE"},
{PType: "p", V0: "888", V1: "/fileUploadAndDownload/upload", V2: "POST"},
{PType: "p", V0: "888", V1: "/fileUploadAndDownload/getFileList", V2: "POST"},
{PType: "p", V0: "888", V1: "/fileUploadAndDownload/deleteFile", V2: "POST"},
{PType: "p", V0: "888", V1: "/casbin/updateCasbin", V2: "POST"},
{PType: "p", V0: "888", V1: "/casbin/getPolicyPathByAuthorityId", V2: "POST"},
{PType: "p", V0: "888", V1: "/casbin/casbinTest/:pathParam", V2: "GET"},
{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"},
{PType: "p", V0: "888", V1: "/customer/customer", V2: "GET"},
{PType: "p", V0: "888", V1: "/customer/customerList", V2: "GET"},
{PType: "p", V0: "888", V1: "/autoCode/createTemp", V2: "POST"},
{PType: "p", V0: "888", V1: "/autoCode/preview", V2: "POST"},
{PType: "p", V0: "888", V1: "/autoCode/getTables", V2: "GET"},
{PType: "p", V0: "888", V1: "/autoCode/getDB", V2: "GET"},
{PType: "p", V0: "888", V1: "/autoCode/getColumn", V2: "GET"},
{PType: "p", V0: "888", V1: "/sysDictionaryDetail/createSysDictionaryDetail", V2: "POST"},
{PType: "p", V0: "888", V1: "/sysDictionaryDetail/deleteSysDictionaryDetail", V2: "DELETE"},
{PType: "p", V0: "888", V1: "/sysDictionaryDetail/updateSysDictionaryDetail", V2: "PUT"},
{PType: "p", V0: "888", V1: "/sysDictionaryDetail/findSysDictionaryDetail", V2: "GET"},
{PType: "p", V0: "888", V1: "/sysDictionaryDetail/getSysDictionaryDetailList", V2: "GET"},
{PType: "p", V0: "888", V1: "/sysDictionary/createSysDictionary", V2: "POST"},
{PType: "p", V0: "888", V1: "/sysDictionary/deleteSysDictionary", V2: "DELETE"},
{PType: "p", V0: "888", V1: "/sysDictionary/updateSysDictionary", V2: "PUT"},
{PType: "p", V0: "888", V1: "/sysDictionary/findSysDictionary", V2: "GET"},
{PType: "p", V0: "888", V1: "/sysDictionary/getSysDictionaryList", V2: "GET"},
{PType: "p", V0: "888", V1: "/sysOperationRecord/createSysOperationRecord", V2: "POST"},
{PType: "p", V0: "888", V1: "/sysOperationRecord/deleteSysOperationRecord", V2: "DELETE"},
{PType: "p", V0: "888", V1: "/sysOperationRecord/updateSysOperationRecord", V2: "PUT"},
{PType: "p", V0: "888", V1: "/sysOperationRecord/findSysOperationRecord", V2: "GET"},
{PType: "p", V0: "888", V1: "/sysOperationRecord/getSysOperationRecordList", V2: "GET"},
{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: "888", V1: "/excel/importExcel", V2: "POST"},
{PType: "p", V0: "888", V1: "/excel/loadExcel", V2: "GET"},
{PType: "p", V0: "888", V1: "/excel/exportExcel", V2: "POST"},
{PType: "p", V0: "888", V1: "/excel/downloadTemplate", V2: "GET"},
{PType: "p", V0: "888", V1: "/api/deleteApisByIds", V2: "DELETE"},
{PType: "p", V0: "8881", V1: "/base/login", V2: "POST"},
{PType: "p", V0: "8881", V1: "/user/register", V2: "POST"},
{PType: "p", V0: "8881", V1: "/api/createApi", V2: "POST"},
{PType: "p", V0: "8881", V1: "/api/getApiList", V2: "POST"},
{PType: "p", V0: "8881", V1: "/api/getApiById", V2: "POST"},
{PType: "p", V0: "8881", V1: "/api/deleteApi", V2: "POST"},
{PType: "p", V0: "8881", V1: "/api/updateApi", V2: "POST"},
{PType: "p", V0: "8881", V1: "/api/getAllApis", V2: "POST"},
{PType: "p", V0: "8881", V1: "/authority/createAuthority", V2: "POST"},
{PType: "p", V0: "8881", V1: "/authority/deleteAuthority", V2: "POST"},
{PType: "p", V0: "8881", V1: "/authority/getAuthorityList", V2: "POST"},
{PType: "p", V0: "8881", V1: "/authority/setDataAuthority", V2: "POST"},
{PType: "p", V0: "8881", V1: "/menu/getMenu", V2: "POST"},
{PType: "p", V0: "8881", V1: "/menu/getMenuList", V2: "POST"},
{PType: "p", V0: "8881", V1: "/menu/addBaseMenu", V2: "POST"},
{PType: "p", V0: "8881", V1: "/menu/getBaseMenuTree", V2: "POST"},
{PType: "p", V0: "8881", V1: "/menu/addMenuAuthority", V2: "POST"},
{PType: "p", V0: "8881", V1: "/menu/getMenuAuthority", V2: "POST"},
{PType: "p", V0: "8881", V1: "/menu/deleteBaseMenu", V2: "POST"},
{PType: "p", V0: "8881", V1: "/menu/updateBaseMenu", V2: "POST"},
{PType: "p", V0: "8881", V1: "/menu/getBaseMenuById", V2: "POST"},
{PType: "p", V0: "8881", V1: "/user/changePassword", V2: "POST"},
{PType: "p", V0: "8881", V1: "/user/getUserList", V2: "POST"},
{PType: "p", V0: "8881", V1: "/user/setUserAuthority", V2: "POST"},
{PType: "p", V0: "8881", V1: "/fileUploadAndDownload/upload", V2: "POST"},
{PType: "p", V0: "8881", V1: "/fileUploadAndDownload/getFileList", V2: "POST"},
{PType: "p", V0: "8881", V1: "/fileUploadAndDownload/deleteFile", V2: "POST"},
{PType: "p", V0: "8881", V1: "/casbin/updateCasbin", V2: "POST"},
{PType: "p", V0: "8881", V1: "/casbin/getPolicyPathByAuthorityId", V2: "POST"},
{PType: "p", V0: "8881", V1: "/jwt/jsonInBlacklist", V2: "POST"},
{PType: "p", V0: "8881", V1: "/system/getSystemConfig", V2: "POST"},
{PType: "p", V0: "8881", V1: "/system/setSystemConfig", V2: "POST"},
{PType: "p", V0: "8881", V1: "/customer/customer", V2: "POST"},
{PType: "p", V0: "8881", V1: "/customer/customer", V2: "PUT"},
{PType: "p", V0: "8881", V1: "/customer/customer", V2: "DELETE"},
{PType: "p", V0: "8881", V1: "/customer/customer", V2: "GET"},
{PType: "p", V0: "8881", V1: "/customer/customerList", V2: "GET"},
{PType: "p", V0: "9528", V1: "/base/login", V2: "POST"},
{PType: "p", V0: "9528", V1: "/user/register", V2: "POST"},
{PType: "p", V0: "9528", V1: "/api/createApi", V2: "POST"},
{PType: "p", V0: "9528", V1: "/api/getApiList", V2: "POST"},
{PType: "p", V0: "9528", V1: "/api/getApiById", V2: "POST"},
{PType: "p", V0: "9528", V1: "/api/deleteApi", V2: "POST"},
{PType: "p", V0: "9528", V1: "/api/updateApi", V2: "POST"},
{PType: "p", V0: "9528", V1: "/api/getAllApis", V2: "POST"},
{PType: "p", V0: "9528", V1: "/authority/createAuthority", V2: "POST"},
{PType: "p", V0: "9528", V1: "/authority/deleteAuthority", V2: "POST"},
{PType: "p", V0: "9528", V1: "/authority/getAuthorityList", V2: "POST"},
{PType: "p", V0: "9528", V1: "/authority/setDataAuthority", V2: "POST"},
{PType: "p", V0: "9528", V1: "/menu/getMenu", V2: "POST"},
{PType: "p", V0: "9528", V1: "/menu/getMenuList", V2: "POST"},
{PType: "p", V0: "9528", V1: "/menu/addBaseMenu", V2: "POST"},
{PType: "p", V0: "9528", V1: "/menu/getBaseMenuTree", V2: "POST"},
{PType: "p", V0: "9528", V1: "/menu/addMenuAuthority", V2: "POST"},
{PType: "p", V0: "9528", V1: "/menu/getMenuAuthority", V2: "POST"},
{PType: "p", V0: "9528", V1: "/menu/deleteBaseMenu", V2: "POST"},
{PType: "p", V0: "9528", V1: "/menu/updateBaseMenu", V2: "POST"},
{PType: "p", V0: "9528", V1: "/menu/getBaseMenuById", V2: "POST"},
{PType: "p", V0: "9528", V1: "/user/changePassword", V2: "POST"},
{PType: "p", V0: "9528", V1: "/user/getUserList", V2: "POST"},
{PType: "p", V0: "9528", V1: "/user/setUserAuthority", V2: "POST"},
{PType: "p", V0: "9528", V1: "/fileUploadAndDownload/upload", V2: "POST"},
{PType: "p", V0: "9528", V1: "/fileUploadAndDownload/getFileList", V2: "POST"},
{PType: "p", V0: "9528", V1: "/fileUploadAndDownload/deleteFile", V2: "POST"},
{PType: "p", V0: "9528", V1: "/casbin/updateCasbin", V2: "POST"},
{PType: "p", V0: "9528", V1: "/casbin/getPolicyPathByAuthorityId", V2: "POST"},
{PType: "p", V0: "9528", V1: "/jwt/jsonInBlacklist", V2: "POST"},
{PType: "p", V0: "9528", V1: "/system/getSystemConfig", V2: "POST"},
{PType: "p", V0: "9528", V1: "/system/setSystemConfig", V2: "POST"},
{PType: "p", V0: "9528", V1: "/customer/customer", V2: "POST"},
{PType: "p", V0: "9528", V1: "/customer/customer", V2: "PUT"},
{PType: "p", V0: "9528", V1: "/customer/customer", V2: "DELETE"},
{PType: "p", V0: "9528", V1: "/customer/customer", V2: "GET"},
{PType: "p", V0: "9528", V1: "/customer/customerList", V2: "GET"},
{PType: "p", V0: "9528", V1: "/autoCode/createTemp", V2: "POST"},
{Ptype: "p", V0: "888", V1: "/base/login", V2: "POST"},
{Ptype: "p", V0: "888", V1: "/user/register", V2: "POST"},
{Ptype: "p", V0: "888", V1: "/api/createApi", V2: "POST"},
{Ptype: "p", V0: "888", V1: "/api/getApiList", V2: "POST"},
{Ptype: "p", V0: "888", V1: "/api/getApiById", V2: "POST"},
{Ptype: "p", V0: "888", V1: "/api/deleteApi", V2: "POST"},
{Ptype: "p", V0: "888", V1: "/api/updateApi", V2: "POST"},
{Ptype: "p", V0: "888", V1: "/api/getAllApis", V2: "POST"},
{Ptype: "p", V0: "888", V1: "/authority/createAuthority", V2: "POST"},
{Ptype: "p", V0: "888", V1: "/authority/deleteAuthority", V2: "POST"},
{Ptype: "p", V0: "888", V1: "/authority/getAuthorityList", V2: "POST"},
{Ptype: "p", V0: "888", V1: "/authority/setDataAuthority", V2: "POST"},
{Ptype: "p", V0: "888", V1: "/authority/updateAuthority", V2: "PUT"},
{Ptype: "p", V0: "888", V1: "/authority/copyAuthority", V2: "POST"},
{Ptype: "p", V0: "888", V1: "/menu/getMenu", V2: "POST"},
{Ptype: "p", V0: "888", V1: "/menu/getMenuList", V2: "POST"},
{Ptype: "p", V0: "888", V1: "/menu/addBaseMenu", V2: "POST"},
{Ptype: "p", V0: "888", V1: "/menu/getBaseMenuTree", V2: "POST"},
{Ptype: "p", V0: "888", V1: "/menu/addMenuAuthority", V2: "POST"},
{Ptype: "p", V0: "888", V1: "/menu/getMenuAuthority", V2: "POST"},
{Ptype: "p", V0: "888", V1: "/menu/deleteBaseMenu", V2: "POST"},
{Ptype: "p", V0: "888", V1: "/menu/updateBaseMenu", V2: "POST"},
{Ptype: "p", V0: "888", V1: "/menu/getBaseMenuById", V2: "POST"},
{Ptype: "p", V0: "888", V1: "/user/changePassword", V2: "POST"},
{Ptype: "p", V0: "888", V1: "/user/getUserList", V2: "POST"},
{Ptype: "p", V0: "888", V1: "/user/setUserAuthority", V2: "POST"},
{Ptype: "p", V0: "888", V1: "/user/deleteUser", V2: "DELETE"},
{Ptype: "p", V0: "888", V1: "/fileUploadAndDownload/upload", V2: "POST"},
{Ptype: "p", V0: "888", V1: "/fileUploadAndDownload/getFileList", V2: "POST"},
{Ptype: "p", V0: "888", V1: "/fileUploadAndDownload/deleteFile", V2: "POST"},
{Ptype: "p", V0: "888", V1: "/casbin/updateCasbin", V2: "POST"},
{Ptype: "p", V0: "888", V1: "/casbin/getPolicyPathByAuthorityId", V2: "POST"},
{Ptype: "p", V0: "888", V1: "/casbin/casbinTest/:pathParam", V2: "GET"},
{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"},
{Ptype: "p", V0: "888", V1: "/customer/customer", V2: "GET"},
{Ptype: "p", V0: "888", V1: "/customer/customerList", V2: "GET"},
{Ptype: "p", V0: "888", V1: "/autoCode/createTemp", V2: "POST"},
{Ptype: "p", V0: "888", V1: "/autoCode/preview", V2: "POST"},
{Ptype: "p", V0: "888", V1: "/autoCode/getTables", V2: "GET"},
{Ptype: "p", V0: "888", V1: "/autoCode/getDB", V2: "GET"},
{Ptype: "p", V0: "888", V1: "/autoCode/getColumn", V2: "GET"},
{Ptype: "p", V0: "888", V1: "/sysDictionaryDetail/createSysDictionaryDetail", V2: "POST"},
{Ptype: "p", V0: "888", V1: "/sysDictionaryDetail/deleteSysDictionaryDetail", V2: "DELETE"},
{Ptype: "p", V0: "888", V1: "/sysDictionaryDetail/updateSysDictionaryDetail", V2: "PUT"},
{Ptype: "p", V0: "888", V1: "/sysDictionaryDetail/findSysDictionaryDetail", V2: "GET"},
{Ptype: "p", V0: "888", V1: "/sysDictionaryDetail/getSysDictionaryDetailList", V2: "GET"},
{Ptype: "p", V0: "888", V1: "/sysDictionary/createSysDictionary", V2: "POST"},
{Ptype: "p", V0: "888", V1: "/sysDictionary/deleteSysDictionary", V2: "DELETE"},
{Ptype: "p", V0: "888", V1: "/sysDictionary/updateSysDictionary", V2: "PUT"},
{Ptype: "p", V0: "888", V1: "/sysDictionary/findSysDictionary", V2: "GET"},
{Ptype: "p", V0: "888", V1: "/sysDictionary/getSysDictionaryList", V2: "GET"},
{Ptype: "p", V0: "888", V1: "/sysOperationRecord/createSysOperationRecord", V2: "POST"},
{Ptype: "p", V0: "888", V1: "/sysOperationRecord/deleteSysOperationRecord", V2: "DELETE"},
{Ptype: "p", V0: "888", V1: "/sysOperationRecord/updateSysOperationRecord", V2: "PUT"},
{Ptype: "p", V0: "888", V1: "/sysOperationRecord/findSysOperationRecord", V2: "GET"},
{Ptype: "p", V0: "888", V1: "/sysOperationRecord/getSysOperationRecordList", V2: "GET"},
{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: "888", V1: "/excel/importExcel", V2: "POST"},
{Ptype: "p", V0: "888", V1: "/excel/loadExcel", V2: "GET"},
{Ptype: "p", V0: "888", V1: "/excel/exportExcel", V2: "POST"},
{Ptype: "p", V0: "888", V1: "/excel/downloadTemplate", V2: "GET"},
{Ptype: "p", V0: "888", V1: "/api/deleteApisByIds", V2: "DELETE"},
{Ptype: "p", V0: "8881", V1: "/base/login", V2: "POST"},
{Ptype: "p", V0: "8881", V1: "/user/register", V2: "POST"},
{Ptype: "p", V0: "8881", V1: "/api/createApi", V2: "POST"},
{Ptype: "p", V0: "8881", V1: "/api/getApiList", V2: "POST"},
{Ptype: "p", V0: "8881", V1: "/api/getApiById", V2: "POST"},
{Ptype: "p", V0: "8881", V1: "/api/deleteApi", V2: "POST"},
{Ptype: "p", V0: "8881", V1: "/api/updateApi", V2: "POST"},
{Ptype: "p", V0: "8881", V1: "/api/getAllApis", V2: "POST"},
{Ptype: "p", V0: "8881", V1: "/authority/createAuthority", V2: "POST"},
{Ptype: "p", V0: "8881", V1: "/authority/deleteAuthority", V2: "POST"},
{Ptype: "p", V0: "8881", V1: "/authority/getAuthorityList", V2: "POST"},
{Ptype: "p", V0: "8881", V1: "/authority/setDataAuthority", V2: "POST"},
{Ptype: "p", V0: "8881", V1: "/menu/getMenu", V2: "POST"},
{Ptype: "p", V0: "8881", V1: "/menu/getMenuList", V2: "POST"},
{Ptype: "p", V0: "8881", V1: "/menu/addBaseMenu", V2: "POST"},
{Ptype: "p", V0: "8881", V1: "/menu/getBaseMenuTree", V2: "POST"},
{Ptype: "p", V0: "8881", V1: "/menu/addMenuAuthority", V2: "POST"},
{Ptype: "p", V0: "8881", V1: "/menu/getMenuAuthority", V2: "POST"},
{Ptype: "p", V0: "8881", V1: "/menu/deleteBaseMenu", V2: "POST"},
{Ptype: "p", V0: "8881", V1: "/menu/updateBaseMenu", V2: "POST"},
{Ptype: "p", V0: "8881", V1: "/menu/getBaseMenuById", V2: "POST"},
{Ptype: "p", V0: "8881", V1: "/user/changePassword", V2: "POST"},
{Ptype: "p", V0: "8881", V1: "/user/getUserList", V2: "POST"},
{Ptype: "p", V0: "8881", V1: "/user/setUserAuthority", V2: "POST"},
{Ptype: "p", V0: "8881", V1: "/fileUploadAndDownload/upload", V2: "POST"},
{Ptype: "p", V0: "8881", V1: "/fileUploadAndDownload/getFileList", V2: "POST"},
{Ptype: "p", V0: "8881", V1: "/fileUploadAndDownload/deleteFile", V2: "POST"},
{Ptype: "p", V0: "8881", V1: "/casbin/updateCasbin", V2: "POST"},
{Ptype: "p", V0: "8881", V1: "/casbin/getPolicyPathByAuthorityId", V2: "POST"},
{Ptype: "p", V0: "8881", V1: "/jwt/jsonInBlacklist", V2: "POST"},
{Ptype: "p", V0: "8881", V1: "/system/getSystemConfig", V2: "POST"},
{Ptype: "p", V0: "8881", V1: "/system/setSystemConfig", V2: "POST"},
{Ptype: "p", V0: "8881", V1: "/customer/customer", V2: "POST"},
{Ptype: "p", V0: "8881", V1: "/customer/customer", V2: "PUT"},
{Ptype: "p", V0: "8881", V1: "/customer/customer", V2: "DELETE"},
{Ptype: "p", V0: "8881", V1: "/customer/customer", V2: "GET"},
{Ptype: "p", V0: "8881", V1: "/customer/customerList", V2: "GET"},
{Ptype: "p", V0: "9528", V1: "/base/login", V2: "POST"},
{Ptype: "p", V0: "9528", V1: "/user/register", V2: "POST"},
{Ptype: "p", V0: "9528", V1: "/api/createApi", V2: "POST"},
{Ptype: "p", V0: "9528", V1: "/api/getApiList", V2: "POST"},
{Ptype: "p", V0: "9528", V1: "/api/getApiById", V2: "POST"},
{Ptype: "p", V0: "9528", V1: "/api/deleteApi", V2: "POST"},
{Ptype: "p", V0: "9528", V1: "/api/updateApi", V2: "POST"},
{Ptype: "p", V0: "9528", V1: "/api/getAllApis", V2: "POST"},
{Ptype: "p", V0: "9528", V1: "/authority/createAuthority", V2: "POST"},
{Ptype: "p", V0: "9528", V1: "/authority/deleteAuthority", V2: "POST"},
{Ptype: "p", V0: "9528", V1: "/authority/getAuthorityList", V2: "POST"},
{Ptype: "p", V0: "9528", V1: "/authority/setDataAuthority", V2: "POST"},
{Ptype: "p", V0: "9528", V1: "/menu/getMenu", V2: "POST"},
{Ptype: "p", V0: "9528", V1: "/menu/getMenuList", V2: "POST"},
{Ptype: "p", V0: "9528", V1: "/menu/addBaseMenu", V2: "POST"},
{Ptype: "p", V0: "9528", V1: "/menu/getBaseMenuTree", V2: "POST"},
{Ptype: "p", V0: "9528", V1: "/menu/addMenuAuthority", V2: "POST"},
{Ptype: "p", V0: "9528", V1: "/menu/getMenuAuthority", V2: "POST"},
{Ptype: "p", V0: "9528", V1: "/menu/deleteBaseMenu", V2: "POST"},
{Ptype: "p", V0: "9528", V1: "/menu/updateBaseMenu", V2: "POST"},
{Ptype: "p", V0: "9528", V1: "/menu/getBaseMenuById", V2: "POST"},
{Ptype: "p", V0: "9528", V1: "/user/changePassword", V2: "POST"},
{Ptype: "p", V0: "9528", V1: "/user/getUserList", V2: "POST"},
{Ptype: "p", V0: "9528", V1: "/user/setUserAuthority", V2: "POST"},
{Ptype: "p", V0: "9528", V1: "/fileUploadAndDownload/upload", V2: "POST"},
{Ptype: "p", V0: "9528", V1: "/fileUploadAndDownload/getFileList", V2: "POST"},
{Ptype: "p", V0: "9528", V1: "/fileUploadAndDownload/deleteFile", V2: "POST"},
{Ptype: "p", V0: "9528", V1: "/casbin/updateCasbin", V2: "POST"},
{Ptype: "p", V0: "9528", V1: "/casbin/getPolicyPathByAuthorityId", V2: "POST"},
{Ptype: "p", V0: "9528", V1: "/jwt/jsonInBlacklist", V2: "POST"},
{Ptype: "p", V0: "9528", V1: "/system/getSystemConfig", V2: "POST"},
{Ptype: "p", V0: "9528", V1: "/system/setSystemConfig", V2: "POST"},
{Ptype: "p", V0: "9528", V1: "/customer/customer", V2: "POST"},
{Ptype: "p", V0: "9528", V1: "/customer/customer", V2: "PUT"},
{Ptype: "p", V0: "9528", V1: "/customer/customer", V2: "DELETE"},
{Ptype: "p", V0: "9528", V1: "/customer/customer", V2: "GET"},
{Ptype: "p", V0: "9528", V1: "/customer/customerList", V2: "GET"},
{Ptype: "p", V0: "9528", V1: "/autoCode/createTemp", V2: "POST"},
}
//@author: [SliverHorn](https://github.com/SliverHorn)

2
server/source/file.go

@ -31,4 +31,4 @@ func (f *file) Init() error {
color.Info.Println("\n[Mysql] --> exa_file_upload_and_downloads 表初始数据成功!")
return nil
})
}
}

2
server/utils/constant.go

@ -1,6 +1,6 @@
package utils
const (
ConfigEnv = "GVA_CONFIG"
ConfigEnv = "GVA_CONFIG"
ConfigFile = "config.yaml"
)

2
server/utils/directory.go

@ -39,7 +39,7 @@ func CreateDir(dirs ...string) (err error) {
global.GVA_LOG.Debug("create directory" + v)
err = os.MkdirAll(v, os.ModePerm)
if err != nil {
global.GVA_LOG.Error("create directory"+ v, zap.Any(" error:", err))
global.GVA_LOG.Error("create directory"+v, zap.Any(" error:", err))
}
}
}

2
server/utils/rotatelogs_unix.go

@ -27,4 +27,4 @@ func GetWriteSyncer() (zapcore.WriteSyncer, error) {
return zapcore.NewMultiWriteSyncer(zapcore.AddSync(os.Stdout), zapcore.AddSync(fileWriter)), err
}
return zapcore.AddSync(fileWriter), err
}
}

2
server/utils/rotatelogs_windows.go

@ -24,4 +24,4 @@ func GetWriteSyncer() (zapcore.WriteSyncer, error) {
return zapcore.NewMultiWriteSyncer(zapcore.AddSync(os.Stdout), zapcore.AddSync(fileWriter)), err
}
return zapcore.AddSync(fileWriter), err
}
}

9
server/utils/server.go

@ -35,7 +35,6 @@ type Cpu struct {
Cores int `json:"cores"`
}
type Rrm struct {
UsedMB int `json:"usedMb"`
TotalMB int `json:"totalMb"`
@ -89,9 +88,9 @@ func InitCPU() (c Cpu, err error) {
//@return: r Rrm, err error
func InitRAM() (r Rrm, err error) {
if u, err := mem.VirtualMemory(); err != nil{
if u, err := mem.VirtualMemory(); err != nil {
return r, err
}else {
} else {
r.UsedMB = int(u.Used) / MB
r.TotalMB = int(u.Total) / MB
r.UsedPercent = int(u.UsedPercent)
@ -105,7 +104,7 @@ func InitRAM() (r Rrm, err error) {
//@return: d Disk, err error
func InitDisk() (d Disk, err error) {
if u, err := disk.Usage("/"); err != nil{
if u, err := disk.Usage("/"); err != nil {
return d, err
} else {
d.UsedMB = int(u.Used) / MB
@ -115,4 +114,4 @@ func InitDisk() (d Disk, err error) {
d.UsedPercent = int(u.UsedPercent)
}
return d, nil
}
}

1
server/utils/upload/local.go

@ -1,4 +1,5 @@
package upload
import (
"errors"
"gin-vue-admin/global"

6
server/utils/upload/qiniu.go

@ -60,7 +60,7 @@ func (*Qiniu) DeleteFile(key string) error {
mac := qbox.NewMac(global.GVA_CONFIG.Qiniu.AccessKey, global.GVA_CONFIG.Qiniu.SecretKey)
cfg := qiniuConfig()
bucketManager := storage.NewBucketManager(mac, cfg)
if err := bucketManager.Delete(global.GVA_CONFIG.Qiniu.Bucket, key); err != nil{
if err := bucketManager.Delete(global.GVA_CONFIG.Qiniu.Bucket, key); err != nil {
global.GVA_LOG.Error("function bucketManager.Delete() Filed", zap.Any("err", err.Error()))
return errors.New("function bucketManager.Delete() Filed, err:" + err.Error())
}
@ -76,7 +76,7 @@ func (*Qiniu) DeleteFile(key string) error {
func qiniuConfig() *storage.Config {
cfg := storage.Config{
UseHTTPS: global.GVA_CONFIG.Qiniu.UseHTTPS,
UseHTTPS: global.GVA_CONFIG.Qiniu.UseHTTPS,
UseCdnDomains: global.GVA_CONFIG.Qiniu.UseCdnDomains,
}
switch global.GVA_CONFIG.Qiniu.Zone { // 根据配置文件进行初始化空间对应的机房
@ -92,4 +92,4 @@ func qiniuConfig() *storage.Config {
cfg.Zone = &storage.ZoneXinjiapo
}
return &cfg
}
}
Loading…
Cancel
Save