From a6b044647012d1cd188167c6afbe31159009fbd7 Mon Sep 17 00:00:00 2001 From: yxh Date: Thu, 28 Apr 2022 09:37:21 +0800 Subject: [PATCH 1/2] =?UTF-8?q?middleware=20=E4=B8=AD=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E6=9D=83=E9=99=90=E6=9C=AA=E5=88=A4=E6=96=AD=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/app/system/service/middleware.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/app/system/service/middleware.go b/internal/app/system/service/middleware.go index 397affc..1bf1987 100644 --- a/internal/app/system/service/middleware.go +++ b/internal/app/system/service/middleware.go @@ -83,7 +83,7 @@ func (s *middlewareImpl) Auth(r *ghttp.Request) { return } //获取地址对应的菜单id - menuList, err := Rule().GetIsMenuList(ctx) + menuList, err := Rule().GetMenuList(ctx) if err != nil { g.Log().Error(ctx, err) libResponse.FailJson(true, r, "请求数据失败") From c756896c0d38253d87a84ea6e5068e38c95198de Mon Sep 17 00:00:00 2001 From: yxh Date: Sat, 30 Apr 2022 09:50:28 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=BD=AC=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/app/common/service/cache.go | 2 +- internal/app/common/service/captcha.go | 2 +- internal/app/common/service/middleware.go | 2 +- internal/app/common/service/sys_config.go | 2 +- internal/app/common/service/sys_dict_data.go | 2 +- internal/app/common/service/sys_dict_type.go | 2 +- internal/app/common/service/token.go | 2 +- internal/app/system/service/context.go | 2 +- internal/app/system/service/middleware.go | 2 +- internal/app/system/service/sys_auth_rule.go | 2 +- internal/app/system/service/sys_dept.go | 2 +- internal/app/system/service/sys_login_log.go | 2 +- internal/app/system/service/sys_post.go | 2 +- internal/app/system/service/sys_role.go | 2 +- internal/app/system/service/sys_user.go | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/internal/app/common/service/cache.go b/internal/app/common/service/cache.go index 76ee909..44f43b1 100644 --- a/internal/app/common/service/cache.go +++ b/internal/app/common/service/cache.go @@ -38,5 +38,5 @@ func Cache() ICache { } else { ch.GfCache = cache.New(prefix) } - return ICache(&ch) + return &ch } diff --git a/internal/app/common/service/captcha.go b/internal/app/common/service/captcha.go index 976c7e7..d40f530 100644 --- a/internal/app/common/service/captcha.go +++ b/internal/app/common/service/captcha.go @@ -32,7 +32,7 @@ var ( ) func Captcha() ICaptcha { - return ICaptcha(&captcha) + return &captcha } // GetVerifyImgString 获取字母数字混合验证码 diff --git a/internal/app/common/service/middleware.go b/internal/app/common/service/middleware.go index b166d64..e0fb6d3 100644 --- a/internal/app/common/service/middleware.go +++ b/internal/app/common/service/middleware.go @@ -18,7 +18,7 @@ type middlewareImpl struct{} var middleService = middlewareImpl{} func Middleware() IMiddleware { - return IMiddleware(&middleService) + return &middleService } func (s *middlewareImpl) MiddlewareCORS(r *ghttp.Request) { diff --git a/internal/app/common/service/sys_config.go b/internal/app/common/service/sys_config.go index 9ea4f6d..057f161 100644 --- a/internal/app/common/service/sys_config.go +++ b/internal/app/common/service/sys_config.go @@ -35,7 +35,7 @@ type configTmpl struct { var configService = configTmpl{} func Config() IConfig { - return IConfig(&configService) + return &configService } // List 系统参数列表 diff --git a/internal/app/common/service/sys_dict_data.go b/internal/app/common/service/sys_dict_data.go index ad377e5..673c591 100644 --- a/internal/app/common/service/sys_dict_data.go +++ b/internal/app/common/service/sys_dict_data.go @@ -36,7 +36,7 @@ type dictDataImpl struct { var dictData = dictDataImpl{} func DictData() IDictData { - return IDictData(&dictData) + return &dictData } // GetDictWithDataByType 通过字典键类型获取选项 diff --git a/internal/app/common/service/sys_dict_type.go b/internal/app/common/service/sys_dict_type.go index a8e37f3..c1ff4de 100644 --- a/internal/app/common/service/sys_dict_type.go +++ b/internal/app/common/service/sys_dict_type.go @@ -38,7 +38,7 @@ type dictTypeImpl struct { var dictTypeService = dictTypeImpl{} func DictType() IDictType { - return IDictType(&dictTypeService) + return &dictTypeService } // List 字典类型列表 diff --git a/internal/app/common/service/token.go b/internal/app/common/service/token.go index f0161ed..f2d1500 100644 --- a/internal/app/common/service/token.go +++ b/internal/app/common/service/token.go @@ -45,5 +45,5 @@ func GfToken(options *model.TokenOptions) IGfToken { gftoken.WithExcludePaths(options.ExcludePaths), fun, ) - return IGfToken(&gT) + return &gT } diff --git a/internal/app/system/service/context.go b/internal/app/system/service/context.go index 06b7154..2636368 100644 --- a/internal/app/system/service/context.go +++ b/internal/app/system/service/context.go @@ -28,7 +28,7 @@ var contextService = contextServiceImpl{} type contextServiceImpl struct{} func Context() IContext { - return IContext(&contextService) + return &contextService } // Init 初始化上下文对象指针到上下文对象中,以便后续的请求流程中可以修改。 diff --git a/internal/app/system/service/middleware.go b/internal/app/system/service/middleware.go index 397affc..324d34b 100644 --- a/internal/app/system/service/middleware.go +++ b/internal/app/system/service/middleware.go @@ -28,7 +28,7 @@ type middlewareImpl struct{} var middleService = middlewareImpl{} func Middleware() IMiddleware { - return IMiddleware(&middleService) + return &middleService } // Ctx 自定义上下文对象 diff --git a/internal/app/system/service/sys_auth_rule.go b/internal/app/system/service/sys_auth_rule.go index b9f128e..ae68c8f 100644 --- a/internal/app/system/service/sys_auth_rule.go +++ b/internal/app/system/service/sys_auth_rule.go @@ -43,7 +43,7 @@ type ruleImpl struct { var ruleService = ruleImpl{} func Rule() IRule { - return IRule(&ruleService) + return &ruleService } func (s *ruleImpl) GetMenuListSearch(ctx context.Context, req *system.RuleSearchReq) (res []*model.SysAuthRuleInfoRes, err error) { diff --git a/internal/app/system/service/sys_dept.go b/internal/app/system/service/sys_dept.go index 6daed54..e56735e 100644 --- a/internal/app/system/service/sys_dept.go +++ b/internal/app/system/service/sys_dept.go @@ -35,7 +35,7 @@ type IDept interface { var deptService = deptImpl{} func Dept() IDept { - return IDept(&deptService) + return &deptService } type deptImpl struct { diff --git a/internal/app/system/service/sys_login_log.go b/internal/app/system/service/sys_login_log.go index da6b6bf..ae86a06 100644 --- a/internal/app/system/service/sys_login_log.go +++ b/internal/app/system/service/sys_login_log.go @@ -37,7 +37,7 @@ var ( ) func SysLoginLog() ISysLoginLog { - return ISysLoginLog(&sysLoginLogService) + return &sysLoginLogService } func (s *sysLoginLogImpl) Invoke(ctx context.Context, data *model.LoginLogParams) { diff --git a/internal/app/system/service/sys_post.go b/internal/app/system/service/sys_post.go index f698d4b..3340fec 100644 --- a/internal/app/system/service/sys_post.go +++ b/internal/app/system/service/sys_post.go @@ -33,7 +33,7 @@ type postImpl struct { var postService = postImpl{} func Post() IPost { - return IPost(&postService) + return &postService } // List 岗位列表 diff --git a/internal/app/system/service/sys_role.go b/internal/app/system/service/sys_role.go index f6bcbad..3feb9ef 100644 --- a/internal/app/system/service/sys_role.go +++ b/internal/app/system/service/sys_role.go @@ -37,7 +37,7 @@ type roleImpl struct { var roleService = roleImpl{} func Role() IRole { - return IRole(&roleService) + return &roleService } func (s *roleImpl) GetRoleListSearch(ctx context.Context, req *system.RoleListReq) (res *system.RoleListRes, err error) { diff --git a/internal/app/system/service/sys_user.go b/internal/app/system/service/sys_user.go index 1e4a30f..e2e32d5 100644 --- a/internal/app/system/service/sys_user.go +++ b/internal/app/system/service/sys_user.go @@ -58,7 +58,7 @@ var ( ) func User() IUser { - return IUser(&userService) + return &userService } func (s *userImpl) NotCheckAuthAdminIds(ctx context.Context) *gset.Set {