From d1983b6e17c79ab3c97ad55313c5acbed645352e Mon Sep 17 00:00:00 2001 From: qimiao <303176530@qq.com> Date: Thu, 9 Sep 2021 17:56:23 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=8C=96=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E8=B7=AF=E5=BE=84=E7=94=B1http=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E4=B8=BAhttps=20=E4=BF=AE=E5=A4=8D=E5=AE=89=E5=85=A8=E6=80=A7?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/model/system/request/sys_user.go | 2 +- server/model/system/sys_user.go | 18 +++++++++--------- server/source/admin.go | 4 ++-- server/source/file.go | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/server/model/system/request/sys_user.go b/server/model/system/request/sys_user.go index 84ab1ef4..c03807e1 100644 --- a/server/model/system/request/sys_user.go +++ b/server/model/system/request/sys_user.go @@ -5,7 +5,7 @@ type Register struct { Username string `json:"userName"` Password string `json:"passWord"` NickName string `json:"nickName" gorm:"default:'QMPlusUser'"` - HeaderImg string `json:"headerImg" gorm:"default:'http://www.henrongyi.top/avatar/lufu.jpg'"` + HeaderImg string `json:"headerImg" gorm:"default:'https://qmplusimg.henrongyi.top/gva_header.jpg'"` AuthorityId string `json:"authorityId" gorm:"default:888"` AuthorityIds []string `json:"authorityIds"` } diff --git a/server/model/system/sys_user.go b/server/model/system/sys_user.go index c7fbf90e..40678cd4 100644 --- a/server/model/system/sys_user.go +++ b/server/model/system/sys_user.go @@ -7,15 +7,15 @@ import ( type SysUser struct { global.GVA_MODEL - UUID uuid.UUID `json:"uuid" gorm:"comment:用户UUID"` // 用户UUID - Username string `json:"userName" gorm:"comment:用户登录名"` // 用户登录名 - Password string `json:"-" gorm:"comment:用户登录密码"` // 用户登录密码 - NickName string `json:"nickName" gorm:"default:系统用户;comment:用户昵称"` // 用户昵称 - SideMode string `json:"sideMode" gorm:"default:dark;comment:用户侧边主题"` // 用户侧边主题 - HeaderImg string `json:"headerImg" gorm:"default:http://qmplusimg.henrongyi.top/head.png;comment:用户头像"` // 用户头像 - BaseColor string `json:"baseColor" gorm:"default:#fff;comment:基础颜色"` // 基础颜色 - ActiveColor string `json:"activeColor" gorm:"default:#1890ff;comment:活跃颜色"` // 活跃颜色 - AuthorityId string `json:"authorityId" gorm:"default:888;comment:用户角色ID"` // 用户角色ID + UUID uuid.UUID `json:"uuid" gorm:"comment:用户UUID"` // 用户UUID + Username string `json:"userName" gorm:"comment:用户登录名"` // 用户登录名 + Password string `json:"-" gorm:"comment:用户登录密码"` // 用户登录密码 + NickName string `json:"nickName" gorm:"default:系统用户;comment:用户昵称"` // 用户昵称 + SideMode string `json:"sideMode" gorm:"default:dark;comment:用户侧边主题"` // 用户侧边主题 + HeaderImg string `json:"headerImg" gorm:"default:https://qmplusimg.henrongyi.top/gva_header.jpg;comment:用户头像"` // 用户头像 + BaseColor string `json:"baseColor" gorm:"default:#fff;comment:基础颜色"` // 基础颜色 + ActiveColor string `json:"activeColor" gorm:"default:#1890ff;comment:活跃颜色"` // 活跃颜色 + AuthorityId string `json:"authorityId" gorm:"default:888;comment:用户角色ID"` // 用户角色ID Authority SysAuthority `json:"authority" gorm:"foreignKey:AuthorityId;references:AuthorityId;comment:用户角色"` Authorities []SysAuthority `json:"authorities" gorm:"many2many:sys_user_authority;"` } diff --git a/server/source/admin.go b/server/source/admin.go index 3128acb0..713035a1 100644 --- a/server/source/admin.go +++ b/server/source/admin.go @@ -16,8 +16,8 @@ var Admin = new(admin) type admin struct{} var admins = []system.SysUser{ - {GVA_MODEL: global.GVA_MODEL{ID: 1, CreatedAt: time.Now(), UpdatedAt: time.Now()}, UUID: uuid.NewV4(), Username: "admin", Password: "e10adc3949ba59abbe56e057f20f883e", NickName: "超级管理员", HeaderImg: "http://qmplusimg.henrongyi.top/gva_header.jpg", AuthorityId: "888"}, - {GVA_MODEL: global.GVA_MODEL{ID: 2, CreatedAt: time.Now(), UpdatedAt: time.Now()}, UUID: uuid.NewV4(), Username: "a303176530", Password: "3ec063004a6f31642261936a379fde3d", NickName: "QMPlusUser", HeaderImg: "http://qmplusimg.henrongyi.top/1572075907logo.png", AuthorityId: "9528"}, + {GVA_MODEL: global.GVA_MODEL{ID: 1, CreatedAt: time.Now(), UpdatedAt: time.Now()}, UUID: uuid.NewV4(), Username: "admin", Password: "e10adc3949ba59abbe56e057f20f883e", NickName: "超级管理员", HeaderImg: "https:///qmplusimg.henrongyi.top/gva_header.jpg", AuthorityId: "888"}, + {GVA_MODEL: global.GVA_MODEL{ID: 2, CreatedAt: time.Now(), UpdatedAt: time.Now()}, UUID: uuid.NewV4(), Username: "a303176530", Password: "3ec063004a6f31642261936a379fde3d", NickName: "QMPlusUser", HeaderImg: "https:///qmplusimg.henrongyi.top/1572075907logo.png", AuthorityId: "9528"}, } //@author: [SliverHorn](https://github.com/SliverHorn) diff --git a/server/source/file.go b/server/source/file.go index 59b2db14..964383c6 100644 --- a/server/source/file.go +++ b/server/source/file.go @@ -14,8 +14,8 @@ var File = new(file) type file struct{} var files = []example.ExaFileUploadAndDownload{ - {global.GVA_MODEL{ID: 1, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "10.png", "http://qmplusimg.henrongyi.top/gvalogo.png", "png", "158787308910.png"}, - {global.GVA_MODEL{ID: 2, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "logo.png", "http://qmplusimg.henrongyi.top/1576554439myAvatar.png", "png", "1587973709logo.png"}, + {global.GVA_MODEL{ID: 1, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "10.png", "https://qmplusimg.henrongyi.top/gvalogo.png", "png", "158787308910.png"}, + {global.GVA_MODEL{ID: 2, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "logo.png", "https://qmplusimg.henrongyi.top/1576554439myAvatar.png", "png", "1587973709logo.png"}, } //@author: [SliverHorn](https://github.com/SliverHorn) From 5a59f25df819b7f0e0def823ee79e81971c1f2f4 Mon Sep 17 00:00:00 2001 From: songzhibin97 <718428482@qq.com> Date: Fri, 10 Sep 2021 11:57:27 +0800 Subject: [PATCH 2/6] feat: issues #692 --- server/service/system/sys_auto_code.go | 4 ++++ server/service/system/sys_autocode_history.go | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/server/service/system/sys_auto_code.go b/server/service/system/sys_auto_code.go index d9b4a350..c27c40d6 100644 --- a/server/service/system/sys_auto_code.go +++ b/server/service/system/sys_auto_code.go @@ -154,6 +154,10 @@ func (autoCodeService *AutoCodeService) PreviewTemp(autoCode system.AutoCodeStru //@return: err error func (autoCodeService *AutoCodeService) CreateTemp(autoCode system.AutoCodeStruct, ids ...uint) (err error) { + // 增加判断: 重复创建struct + if autoCode.AutoMoveFile && AutoCodeHistoryServiceApp.Repeat(autoCode.StructName) { + return RepeatErr + } dataList, fileList, needMkdir, err := autoCodeService.getNeedList(&autoCode) if err != nil { return err diff --git a/server/service/system/sys_autocode_history.go b/server/service/system/sys_autocode_history.go index 479e9ff3..c222a004 100644 --- a/server/service/system/sys_autocode_history.go +++ b/server/service/system/sys_autocode_history.go @@ -1,6 +1,7 @@ package system import ( + "errors" "fmt" "path/filepath" "strings" @@ -14,11 +15,20 @@ import ( "go.uber.org/zap" ) +var RepeatErr = errors.New("重复创建") + type AutoCodeHistoryService struct { } var AutoCodeHistoryServiceApp = new(AutoCodeHistoryService) +func (autoCodeHistoryService *AutoCodeHistoryService) Repeat(structName string) bool { + + var count int64 + global.GVA_DB.Model(&system.SysAutoCodeHistory{}).Where("struct_name = ?", structName).Count(&count) + return count > 0 +} + // CreateAutoCodeHistory RouterPath : RouterPath@RouterString;RouterPath2@RouterString2 func (autoCodeHistoryService *AutoCodeHistoryService) CreateAutoCodeHistory(meta, structName, structCNName, autoCodePath string, injectionMeta string, tableName string, apiIds string) error { return global.GVA_DB.Create(&system.SysAutoCodeHistory{ From ad8c27bc0992c30f44991dba9f0d4283c03324f4 Mon Sep 17 00:00:00 2001 From: songzhibin97 <718428482@qq.com> Date: Mon, 13 Sep 2021 11:07:59 +0800 Subject: [PATCH 3/6] =?UTF-8?q?fix:=E9=87=8D=E5=A4=8D=E7=94=9F=E6=88=90?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E5=9B=9E=E6=BB=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/service/system/sys_autocode_history.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/service/system/sys_autocode_history.go b/server/service/system/sys_autocode_history.go index c222a004..4bce5d02 100644 --- a/server/service/system/sys_autocode_history.go +++ b/server/service/system/sys_autocode_history.go @@ -25,7 +25,7 @@ var AutoCodeHistoryServiceApp = new(AutoCodeHistoryService) func (autoCodeHistoryService *AutoCodeHistoryService) Repeat(structName string) bool { var count int64 - global.GVA_DB.Model(&system.SysAutoCodeHistory{}).Where("struct_name = ?", structName).Count(&count) + global.GVA_DB.Model(&system.SysAutoCodeHistory{}).Where("struct_name = ? and flag = 0", structName).Count(&count) return count > 0 } From ecc657d489a167863d3aef22a5157aa225329d14 Mon Sep 17 00:00:00 2001 From: songzhibin97 <718428482@qq.com> Date: Tue, 14 Sep 2021 16:26:55 +0800 Subject: [PATCH 4/6] =?UTF-8?q?feat:jwt=E7=AD=BE=E5=90=8D=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/service/system/sys_initdb.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/service/system/sys_initdb.go b/server/service/system/sys_initdb.go index a0a768e5..45d3b747 100644 --- a/server/service/system/sys_initdb.go +++ b/server/service/system/sys_initdb.go @@ -5,6 +5,8 @@ import ( "fmt" "path/filepath" + uuid "github.com/satori/go.uuid" + "github.com/flipped-aurora/gin-vue-admin/server/config" "github.com/flipped-aurora/gin-vue-admin/server/global" "github.com/flipped-aurora/gin-vue-admin/server/model/example" @@ -33,6 +35,7 @@ func (initDBService *InitDBService) writeConfig(viper *viper.Viper, mysql config for k, v := range cs { viper.Set(k, v) } + viper.Set("jwt.signing-key", uuid.NewV4()) return viper.WriteConfig() } @@ -159,6 +162,7 @@ func (initDBService *InitDBService) InitDB(conf request.InitDB) error { global.GVA_DB = nil return err } + if err = initDBService.writeConfig(global.GVA_VP, MysqlConfig); err != nil { return err } From 4922f6dac736844ecc243dd243839acf5ea4f73f Mon Sep 17 00:00:00 2001 From: SliverHorn Date: Tue, 14 Sep 2021 17:41:21 +0800 Subject: [PATCH 5/6] =?UTF-8?q?fixed:=20#699=20go=20build=20=E6=8A=A5?= =?UTF-8?q?=E9=94=99=20gcc=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/server/Dockerfile b/server/Dockerfile index b7f4b3a4..0e03cd50 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -5,6 +5,7 @@ COPY . . RUN go env -w GO111MODULE=on RUN go env -w GOPROXY=https://goproxy.cn,direct +RUN go env -w CGO_ENABLED=0 RUN go env RUN go mod tidy RUN go build -o server . From fa2b85bade4dbae8bc14d562dd73452c79b91057 Mon Sep 17 00:00:00 2001 From: piexlmax Date: Tue, 14 Sep 2021 19:49:06 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E5=89=8D=E7=AB=AFui=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/resource/template/web/table.vue.tpl | 28 +++++------ web/src/components/upload/image.vue | 11 +++-- web/src/style/main.scss | 40 +++++++++++----- web/src/view/example/customer/customer.vue | 11 ++--- web/src/view/example/excel/excel.vue | 7 +-- web/src/view/example/upload/upload.vue | 48 +++++++++---------- web/src/view/layout/aside/index.vue | 2 +- web/src/view/layout/setting/index.vue | 6 ++- web/src/view/superAdmin/api/api.vue | 30 ++++++------ .../view/superAdmin/authority/authority.vue | 12 ++--- .../superAdmin/authority/components/apis.vue | 2 +- .../superAdmin/authority/components/datas.vue | 11 +++-- .../superAdmin/authority/components/menus.vue | 2 +- .../superAdmin/dictionary/sysDictionary.vue | 10 ++-- .../dictionary/sysDictionaryDetail.vue | 12 ++--- web/src/view/superAdmin/menu/menu.vue | 8 +--- .../operation/sysOperationRecord.vue | 28 +++++------ web/src/view/superAdmin/user/user.vue | 9 +--- web/src/view/systemTools/autoCode/index.vue | 4 +- .../view/systemTools/autoCodeAdmin/index.vue | 14 ++---- web/src/view/systemTools/system/system.vue | 11 ++--- 21 files changed, 149 insertions(+), 157 deletions(-) diff --git a/server/resource/template/web/table.vue.tpl b/server/resource/template/web/table.vue.tpl index 6fd337c0..878830c3 100644 --- a/server/resource/template/web/table.vue.tpl +++ b/server/resource/template/web/table.vue.tpl @@ -21,21 +21,21 @@ {{ end }}{{ end }}{{ end }} - - 查询 - 新增 - -

确定要删除吗?

-
- 取消 - 确定 -
- -
-
+
+ 查询 + 新增 + +

确定要删除吗?

+
+ 取消 + 确定 +
+ +
+
- - + 压缩上传
@@ -53,6 +51,13 @@ export default { }, methods: { beforeImageUpload(file) { + const isJPG = file.type === 'image/jpeg' + const isPng = file.type === 'image/png' + if (!isJPG && !isPng) { + this.$message.error('上传头像图片只能是 jpg或png 格式!') + return false + } + const isRightSize = file.size / 1024 < this.fileSize if (!isRightSize) { // 压缩 diff --git a/web/src/style/main.scss b/web/src/style/main.scss index f5da1cb4..e3418976 100644 --- a/web/src/style/main.scss +++ b/web/src/style/main.scss @@ -653,7 +653,7 @@ li { color: #fff; } .el-menu--inline { - border-left: 5px solid #2c3b41; + // border-left: 5px solid #2c3b41; } } .hideside { @@ -810,9 +810,6 @@ li { padding: 0 15px; border-left: 1px solid #ebeef5; border-right: 1px solid #ebeef5; - .demo-form-inline { - margin-bottom: 10px; - } } // table @@ -892,6 +889,14 @@ li { // upload-demo .upload-demo, .upload { + .upload-box{ + margin-bottom: 12px; + display: flex; + justify-content: flex-end; + .upload-btn{ + margin-left: 12px; + } + } background-color: $white-bg; padding: 15px; .el-upload-list__item-status-label { @@ -1019,6 +1024,7 @@ li { .main-cont.el-main { background-color: $bg-main; .menu-total { + cursor: pointer; font-size: 22px; color: #838383; margin-top: 16px; @@ -1042,7 +1048,12 @@ li { height: $height-nav-scroll; border: none; border-left: 1px solid $border-color; + border-right: 1px solid $border-color; + +.el-tabs__item{ + border-left: 0px solid $border-color; + } } + .el-tabs__item.is-active { background-color: rgba(64, 158, 255, .08); } @@ -1145,10 +1156,6 @@ $mainHight: 100vh; } } -.el-scrollbar__wrap { - padding-bottom: 17px; -} - .layout-cont { .right-box { height: $height-header; @@ -1174,10 +1181,6 @@ $mainHight: 100vh; background-color: #fff; padding: 0; } - .fl-right { - // height: $height-header; - // line-height: $height-header; - } &.el-main { overflow: auto; background: #fff; @@ -1186,6 +1189,8 @@ $mainHight: 100vh; overflow: visible; position: relative; .menu-total { + margin-left:6px; + cursor: pointer; float: left; margin-top: 10px; width: 30px; @@ -1201,7 +1206,7 @@ $mainHight: 100vh; } } .el-menu-vertical { - height: calc(100vh - 64px) !important; + height: calc(100vh - 60px) !important; visibility: auto; &:not(.el-menu--collapse) { width: 220px; @@ -1397,6 +1402,15 @@ $mainHight: 100vh; } } +.gva-btn-list{ + margin-bottom: 12px; + display: flex; + justify-content: flex-end; + .el-button+.el-button{ + margin-left: 12px; + } +} + ::-webkit-scrollbar-track-piece { background-color: #f8f8f8; } diff --git a/web/src/view/example/customer/customer.vue b/web/src/view/example/customer/customer.vue index c1043d89..942e59eb 100644 --- a/web/src/view/example/customer/customer.vue +++ b/web/src/view/example/customer/customer.vue @@ -1,11 +1,9 @@