修复初始化时跳出的两个bug提示(不影响使用)
This commit is contained in:
@@ -74,6 +74,7 @@ func (b *BaseApi) tokenNext(c *gin.Context, user system.SysUser) {
|
||||
}, "登录成功", c)
|
||||
return
|
||||
}
|
||||
|
||||
if err, jwtStr := jwtService.GetRedisJWT(user.Username); err == redis.Nil {
|
||||
if err := jwtService.SetRedisJWT(token, user.Username); err != nil {
|
||||
global.GVA_LOG.Error("设置登录状态失败!", zap.Any("err", err))
|
||||
|
@@ -1,3 +1,4 @@
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package core
|
||||
|
@@ -1,3 +1,4 @@
|
||||
//go:build windows
|
||||
// +build windows
|
||||
|
||||
package core
|
||||
|
@@ -70,4 +70,3 @@ func JWTAuth() gin.HandlerFunc {
|
||||
c.Next()
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,3 +1,4 @@
|
||||
//go:build !packfile
|
||||
// +build !packfile
|
||||
|
||||
package packfile
|
||||
|
@@ -1,3 +1,4 @@
|
||||
//go:build packfile
|
||||
// +build packfile
|
||||
|
||||
package packfile
|
||||
|
@@ -13,7 +13,7 @@ type authorityMenu struct{}
|
||||
//@author: [SliverHorn](https://github.com/SliverHorn)
|
||||
//@description: authority_menu 视图数据初始化
|
||||
func (a *authorityMenu) Init() error {
|
||||
if global.GVA_DB.Find(&[]system.SysMenu{}).RowsAffected > 0 {
|
||||
if global.GVA_DB.Migrator().HasTable("authority_menu") && global.GVA_DB.Find(&[]system.SysMenu{}).RowsAffected > 0 {
|
||||
color.Danger.Println("\n[Mysql] --> authority_menu 视图已存在!")
|
||||
return nil
|
||||
}
|
||||
|
@@ -21,7 +21,7 @@ var userAuthorityModel = []system.SysUseAuthority{
|
||||
//@description: user_authority 数据初始化
|
||||
func (a *userAuthority) Init() error {
|
||||
return global.GVA_DB.Model(&system.SysUseAuthority{}).Transaction(func(tx *gorm.DB) error {
|
||||
if tx.Where("sys_user_id IN (1, 2)").Find(&[]AuthorityMenus{}).RowsAffected == 4 {
|
||||
if tx.Where("sys_user_id IN (1, 2)").Find(&[]system.SysUseAuthority{}).RowsAffected == 4 {
|
||||
color.Danger.Println("\n[Mysql] --> sys_user_authority 表的初始数据已存在!")
|
||||
return nil
|
||||
}
|
||||
|
@@ -68,4 +68,4 @@ func (j *JWT) ParseToken(tokenString string) (*request.CustomClaims, error) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
//+build !windows
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package plugin
|
||||
|
||||
|
Reference in New Issue
Block a user