Skip to content

Commit f87eaec

Browse files
+ Automatically generate code to add enumeration type support by@HessianZ in flipped-aurora#1073 + Fix code generation problem in docker by@tscuite in flipped-aurora#1067 + Fix replace the method of abandonment by@songzhibin97 in flipped-aurora#1075 + Fix several misuses of okwithdata by@pnck in flipped-aurora#1077 + Fix the problem that pg cannot be used in multi-library mode by@pnck in flipped-aurora#1081 + Fixed the bug that menu jumps must be refreshed under vite2.9.9 + Added automatic code interception check for empty package + Update version from 2.5.1 to 2.5.1b
2 parents 15f6e74 + 4344504 commit f87eaec

File tree

94 files changed

+1497
-1298
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+1497
-1298
lines changed

.github/workflows/docker-cicd.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Docker-CICD
2+
on:
3+
push:
4+
branches: [main]
5+
workflow_dispatch:
6+
jobs:
7+
build:
8+
name: Build
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Check out branch
12+
uses: actions/checkout@v2
13+
- name: Login to Aliyun Registry
14+
uses: docker/login-action@v1
15+
with:
16+
registry: ${{ secrets.ALIYUN_REGISTRY }}
17+
username: ${{ secrets.ALIYUN_DOCKERHUB_USER }}
18+
password: ${{ secrets.ALIYUN_DOCKERHUB_PASSWORD }}
19+
- name: Sed Config
20+
shell: bash
21+
run: |
22+
sed -i 's#./entrypoint.sh"#./entrypoint.sh","actions"#g' Dockerfile
23+
sed -i "s#COPY build/ /usr/share/nginx/html/#COPY . /opt/gva#g" Dockerfile
24+
sed -i 16c"\ && cd /opt/gva/server/ && go mod tidy && cd /opt/gva/web/ && yarn" Dockerfile
25+
sed -i "s#open: true#open: false#g" web/vite.config.js
26+
make images TAGS_OPT="latest"
27+
docker push registry.cn-hangzhou.aliyuncs.com/gva/web:latest
28+
docker push registry.cn-hangzhou.aliyuncs.com/gva/server:latest
29+
docker push registry.cn-hangzhou.aliyuncs.com/gva/all:latest

Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM centos:7
2+
WORKDIR /opt
3+
ENV LANG=en_US.utf8
4+
COPY entrypoint.sh .
5+
COPY build/ /usr/share/nginx/html/
6+
COPY server/config.yaml /usr/share/nginx/html/config.yaml
7+
COPY web/.docker-compose/nginx/conf.d/nginx.conf /etc/nginx/conf.d/nginx.conf
8+
RUN set -ex \
9+
&& echo "LANG=en_US.utf8" > /etc/locale.conf \
10+
&& echo "net.core.somaxconn = 1024" >> /etc/sysctl.conf \
11+
&& echo "vm.overcommit_memory = 1" >> /etc/sysctl.conf \
12+
&& yum -y install yum -y install *epel* \
13+
&& yum -y localinstall http://mirrors.ustc.edu.cn/mysql-repo/mysql57-community-release-el7.rpm \
14+
&& yum -y install mysql-community-server git redis nginx go npm --nogpgcheck && chmod +x ./entrypoint.sh \
15+
&& npm install -g yarn && go env -w GO111MODULE=on && go env -w GOPROXY=https://goproxy.cn,direct \
16+
&& echo "start" > /dev/null
17+
EXPOSE 80
18+
ENTRYPOINT ["./entrypoint.sh"]

