From 8b93ede95975c1560a75e8d12ef90055c32b40e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?piexlMax=28=E5=A5=87=E6=B7=BC?= Date: Wed, 25 Dec 2024 13:51:02 +0800 Subject: [PATCH 1/8] =?UTF-8?q?fixed:=20=E4=BF=AE=E5=A4=8Dsql=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E6=97=A0=E6=B3=95=E5=8A=A0=E5=85=A5=E7=BB=9F=E4=B8=80?= =?UTF-8?q?zap=E8=BE=93=E5=87=BA=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/initialize/internal/gorm.go | 4 +--- server/initialize/internal/gorm_logger_writer.go | 16 ++++++++-------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/server/initialize/internal/gorm.go b/server/initialize/internal/gorm.go index dcf388bea2..ebf5526c3c 100644 --- a/server/initialize/internal/gorm.go +++ b/server/initialize/internal/gorm.go @@ -6,8 +6,6 @@ import ( "gorm.io/gorm" "gorm.io/gorm/logger" "gorm.io/gorm/schema" - "log" - "os" "time" ) @@ -34,7 +32,7 @@ func (g *_gorm) Config(prefix string, singular bool) *gorm.Config { general = global.GVA_CONFIG.Mysql.GeneralDB } return &gorm.Config{ - Logger: logger.New(NewWriter(general, log.New(os.Stdout, "\r\n", log.LstdFlags)), logger.Config{ + Logger: logger.New(NewWriter(general), logger.Config{ SlowThreshold: 200 * time.Millisecond, LogLevel: general.LogLevel(), Colorful: true, diff --git a/server/initialize/internal/gorm_logger_writer.go b/server/initialize/internal/gorm_logger_writer.go index 955503d873..c6e2e72fa2 100644 --- a/server/initialize/internal/gorm_logger_writer.go +++ b/server/initialize/internal/gorm_logger_writer.go @@ -3,7 +3,7 @@ package internal import ( "fmt" "github.com/flipped-aurora/gin-vue-admin/server/config" - "go.uber.org/zap" + "github.com/flipped-aurora/gin-vue-admin/server/global" "gorm.io/gorm/logger" ) @@ -12,8 +12,8 @@ type Writer struct { writer logger.Writer } -func NewWriter(config config.GeneralDB, writer logger.Writer) *Writer { - return &Writer{config: config, writer: writer} +func NewWriter(config config.GeneralDB) *Writer { + return &Writer{config: config} } // Printf 格式化打印日志 @@ -21,15 +21,15 @@ func (c *Writer) Printf(message string, data ...any) { if c.config.LogZap { switch c.config.LogLevel() { case logger.Silent: - zap.L().Debug(fmt.Sprintf(message, data...)) + global.GVA_LOG.Debug(fmt.Sprintf(message, data...)) case logger.Error: - zap.L().Error(fmt.Sprintf(message, data...)) + global.GVA_LOG.Error(fmt.Sprintf(message, data...)) case logger.Warn: - zap.L().Warn(fmt.Sprintf(message, data...)) + global.GVA_LOG.Warn(fmt.Sprintf(message, data...)) case logger.Info: - zap.L().Info(fmt.Sprintf(message, data...)) + global.GVA_LOG.Info(fmt.Sprintf(message, data...)) default: - zap.L().Info(fmt.Sprintf(message, data...)) + global.GVA_LOG.Info(fmt.Sprintf(message, data...)) } return } From d19e446416421e99baf63b519c298f567757333e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?piexlMax=28=E5=A5=87=E6=B7=BC?= Date: Thu, 26 Dec 2024 15:16:58 +0800 Subject: [PATCH 2/8] =?UTF-8?q?fixed:=20=E4=BF=AE=E5=A4=8D=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E5=88=9B=E5=BB=BA=E6=96=B0=E5=86=85=E5=AE=B9=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/initialize/internal/gorm_logger_writer.go | 1 - 1 file changed, 1 deletion(-) diff --git a/server/initialize/internal/gorm_logger_writer.go b/server/initialize/internal/gorm_logger_writer.go index c6e2e72fa2..d148e86035 100644 --- a/server/initialize/internal/gorm_logger_writer.go +++ b/server/initialize/internal/gorm_logger_writer.go @@ -33,5 +33,4 @@ func (c *Writer) Printf(message string, data ...any) { } return } - c.writer.Printf(message, data...) } From 21237f8be1c87b669912766d326fffb9a1d2d2ad Mon Sep 17 00:00:00 2001 From: "Feng.YJ" <32027253+huiyifyj@users.noreply.github.com> Date: Mon, 30 Dec 2024 17:08:17 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E6=B3=A8=E9=87=8A=E4=BF=AE=E6=94=B9=20(#1973?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 模板文件文档注释修改 * 补充模板相关修改 --- server/resource/package/server/api/api.go.tpl | 2 +- server/resource/plugin/server/api/api.go.template | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/resource/package/server/api/api.go.tpl b/server/resource/package/server/api/api.go.tpl index 83b364decf..9495e88e92 100644 --- a/server/resource/package/server/api/api.go.tpl +++ b/server/resource/package/server/api/api.go.tpl @@ -130,7 +130,7 @@ func ({{.Abbreviation}}Api *{{.StructName}}Api) Update{{.StructName}}(c *gin.Con // @Security ApiKeyAuth // @Accept application/json // @Produce application/json -// @Param data query {{.PrimaryField.FieldType}} true "用id查询{{.Description}}" +// @Param {{.PrimaryField.FieldJson}} query {{.PrimaryField.FieldType}} true "用id查询{{.Description}}" // @Success 200 {object} response.Response{data={{.Package}}.{{.StructName}},msg=string} "查询成功" // @Router /{{.Abbreviation}}/find{{.StructName}} [get] func ({{.Abbreviation}}Api *{{.StructName}}Api) Find{{.StructName}}(c *gin.Context) { diff --git a/server/resource/plugin/server/api/api.go.template b/server/resource/plugin/server/api/api.go.template index a5ee38c6a0..683824081c 100644 --- a/server/resource/plugin/server/api/api.go.template +++ b/server/resource/plugin/server/api/api.go.template @@ -130,7 +130,7 @@ func (a *{{.Abbreviation}}) Update{{.StructName}}(c *gin.Context) { // @Security ApiKeyAuth // @Accept application/json // @Produce application/json -// @Param data query model.{{.StructName}} true "用id查询{{.Description}}" +// @Param {{.PrimaryField.FieldJson}} query {{.PrimaryField.FieldType}} true "用id查询{{.Description}}" // @Success 200 {object} response.Response{data=model.{{.StructName}},msg=string} "查询成功" // @Router /{{.Abbreviation}}/find{{.StructName}} [get] func (a *{{.Abbreviation}}) Find{{.StructName}}(c *gin.Context) { From 1743c763d2ea21fd6baed108ab64a1dd9ff32d30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?piexlMax=28=E5=A5=87=E6=B7=BC?= Date: Tue, 31 Dec 2024 10:48:50 +0800 Subject: [PATCH 4/8] =?UTF-8?q?feat:=20gorm=E7=9A=84debug=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E6=97=A0=E8=AE=BA=E6=98=AF=E5=90=A6=E5=BC=80=E5=90=AF?= =?UTF-8?q?=E4=BA=86zap=E9=83=BD=E9=9C=80=E8=A6=81=E8=BE=93=E5=87=BA?= =?UTF-8?q?=E5=88=B0=E6=8E=A7=E5=88=B6=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/initialize/internal/gorm_logger_writer.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/initialize/internal/gorm_logger_writer.go b/server/initialize/internal/gorm_logger_writer.go index d148e86035..9774c96350 100644 --- a/server/initialize/internal/gorm_logger_writer.go +++ b/server/initialize/internal/gorm_logger_writer.go @@ -18,6 +18,11 @@ func NewWriter(config config.GeneralDB) *Writer { // Printf 格式化打印日志 func (c *Writer) Printf(message string, data ...any) { + + // 当有日志时候均需要输出到控制台 + fmt.Printf(message, data...) + + // 当开启了zap的情况,会打印到日志记录 if c.config.LogZap { switch c.config.LogLevel() { case logger.Silent: From afe6b234cf557041cb2073c4fc69416dd0f3792e Mon Sep 17 00:00:00 2001 From: Leslie Date: Tue, 31 Dec 2024 11:38:04 +0800 Subject: [PATCH 5/8] =?UTF-8?q?fixed:=20=E4=BF=AE=E5=A4=8D=E9=80=92?= =?UTF-8?q?=E5=BD=92=E8=8E=B7=E5=8F=96=E8=A7=92=E8=89=B2=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=BC=BA=E5=A4=B1=E9=97=AE=E9=A2=98=20(#1974?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/service/system/sys_authority.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/service/system/sys_authority.go b/server/service/system/sys_authority.go index 087da6a4e5..e5a5fcbf11 100644 --- a/server/service/system/sys_authority.go +++ b/server/service/system/sys_authority.go @@ -224,7 +224,10 @@ func (authorityService *AuthorityService) GetStructAuthorityList(authorityID uin if len(authorities) > 0 { for k := range authorities { list = append(list, authorities[k].AuthorityId) - _, err = authorityService.GetStructAuthorityList(authorities[k].AuthorityId) + childrenList, err := authorityService.GetStructAuthorityList(authorities[k].AuthorityId) + if err == nil { + list = append(list, childrenList...) + } } } if *auth.ParentId == 0 { From 8c47d2b1791b921c1a2d2fabb2746080e7810264 Mon Sep 17 00:00:00 2001 From: pixelmaxQM Date: Wed, 1 Jan 2025 14:48:15 +0800 Subject: [PATCH 6/8] =?UTF-8?q?feat:=20=E6=8F=90=E4=BA=A4=E5=8F=91?= =?UTF-8?q?=E5=B8=832.7.8=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/core/server.go | 2 +- server/docs/docs.go | 2 +- server/main.go | 2 +- web/package.json | 2 +- web/src/core/config.js | 2 +- web/src/core/gin-vue-admin.js | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/server/core/server.go b/server/core/server.go index 71a710299e..3cbe33dc43 100644 --- a/server/core/server.go +++ b/server/core/server.go @@ -39,7 +39,7 @@ func RunWindowsServer() { fmt.Printf(` 欢迎使用 gin-vue-admin - 当前版本:v2.7.8-beta1 + 当前版本:v2.7.8 加群方式:微信号:shouzi_1994 QQ群:470239250 项目地址:https://github.com/flipped-aurora/gin-vue-admin 插件市场:https://plugin.gin-vue-admin.com diff --git a/server/docs/docs.go b/server/docs/docs.go index 4ae77cef93..2826291942 100644 --- a/server/docs/docs.go +++ b/server/docs/docs.go @@ -9080,7 +9080,7 @@ const docTemplate = `{ // SwaggerInfo holds exported Swagger Info so clients can modify it var SwaggerInfo = &swag.Spec{ - Version: "v2.7.8-beta1", + Version: "v2.7.8", Host: "", BasePath: "", Schemes: []string{}, diff --git a/server/main.go b/server/main.go index 57870865f9..226565f902 100644 --- a/server/main.go +++ b/server/main.go @@ -21,7 +21,7 @@ import ( // @Tag.Description 用户 // @title Gin-Vue-Admin Swagger API接口文档 -// @version v2.7.8-beta1 +// @version v2.7.8 // @description 使用gin+vue进行极速开发的全栈开发基础平台 // @securityDefinitions.apikey ApiKeyAuth // @in header diff --git a/web/package.json b/web/package.json index 02180cbb34..29b85a6d64 100644 --- a/web/package.json +++ b/web/package.json @@ -1,6 +1,6 @@ { "name": "gin-vue-admin", - "version": "2.7.8-beta1", + "version": "2.7.8", "private": true, "scripts": { "serve": "node openDocument.js && vite --host --mode development", diff --git a/web/src/core/config.js b/web/src/core/config.js index 9a03f26b00..c672a2d26d 100644 --- a/web/src/core/config.js +++ b/web/src/core/config.js @@ -17,7 +17,7 @@ export const viteLogo = (env) => { `> 欢迎使用Gin-Vue-Admin,开源地址:https://github.com/flipped-aurora/gin-vue-admin` ) ) - console.log(greenText(`> 当前版本:vv2.7.8-beta1`)) + console.log(greenText(`> 当前版本:vv2.7.8`)) console.log(greenText(`> 加群方式:微信:shouzi_1994 QQ群:470239250`)) console.log( greenText(`> 项目地址:https://github.com/flipped-aurora/gin-vue-admin`) diff --git a/web/src/core/gin-vue-admin.js b/web/src/core/gin-vue-admin.js index ae71f1b7f9..0280e0a75a 100644 --- a/web/src/core/gin-vue-admin.js +++ b/web/src/core/gin-vue-admin.js @@ -10,7 +10,7 @@ export default { register(app) console.log(` 欢迎使用 Gin-Vue-Admin - 当前版本:v2.7.8-beta1 + 当前版本:v2.7.8 加群方式:微信:shouzi_1994 QQ群:622360840 项目地址:https://github.com/flipped-aurora/gin-vue-admin 插件市场:https://plugin.gin-vue-admin.com From fe2b846dbce51a6c25087f22e62ed50ca950af5b Mon Sep 17 00:00:00 2001 From: pixelmaxQM Date: Wed, 1 Jan 2025 14:49:01 +0800 Subject: [PATCH 7/8] =?UTF-8?q?feat:=20=E6=8F=90=E4=BA=A4=E5=8F=91?= =?UTF-8?q?=E5=B8=832.7.8=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/core/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/core/config.js b/web/src/core/config.js index c672a2d26d..9c0137a7ce 100644 --- a/web/src/core/config.js +++ b/web/src/core/config.js @@ -17,7 +17,7 @@ export const viteLogo = (env) => { `> 欢迎使用Gin-Vue-Admin,开源地址:https://github.com/flipped-aurora/gin-vue-admin` ) ) - console.log(greenText(`> 当前版本:vv2.7.8`)) + console.log(greenText(`> 当前版本:v2.7.8`)) console.log(greenText(`> 加群方式:微信:shouzi_1994 QQ群:470239250`)) console.log( greenText(`> 项目地址:https://github.com/flipped-aurora/gin-vue-admin`) From 831bd61e0207d6228a774f12d996430c15a4710e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8D=AF=E8=A6=81=E5=90=83?= <49603204+yaoyaochil@users.noreply.github.com> Date: Thu, 9 Jan 2025 17:14:39 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E9=A1=B5=E6=A0=B7=E5=BC=8F=20=E8=BF=99?= =?UTF-8?q?=E4=B8=AA=E5=A4=B4=20=E5=BE=97=E5=BC=80=20(#1977)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 更新个人信息页样式 --- web/src/api/fileUploadAndDownload.js | 10 + web/src/components/Avatar/ProfileAvatar.vue | 120 ++++ web/src/view/person/person.vue | 608 ++++++++++++-------- 3 files changed, 510 insertions(+), 228 deletions(-) create mode 100644 web/src/components/Avatar/ProfileAvatar.vue diff --git a/web/src/api/fileUploadAndDownload.js b/web/src/api/fileUploadAndDownload.js index 2bff5bb47e..0f260b639c 100644 --- a/web/src/api/fileUploadAndDownload.js +++ b/web/src/api/fileUploadAndDownload.js @@ -55,3 +55,13 @@ export const importURL = (data) => { data }) } + + +// 上传文件 暂时用于头像上传 +export const uploadFile = (data) => { + return service({ + url: "/fileUploadAndDownload/upload", + method: "post", + data, + }); +}; \ No newline at end of file diff --git a/web/src/components/Avatar/ProfileAvatar.vue b/web/src/components/Avatar/ProfileAvatar.vue new file mode 100644 index 0000000000..f0fd1180db --- /dev/null +++ b/web/src/components/Avatar/ProfileAvatar.vue @@ -0,0 +1,120 @@ + + + + + \ No newline at end of file diff --git a/web/src/view/person/person.vue b/web/src/view/person/person.vue index 84e9356b71..f146483905 100644 --- a/web/src/view/person/person.vue +++ b/web/src/view/person/person.vue @@ -1,171 +1,226 @@ - - - - + + + + + + - -
+ +
- {{ - time > 0 ? `(${time}s)后重新获取` : '获取验证码' - }} + > + + + + {{ time > 0 ? `${time}s` : '获取验证码' }} +
- - - - + + + + + + - -
+ +
+ > + + {{ - emailTime > 0 ? `(${emailTime}s)后重新获取` : '获取验证码' - }} + {{ emailTime > 0 ? `${emailTime}s` : '获取验证码' }} +
@@ -258,16 +332,22 @@