Skip to content

Commit

Permalink
Merge pull request #303 from suyuan32/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
suyuan32 authored May 16, 2024
2 parents b2f601d + c04326a commit 65a87bf
Show file tree
Hide file tree
Showing 10 changed files with 117 additions and 104 deletions.
8 changes: 4 additions & 4 deletions README.En.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

**English** | [中文](./README.md)
---
[![Go-Zero](https://img.shields.io/badge/Go--Zero-v1.6.4-brightgreen.svg)](https://go-zero.dev/)
[![Vben Admin](https://img.shields.io/badge/Vben%20Admin-v2.10.1-yellow.svg)](https://vvbin.cn/doc-next/)
[![Go-Zero](https://img.shields.io/badge/Go--Zero-v1.6.5-brightgreen.svg)](https://go-zero.dev/)
[![Vben Admin](https://img.shields.io/badge/Vben%20Admin-v2.11.1-yellow.svg)](https://vvbin.cn/doc-next/)
[![Ent](https://img.shields.io/badge/Ent-v0.13.1-blue.svg)](https://entgo.io/)
[![Casbin](https://img.shields.io/badge/Casbin-v2.87.1-orange.svg)](https://github.com/casbin/casbin)
[![Release](https://img.shields.io/badge/Release-v1.4.0-green.svg)](https://github.com/suyuan32/simple-admin-core/releases)
[![Casbin](https://img.shields.io/badge/Casbin-v2.89.0-orange.svg)](https://github.com/casbin/casbin)
[![Release](https://img.shields.io/badge/Release-v1.4.2-green.svg)](https://github.com/suyuan32/simple-admin-core/releases)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
![公众号](https://img.shields.io/badge/%E5%85%AC%E4%BC%97%E5%8F%B7-%E5%87%A0%E9%A2%97%E9%85%A5-blue)
![注意](https://img.shields.io/badge/%E6%B3%A8%E6%84%8F-%E5%85%B3%E6%B3%A8%E5%85%AC%E4%BC%97%E5%8F%B7%E5%8A%A0%E5%85%A5%E5%BE%AE%E4%BF%A1%E7%BE%A4-blue)
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

**中文** | [English](./README.En.md)
---
[![Go-Zero](https://img.shields.io/badge/Go--Zero-v1.6.4-brightgreen.svg)](https://go-zero.dev/)
[![Vben Admin](https://img.shields.io/badge/Vben%20Admin-v2.10.1-yellow.svg)](https://vvbin.cn/doc-next/)
[![Go-Zero](https://img.shields.io/badge/Go--Zero-v1.6.5-brightgreen.svg)](https://go-zero.dev/)
[![Vben Admin](https://img.shields.io/badge/Vben%20Admin-v2.11.1-yellow.svg)](https://vvbin.cn/doc-next/)
[![Ent](https://img.shields.io/badge/Ent-v0.13.1-blue.svg)](https://entgo.io/)
[![Casbin](https://img.shields.io/badge/Casbin-v2.87.1-orange.svg)](https://github.com/casbin/casbin)
[![Release](https://img.shields.io/badge/Release-v1.4.0-green.svg)](https://github.com/suyuan32/simple-admin-core/releases)
[![Casbin](https://img.shields.io/badge/Casbin-v2.89.0-orange.svg)](https://github.com/casbin/casbin)
[![Release](https://img.shields.io/badge/Release-v1.4.2-green.svg)](https://github.com/suyuan32/simple-admin-core/releases)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
![公众号](https://img.shields.io/badge/%E5%85%AC%E4%BC%97%E5%8F%B7-%E5%87%A0%E9%A2%97%E9%85%A5-blue)
![注意](https://img.shields.io/badge/%E6%B3%A8%E6%84%8F-%E5%85%B3%E6%B3%A8%E5%85%AC%E4%BC%97%E5%8F%B7%E5%8A%A0%E5%85%A5%E5%BE%AE%E4%BF%A1%E7%BE%A4-blue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ func (l *CreateOrUpdateApiAuthorityLogic) CreateOrUpdateApiAuthority(req *types.

// clear old policies
var oldPolicies [][]string
oldPolicies = l.svcCtx.Casbin.GetFilteredPolicy(0, *data.Code)
oldPolicies, err = l.svcCtx.Casbin.GetFilteredPolicy(0, *data.Code)
if err != nil {
logx.Error("failed to get old Casbin policy", logx.Field("detail", err))
return nil, errorx.NewInternalError(err.Error())
}

if len(oldPolicies) != 0 {
removeResult, err := l.svcCtx.Casbin.RemoveFilteredPolicy(0, *data.Code)
if err != nil {
Expand Down
8 changes: 7 additions & 1 deletion api/internal/logic/authority/get_api_authority_logic.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package authority

import (
"context"
"github.com/zeromicro/go-zero/core/errorx"

"github.com/suyuan32/simple-admin-common/i18n"

Expand Down Expand Up @@ -32,7 +33,12 @@ func (l *GetApiAuthorityLogic) GetApiAuthority(req *types.IDReq) (resp *types.Ap
return nil, err
}

data := l.svcCtx.Casbin.GetFilteredPolicy(0, *roleData.Code)
data, err := l.svcCtx.Casbin.GetFilteredPolicy(0, *roleData.Code)
if err != nil {
logx.Error("failed to get old Casbin policy", logx.Field("detail", err))
return nil, errorx.NewInternalError(err.Error())
}

resp = &types.ApiAuthorityListResp{}
resp.Msg = l.svcCtx.Trans.Trans(l.ctx, i18n.Success)
resp.Data.Total = uint64(len(data))
Expand Down
2 changes: 2 additions & 0 deletions api/internal/svc/service_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ func NewServiceContext(c config.Config) *ServiceContext {
trans = i18n.NewTranslator(i18n2.LocaleFS)
}

trans.AddLanguagesByConf(c.I18nConf, i18n2.LocaleFS)

svc := &ServiceContext{
Config: c,
CoreRpc: coreclient.NewCore(zrpc.NewClientIfEnable(c.CoreRpc)),
Expand Down
12 changes: 6 additions & 6 deletions deploy/docker-compose/all_in_one/mysql/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ services:
memory: 200M

core-rpc:
image: ryanpower/core-rpc-docker:v1.4.1
image: ryanpower/core-rpc-docker:v1.4.3
container_name: core-rpc
restart: always
ports:
Expand All @@ -83,7 +83,7 @@ services:
memory: 200M

job-rpc:
image: ryanpower/job-rpc-docker:v1.4.1
image: ryanpower/job-rpc-docker:v1.4.3
container_name: job-rpc
restart: always
ports:
Expand All @@ -108,7 +108,7 @@ services:
memory: 200M

core-api:
image: ryanpower/core-api-docker:v1.4.1
image: ryanpower/core-api-docker:v1.4.3
container_name: core-api
restart: always
environment:
Expand All @@ -135,7 +135,7 @@ services:
memory: 200M

backend-ui:
image: ryanpower/backend-ui-docker:v1.4.1
image: ryanpower/backend-ui-docker:v1.4.3
container_name: backend-ui
restart: always
ports:
Expand All @@ -154,7 +154,7 @@ services:
memory: 200M

fms-api:
image: ryanpower/fms-api-docker:v1.4.1
image: ryanpower/fms-api-docker:v1.4.3
container_name: fms-api
restart: always
# environment:
Expand Down Expand Up @@ -185,7 +185,7 @@ services:
memory: 200M

mcms-rpc:
image: ryanpower/mcms-rpc-docker:v1.4.1
image: ryanpower/mcms-rpc-docker:v1.4.3
container_name: mcms-rpc
restart: always
environment:
Expand Down
12 changes: 6 additions & 6 deletions deploy/docker-compose/all_in_one/postgresql/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ services:
memory: 200M

core-rpc:
image: ryanpower/core-rpc-docker:v1.4.1
image: ryanpower/core-rpc-docker:v1.4.3
container_name: core-rpc
restart: always
# ports:
Expand All @@ -75,7 +75,7 @@ services:
memory: 200M

job-rpc:
image: ryanpower/job-rpc-docker:v1.4.1
image: ryanpower/job-rpc-docker:v1.4.3
container_name: job-rpc
restart: always
# ports:
Expand All @@ -94,7 +94,7 @@ services:
memory: 200M

core-api:
image: ryanpower/core-api-docker:v1.4.1
image: ryanpower/core-api-docker:v1.4.3
container_name: core-api
restart: always
environment:
Expand All @@ -116,7 +116,7 @@ services:
memory: 200M

backend-ui:
image: ryanpower/backend-ui-docker:v1.4.1
image: ryanpower/backend-ui-docker:v1.4.3
container_name: backend-ui
restart: always
ports:
Expand All @@ -135,7 +135,7 @@ services:
memory: 200M

fms-api:
image: ryanpower/fms-api-docker:v1.4.1
image: ryanpower/fms-api-docker:v1.4.3
container_name: fms-api
restart: always
# environment:
Expand All @@ -160,7 +160,7 @@ services:
memory: 200M

mcms-rpc:
image: ryanpower/mcms-rpc-docker:v1.4.1
image: ryanpower/mcms-rpc-docker:v1.4.3
container_name: mcms-rpc
restart: always
# environment:
Expand Down
52 changes: 26 additions & 26 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ go 1.22.0
require (
entgo.io/ent v0.13.1
github.com/bsm/redislock v0.9.4
github.com/casbin/casbin/v2 v2.87.1
github.com/duke-git/lancet/v2 v2.3.0
github.com/gofrs/uuid/v5 v5.1.0
github.com/casbin/casbin/v2 v2.89.0
github.com/duke-git/lancet/v2 v2.3.1
github.com/gofrs/uuid/v5 v5.2.0
github.com/mojocn/base64Captcha v1.3.6
github.com/redis/go-redis/v9 v9.5.1
github.com/suyuan32/simple-admin-common v1.4.1
github.com/suyuan32/simple-admin-job v1.4.1
github.com/suyuan32/simple-admin-message-center v1.4.1
github.com/zeromicro/go-zero v1.6.4
golang.org/x/oauth2 v0.19.0
google.golang.org/grpc v1.63.2
google.golang.org/protobuf v1.33.1-0.20240408130810-98873a205002
github.com/suyuan32/simple-admin-common v1.4.3
github.com/suyuan32/simple-admin-job v1.4.3
github.com/suyuan32/simple-admin-message-center v1.4.3
github.com/zeromicro/go-zero v1.6.5
golang.org/x/oauth2 v0.20.0
google.golang.org/grpc v1.64.0
google.golang.org/protobuf v1.34.1
)

require (
ariga.io/atlas v0.21.1 // indirect
ariga.io/atlas v0.22.0 // indirect
filippo.io/edwards25519 v1.1.0 // indirect
github.com/agext/levenshtein v1.2.3 // indirect
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
Expand All @@ -35,7 +35,7 @@ require (
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/emicklei/go-restful/v3 v3.12.0 // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/fatih/color v1.17.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
Expand All @@ -45,7 +45,7 @@ require (
github.com/go-openapi/swag v0.23.0 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.19.0 // indirect
github.com/go-playground/validator/v10 v10.20.0 // indirect
github.com/go-sql-driver/mysql v1.8.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v5 v5.2.1 // indirect
Expand Down Expand Up @@ -80,9 +80,9 @@ require (
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/nicksnyder/go-i18n/v2 v2.4.0 // indirect
github.com/openzipkin/zipkin-go v0.4.3 // indirect
github.com/pelletier/go-toml/v2 v2.2.1 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.19.0 // indirect
github.com/prometheus/client_golang v1.19.1 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.53.0 // indirect
github.com/prometheus/procfs v0.14.0 // indirect
Expand All @@ -104,19 +104,19 @@ require (
go.uber.org/automaxprocs v1.5.3 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/crypto v0.22.0 // indirect
golang.org/x/crypto v0.23.0 // indirect
golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 // indirect
golang.org/x/image v0.15.0 // indirect
golang.org/x/image v0.16.0 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.24.0 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/term v0.19.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/term v0.20.0 // indirect
golang.org/x/text v0.15.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.20.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240415180920-8c6c420018be // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240415180920-8c6c420018be // indirect
golang.org/x/tools v0.21.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240513163218-0867130af1f8 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand All @@ -125,12 +125,12 @@ require (
k8s.io/client-go v0.30.0 // indirect
k8s.io/klog/v2 v2.120.1 // indirect
k8s.io/kube-openapi v0.0.0-20240423202451-8948a665c108 // indirect
k8s.io/utils v0.0.0-20240423183400-0849a56e8f22 // indirect
k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)

replace github.com/zeromicro/go-zero v1.6.4 => github.com/suyuan32/simple-admin-tools v1.6.10
replace github.com/zeromicro/go-zero v1.6.5 => github.com/suyuan32/simple-admin-tools v1.6.11

replace github.com/mojocn/base64Captcha v1.3.6 => github.com/suyuan32/base64Captcha v1.3.7
Loading

0 comments on commit 65a87bf

Please sign in to comment.