Makefile

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
SHELL = /bin/bash
2+
3+
CONFIG_FILE = config.yaml
4+
PROJECT_NAME = github.com/flipped-aurora/gin-vue-admin/server
5+
#SCRIPT_DIR = $(shell pwd)/etc/script
6+
BUILD_IMAGE_SERVER = golang:1.16
7+
BUILD_IMAGE_WEB = node:16
8+
IMAGE_NAME = gva
9+
REPOSITORY = registry.cn-hangzhou.aliyuncs.com/${IMAGE_NAME}
10+
11+
ifeq ($(TAGS_OPT),)
12+
TAGS_OPT = 2.5.0b
13+
else
14+
endif
15+
16+
#容器环境前后端共同打包
17+
build: build-web build-server
18+
docker run --name build-local --rm -v $(shell pwd):/go/src/${PROJECT_NAME} -w /go/src/${PROJECT_NAME} ${BUILD_IMAGE_SERVER} make build-local
19+
20+
#容器环境打包前端
21+
build-web:
22+
docker run --name build-web-local --rm -v $(shell pwd):/go/src/${PROJECT_NAME} -w /go/src/${PROJECT_NAME} ${BUILD_IMAGE_WEB} make build-web-local
23+
24+
#容器环境打包后端
25+
build-server:
26+
docker run --name build-server-local --rm -v $(shell pwd):/go/src/${PROJECT_NAME} -w /go/src/${PROJECT_NAME} ${BUILD_IMAGE_SERVER} make build-server-local
27+
28+
#构建web镜像
29+
build-image-web:
30+
@cd web/ && docker build -t ${REPOSITORY}/web:${TAGS_OPT} .
31+
32+
#构建server镜像
33+
build-image-server:
34+
@cd server/ && docker build -t ${REPOSITORY}/server:${TAGS_OPT} .
35+
36+
#本地环境打包前后端
37+
build-local:
38+
if [ -d "build" ];then rm -rf build; else echo "OK!"; fi \
39+
&& if [ -f "/.dockerenv" ];then echo "OK!"; else make build-web-local && make build-server-local; fi \
40+
&& mkdir build && cp -r web/dist build/ && cp server/server build/ && cp -r server/resource build/resource
41+
42+
#本地环境打包前端
43+
build-web-local:
44+
@cd web/ && if [ -d "dist" ];then rm -rf dist; else echo "OK!"; fi \
45+
&& yarn config set registry http://mirrors.cloud.tencent.com/npm/ \
46+
&& yarn install && yarn build
47+
48+
#本地环境打包后端
49+
build-server-local:
50+
@cd server/ && if [ -f "server" ];then rm -rf server; else echo "OK!"; fi \
51+
&& go env -w GO111MODULE=on && go env -w GOPROXY=https://goproxy.cn,direct \
52+
&& go env -w CGO_ENABLED=0 && go env && go mod tidy \
53+
&& go build -ldflags "-B 0x$(shell head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -X main.Version=${TAGS_OPT}" -v
54+
55+
#打包前后端二合一镜像
56+
image: build
57+
docker build -t ${REPOSITORY}/all-one:${TAGS_OPT} .
58+
59+
#尝鲜版
60+
images: build build-image-web build-image-server
61+
docker build -t ${REPOSITORY}/all:${TAGS_OPT} .

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232

3333
[交流社区](https://support.qq.com/products/371961)
3434

35+
[插件市场](https://plugin.gin-vue-admin.com/)
36+
3537
# 重要提示
3638

3739
1.本项目从起步到开发到部署均有文档和详细视频教程

docker-compose-dev.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ services:
2323
- '8080:8080'
2424
depends_on:
2525
- server
26-
working_dir: /gva-web # 如果docker 设置了workdir 则此处不需要设置
26+
working_dir: /web # 如果docker 设置了workdir 则此处不需要设置
2727
#若网络不太好,请自行换源,如下
2828
#command: bash -c "yarn config set registry https://registry.npm.taobao.org --global && yarn install && yarn serve"
2929
command: bash -c "yarn install && yarn serve"
3030
volumes:
31-
- ./web:/gva-web
31+
- ./web:/web
3232
networks:
3333
network:
3434
ipv4_address: 177.7.0.11
@@ -44,8 +44,8 @@ services:
4444
- mysql
4545
- redis
4646
volumes:
47-
- ./server:/gva-server
48-
working_dir: /gva-server # 如果docker 设置了workdir 则此处不需要设置
47+
- ./server:/server
48+
working_dir: /server # 如果docker 设置了workdir 则此处不需要设置
4949
command: bash -c "go env -w GOPROXY=https://goproxy.cn,direct && go mod tidy && go run main.go"
5050
links:
5151
- mysql

entrypoint.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
if [ ! -d "/var/lib/mysql/gva" ]; then
3+
mysqld --initialize-insecure --user=mysql --datadir=/var/lib/mysql
4+
mysqld --daemonize --user=mysql
5+
sleep 5s
6+
mysql -uroot -e "create database gva default charset 'utf8' collate 'utf8_bin'; grant all on gva.* to 'root'@'127.0.0.1' identified by '123456'; flush privileges;"
7+
else
8+
mysqld --daemonize --user=mysql
9+
fi
10+
redis-server &
11+
if [ "$1" = "actions" ]; then
12+
cd /opt/gva/server && go run main.go &
13+
cd /opt/gva/web/ && yarn serve &
14+
else
15+
/usr/sbin/nginx &
16+
cd /usr/share/nginx/html/ && ./server &
17+
fi
18+
echo "gva ALL start!!!"
19+
tail -f /dev/null

server/api/v1/example/exa_breakpoint_continue.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
// @Param file formData file true "an example for breakpoint resume, 断点续传示例"
2525
// @Success 200 {object} response.Response{msg=string} "断点续传到服务器"
2626
// @Router /fileUploadAndDownload/breakpointContinue [post]
27-
func (u *FileUploadAndDownloadApi) BreakpointContinue(c *gin.Context) {
27+
func (b *FileUploadAndDownloadApi) BreakpointContinue(c *gin.Context) {
2828
fileMd5 := c.Request.FormValue("fileMd5")
2929
fileName := c.Request.FormValue("fileName")
3030
chunkMd5 := c.Request.FormValue("chunkMd5")
@@ -54,20 +54,20 @@ func (u *FileUploadAndDownloadApi) BreakpointContinue(c *gin.Context) {
5454
response.FailWithMessage("检查md5失败", c)
5555
return
5656
}
57-
err, file := fileUploadAndDownloadService.FindOrCreateFile(fileMd5, fileName, chunkTotal)
57+
file, err := fileUploadAndDownloadService.FindOrCreateFile(fileMd5, fileName, chunkTotal)
5858
if err != nil {
5959
global.GVA_LOG.Error("查找或创建记录失败!", zap.Error(err))
6060
response.FailWithMessage("查找或创建记录失败", c)
6161
return
6262
}
63-
err, pathc := utils.BreakPointContinue(cen, fileName, chunkNumber, chunkTotal, fileMd5)
63+
pathC, err := utils.BreakPointContinue(cen, fileName, chunkNumber, chunkTotal, fileMd5)
6464
if err != nil {
6565
global.GVA_LOG.Error("断点续传失败!", zap.Error(err))
6666
response.FailWithMessage("断点续传失败", c)
6767
return
6868
}
6969

70-
if err = fileUploadAndDownloadService.CreateFileChunk(file.ID, pathc, chunkNumber); err != nil {
70+
if err = fileUploadAndDownloadService.CreateFileChunk(file.ID, pathC, chunkNumber); err != nil {
7171
global.GVA_LOG.Error("创建文件记录失败!", zap.Error(err))
7272
response.FailWithMessage("创建文件记录失败", c)
7373
return
@@ -83,11 +83,11 @@ func (u *FileUploadAndDownloadApi) BreakpointContinue(c *gin.Context) {
8383
// @Param file formData file true "Find the file, 查找文件"
8484
// @Success 200 {object} response.Response{data=exampleRes.FileResponse,msg=string} "查找文件,返回包括文件详情"
8585
// @Router /fileUploadAndDownload/findFile [post]
86-
func (u *FileUploadAndDownloadApi) FindFile(c *gin.Context) {
86+
func (b *FileUploadAndDownloadApi) FindFile(c *gin.Context) {
8787
fileMd5 := c.Query("fileMd5")
8888
fileName := c.Query("fileName")
8989
chunkTotal, _ := strconv.Atoi(c.Query("chunkTotal"))
90-
err, file := fileUploadAndDownloadService.FindOrCreateFile(fileMd5, fileName, chunkTotal)
90+
file, err := fileUploadAndDownloadService.FindOrCreateFile(fileMd5, fileName, chunkTotal)
9191
if err != nil {
9292
global.GVA_LOG.Error("查找失败!", zap.Error(err))
9393
response.FailWithMessage("查找失败", c)
@@ -107,7 +107,7 @@ func (u *FileUploadAndDownloadApi) FindFile(c *gin.Context) {
107107
func (b *FileUploadAndDownloadApi) BreakpointContinueFinish(c *gin.Context) {
108108
fileMd5 := c.Query("fileMd5")
109109
fileName := c.Query("fileName")
110-
err, filePath := utils.MakeFile(fileName, fileMd5)
110+
filePath, err := utils.MakeFile(fileName, fileMd5)
111111
if err != nil {
112112
global.GVA_LOG.Error("文件创建失败!", zap.Error(err))
113113
response.FailWithDetailed(exampleRes.FilePathResponse{FilePath: filePath}, "文件创建失败", c)
@@ -124,15 +124,15 @@ func (b *FileUploadAndDownloadApi) BreakpointContinueFinish(c *gin.Context) {
124124
// @Param file formData file true "删除缓存切片"
125125
// @Success 200 {object} response.Response{msg=string} "删除切片"
126126
// @Router /fileUploadAndDownload/removeChunk [post]
127-
func (u *FileUploadAndDownloadApi) RemoveChunk(c *gin.Context) {
127+
func (b *FileUploadAndDownloadApi) RemoveChunk(c *gin.Context) {
128128
var file example.ExaFile
129-
c.ShouldBindJSON(&file)
129+
_ = c.ShouldBindJSON(&file)
130130
err := utils.RemoveChunk(file.FileMd5)
131131
if err != nil {
132132
global.GVA_LOG.Error("缓存切片删除失败!", zap.Error(err))
133133
return
134134
}
135-
err = fileUploadAndDownloadService.DeleteFileChunk(file.FileMd5, file.FileName, file.FilePath)
135+
err = fileUploadAndDownloadService.DeleteFileChunk(file.FileMd5, file.FilePath)
136136
if err != nil {
137137
global.GVA_LOG.Error(err.Error(), zap.Error(err))
138138
response.FailWithMessage(err.Error(), c)

server/api/v1/example/exa_customer.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func (e *CustomerApi) GetExaCustomer(c *gin.Context) {
103103
response.FailWithMessage(err.Error(), c)
104104
return
105105
}
106-
err, data := customerService.GetExaCustomer(customer.ID)
106+
data, err := customerService.GetExaCustomer(customer.ID)
107107
if err != nil {
108108
global.GVA_LOG.Error(global.Translate("general.getDataFail"), zap.Error(err))
109109
response.FailWithMessage("general.getDataFailErr", c)
@@ -127,7 +127,7 @@ func (e *CustomerApi) GetExaCustomerList(c *gin.Context) {
127127
response.FailWithMessage(err.Error(), c)
128128
return
129129
}
130-
err, customerList, total := customerService.GetCustomerInfoList(utils.GetUserAuthorityId(c), pageInfo)
130+
customerList, total, err := customerService.GetCustomerInfoList(utils.GetUserAuthorityId(c), pageInfo)
131131
if err != nil {
132132
global.GVA_LOG.Error(global.Translate("general.getDataFail"), zap.Error(err))
133133
response.FailWithMessage("general.getDataFailErr"+" "+err.Error(), c)

server/api/v1/example/exa_file_upload_download.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ type FileUploadAndDownloadApi struct{}
2020
// @Param file formData file true "上传文件示例"
2121
// @Success 200 {object} response.Response{data=exampleRes.ExaFileResponse,msg=string} "上传文件示例,返回包括文件详情"
2222
// @Router /fileUploadAndDownload/upload [post]
23-
func (u *FileUploadAndDownloadApi) UploadFile(c *gin.Context) {
23+
func (b *FileUploadAndDownloadApi) UploadFile(c *gin.Context) {
2424
var file example.ExaFileUploadAndDownload
2525
noSave := c.DefaultQuery("noSave", "0")
2626
_, header, err := c.Request.FormFile("file")
@@ -29,7 +29,7 @@ func (u *FileUploadAndDownloadApi) UploadFile(c *gin.Context) {
2929
response.FailWithMessage("接收文件失败", c)
3030
return
3131
}
32-
err, file = fileUploadAndDownloadService.UploadFile(header, noSave) // 文件上传后拿到文件路径
32+
file, err = fileUploadAndDownloadService.UploadFile(header, noSave) // 文件上传后拿到文件路径
3333
if err != nil {
3434
global.GVA_LOG.Error("修改数据库链接失败!", zap.Error(err))
3535
response.FailWithMessage("修改数据库链接失败", c)
@@ -39,7 +39,7 @@ func (u *FileUploadAndDownloadApi) UploadFile(c *gin.Context) {
3939
}
4040

4141
// EditFileName 编辑文件名或者备注
42-
func (u *FileUploadAndDownloadApi) EditFileName(c *gin.Context) {
42+
func (b *FileUploadAndDownloadApi) EditFileName(c *gin.Context) {
4343
var file example.ExaFileUploadAndDownload
4444
_ = c.ShouldBindJSON(&file)
4545
if err := fileUploadAndDownloadService.EditFileName(file); err != nil {
@@ -57,7 +57,7 @@ func (u *FileUploadAndDownloadApi) EditFileName(c *gin.Context) {
5757
// @Param data body example.ExaFileUploadAndDownload true "传入文件里面id即可"
5858
// @Success 200 {object} response.Response{msg=string} "删除文件"
5959
// @Router /fileUploadAndDownload/deleteFile [post]
60-
func (u *FileUploadAndDownloadApi) DeleteFile(c *gin.Context) {
60+
func (b *FileUploadAndDownloadApi) DeleteFile(c *gin.Context) {
6161
var file example.ExaFileUploadAndDownload
6262
_ = c.ShouldBindJSON(&file)
6363
if err := fileUploadAndDownloadService.DeleteFile(file); err != nil {
@@ -76,10 +76,10 @@ func (u *FileUploadAndDownloadApi) DeleteFile(c *gin.Context) {
7676
// @Param data body request.PageInfo true "页码, 每页大小"
7777
// @Success 200 {object} response.Response{data=response.PageResult,msg=string} "分页文件列表,返回包括列表,总数,页码,每页数量"
7878
// @Router /fileUploadAndDownload/getFileList [post]
79-
func (u *FileUploadAndDownloadApi) GetFileList(c *gin.Context) {
79+
func (b *FileUploadAndDownloadApi) GetFileList(c *gin.Context) {
8080
var pageInfo request.PageInfo
8181
_ = c.ShouldBindJSON(&pageInfo)
82-
err, list, total := fileUploadAndDownloadService.GetFileRecordInfoList(pageInfo)
82+
list, total, err := fileUploadAndDownloadService.GetFileRecordInfoList(pageInfo)
8383
if err != nil {
8484
global.GVA_LOG.Error(global.Translate("general.getDataFail"), zap.Error(err))
8585
response.FailWithMessage("general.getDataFailErr", c)

server/api/v1/system/sys_api.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func (s *SystemApiApi) GetApiList(c *gin.Context) {
7676
response.FailWithMessage(err.Error(), c)
7777
return
7878
}
79-
if err, list, total := apiService.GetAPIInfoList(pageInfo.SysApi, pageInfo.PageInfo, pageInfo.OrderKey, pageInfo.Desc); err != nil {
79+
if list, total, err := apiService.GetAPIInfoList(pageInfo.SysApi, pageInfo.PageInfo, pageInfo.OrderKey, pageInfo.Desc); err != nil {
8080
global.GVA_LOG.Error(global.Translate("general.getDataFail"), zap.Error(err))
8181
response.FailWithMessage(global.Translate("general.getDataFailErr"), c)
8282
} else {
@@ -89,7 +89,6 @@ func (s *SystemApiApi) GetApiList(c *gin.Context) {
8989
}
9090
}
9191

92-
// todo
9392
// @Tags SysApi
9493
// @Summary 根据id获取api
9594
// @Security ApiKeyAuth
@@ -105,12 +104,12 @@ func (s *SystemApiApi) GetApiById(c *gin.Context) {
105104
response.FailWithMessage(err.Error(), c)
106105
return
107106
}
108-
err, api := apiService.GetApiById(idInfo.ID)
107+
api, err := apiService.GetApiById(idInfo.ID)
109108
if err != nil {
110109
global.GVA_LOG.Error(global.Translate("general.getDataFail"), zap.Error(err))
111110
response.FailWithMessage(global.Translate("general.getDataFailErr"), c)
112111
} else {
113-
response.OkWithData(systemRes.SysAPIResponse{Api: api}, c)
112+
response.OkWithDetailed(systemRes.SysAPIResponse{Api: api}, "获取成功", c)
114113
}
115114
}
116115

@@ -145,7 +144,7 @@ func (s *SystemApiApi) UpdateApi(c *gin.Context) {
145144
// @Success 200 {object} response.Response{data=systemRes.SysAPIListResponse,msg=string} "获取所有的Api 不分页,返回包括api列表"
146145
// @Router /api/getAllApis [post]
147146
func (s *SystemApiApi) GetAllApis(c *gin.Context) {
148-
if err, apis := apiService.GetAllApis(); err != nil {
147+
if apis, err := apiService.GetAllApis(); err != nil {
149148
global.GVA_LOG.Error(global.Translate("general.getDataFail"), zap.Error(err))
150149
response.FailWithMessage(global.Translate("general.getDataFailErr"), c)
151150
} else {

server/api/v1/system/sys_authority.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func (a *AuthorityApi) CreateAuthority(c *gin.Context) {
3030
response.FailWithMessage(err.Error(), c)
3131
return
3232
}
33-
if err, authBack := authorityService.CreateAuthority(authority); err != nil {
33+
if authBack, err := authorityService.CreateAuthority(authority); err != nil {
3434
global.GVA_LOG.Error(global.Translate("general.creationFail"), zap.Error(err))
3535
response.FailWithMessage(global.Translate("general.creationFailErr")+" "+err.Error(), c)
3636
} else {
@@ -59,7 +59,7 @@ func (a *AuthorityApi) CopyAuthority(c *gin.Context) {
5959
response.FailWithMessage(err.Error(), c)
6060
return
6161
}
62-
if err, authBack := authorityService.CopyAuthority(copyInfo); err != nil {
62+
if authBack, err := authorityService.CopyAuthority(copyInfo); err != nil {
6363
global.GVA_LOG.Error(global.Translate("general.copyFail"), zap.Error(err))
6464
response.FailWithMessage(global.Translate("general.copyFailErr")+" "+err.Error(), c)
6565
} else {
@@ -105,7 +105,7 @@ func (a *AuthorityApi) UpdateAuthority(c *gin.Context) {
105105
response.FailWithMessage(err.Error(), c)
106106
return
107107
}
108-
if err, authority := authorityService.UpdateAuthority(auth); err != nil {
108+
if authority, err := authorityService.UpdateAuthority(auth); err != nil {
109109
global.GVA_LOG.Error(global.Translate("general.updateFail"), zap.Error(err))
110110
response.FailWithMessage(global.Translate("general.updateFailErr")+" "+err.Error(), c)
111111
} else {
@@ -128,7 +128,7 @@ func (a *AuthorityApi) GetAuthorityList(c *gin.Context) {
128128
response.FailWithMessage(err.Error(), c)
129129
return
130130
}
131-
if err, list, total := authorityService.GetAuthorityInfoList(pageInfo); err != nil {
131+
if list, total, err := authorityService.GetAuthorityInfoList(pageInfo); err != nil {
132132
global.GVA_LOG.Error(global.Translate("general.getDataFail"), zap.Error(err))
133133
response.FailWithMessage(global.Translate("general.getDataFailErr")+" "+err.Error(), c)
134134
} else {

server/api/v1/system/sys_authority_btn.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type AuthorityBtnApi struct{}
2121
func (a *AuthorityBtnApi) GetAuthorityBtn(c *gin.Context) {
2222
var req request.SysAuthorityBtnReq
2323
_ = c.ShouldBindJSON(&req)
24-
if err, res := authorityBtnService.GetAuthorityBtn(req); err != nil {
24+
if res, err := authorityBtnService.GetAuthorityBtn(req); err != nil {
2525
global.GVA_LOG.Error("查询失败!", zap.Error(err))
2626
response.FailWithMessage("查询失败", c)
2727
} else {

0 commit comments

Comments
 (0)