From eaa97e7eb859411d1e93caf0c333ee7f9d211796 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A5=87=E6=B7=BC=EF=BC=88piexlmax?= <303176530@qq.com> Date: Sun, 10 Apr 2022 22:01:36 +0800 Subject: [PATCH 1/9] Add upload (#1016) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [style] 修改右上角图标,选择统一风格的iconfont * [fix] fix webfont tree in readme file * (fix) 菜单编辑的时候,icon不居中 * 更新为使用组件 * 媒体库增加 普通上传、压缩上传按钮,方便媒体库直接上传图片 * 普通上传组件 * 增加数据类型切换后的的校验,避免使用错误的查询条件和字典条件。 Co-authored-by: bypanghu Co-authored-by: tesun <36953434+tesun@users.noreply.github.com> --- web/src/components/chooseImg/index.vue | 20 + web/src/components/upload/common.vue | 70 ++ web/src/view/example/upload/upload.vue | 58 +- web/src/view/superAdmin/menu/icon.vue | 600 +++++++++--------- .../autoCode/component/fieldDialog.vue | 7 + 5 files changed, 411 insertions(+), 344 deletions(-) create mode 100644 web/src/components/upload/common.vue diff --git a/web/src/components/chooseImg/index.vue b/web/src/components/chooseImg/index.vue index 64d830013..30b80dec2 100644 --- a/web/src/components/chooseImg/index.vue +++ b/web/src/components/chooseImg/index.vue @@ -1,5 +1,19 @@ - - + + + + @@ -46,14 +63,14 @@
@@ -61,7 +78,7 @@ From c7ce98f1d5554c11b5fe7a85e5972c93e4a43147 Mon Sep 17 00:00:00 2001 From: task Date: Wed, 13 Apr 2022 12:29:32 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E5=8A=A0?= =?UTF-8?q?=E5=85=A5=E6=8E=A5=E5=8F=A3=EF=BC=9A/fileUploadAndDownload/edit?= =?UTF-8?q?FileName=20(#1025)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 初始化加入接口:/fileUploadAndDownload/editFileName Co-authored-by: task <121913992@qq.com> --- server/source/system/api.go | 1 + server/source/system/casbin.go | 3 +++ web/src/components/chooseImg/index.vue | 3 ++- web/src/view/example/upload/upload.vue | 3 ++- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/server/source/system/api.go b/server/source/system/api.go index ec6ccd02e..199ef66ba 100644 --- a/server/source/system/api.go +++ b/server/source/system/api.go @@ -93,6 +93,7 @@ func (i *initApi) InitializeData(ctx context.Context) (context.Context, error) { {ApiGroup: "文件上传与下载", Method: "POST", Path: "/fileUploadAndDownload/upload", Description: "文件上传示例"}, {ApiGroup: "文件上传与下载", Method: "POST", Path: "/fileUploadAndDownload/deleteFile", Description: "删除文件"}, + {ApiGroup: "文件上传与下载", Method: "POST", Path: "/fileUploadAndDownload/editFileName", Description: "文件名或者备注编辑"}, {ApiGroup: "文件上传与下载", Method: "POST", Path: "/fileUploadAndDownload/getFileList", Description: "获取上传文件列表"}, {ApiGroup: "系统服务", Method: "POST", Path: "/system/getServerInfo", Description: "获取服务器信息"}, diff --git a/server/source/system/casbin.go b/server/source/system/casbin.go index fcac63ac4..415a24f4f 100644 --- a/server/source/system/casbin.go +++ b/server/source/system/casbin.go @@ -89,6 +89,7 @@ func (i *initCasbin) InitializeData(ctx context.Context) (context.Context, error {PType: "p", V0: "888", V1: "/fileUploadAndDownload/upload", V2: "POST"}, {PType: "p", V0: "888", V1: "/fileUploadAndDownload/deleteFile", V2: "POST"}, + {PType: "p", V0: "888", V1: "/fileUploadAndDownload/editFileName", V2: "POST"}, {PType: "p", V0: "888", V1: "/fileUploadAndDownload/getFileList", V2: "POST"}, {PType: "p", V0: "888", V1: "/casbin/updateCasbin", V2: "POST"}, @@ -180,6 +181,7 @@ func (i *initCasbin) InitializeData(ctx context.Context) (context.Context, error {PType: "p", V0: "8881", V1: "/fileUploadAndDownload/upload", V2: "POST"}, {PType: "p", V0: "8881", V1: "/fileUploadAndDownload/getFileList", V2: "POST"}, {PType: "p", V0: "8881", V1: "/fileUploadAndDownload/deleteFile", V2: "POST"}, + {PType: "p", V0: "8881", V1: "/fileUploadAndDownload/editFileName", V2: "POST"}, {PType: "p", V0: "8881", V1: "/casbin/updateCasbin", V2: "POST"}, {PType: "p", V0: "8881", V1: "/casbin/getPolicyPathByAuthorityId", V2: "POST"}, {PType: "p", V0: "8881", V1: "/jwt/jsonInBlacklist", V2: "POST"}, @@ -221,6 +223,7 @@ func (i *initCasbin) InitializeData(ctx context.Context) (context.Context, error {PType: "p", V0: "9528", V1: "/fileUploadAndDownload/upload", V2: "POST"}, {PType: "p", V0: "9528", V1: "/fileUploadAndDownload/getFileList", V2: "POST"}, {PType: "p", V0: "9528", V1: "/fileUploadAndDownload/deleteFile", V2: "POST"}, + {PType: "p", V0: "9528", V1: "/fileUploadAndDownload/editFileName", V2: "POST"}, {PType: "p", V0: "9528", V1: "/casbin/updateCasbin", V2: "POST"}, {PType: "p", V0: "9528", V1: "/casbin/getPolicyPathByAuthorityId", V2: "POST"}, {PType: "p", V0: "9528", V1: "/jwt/jsonInBlacklist", V2: "POST"}, diff --git a/web/src/components/chooseImg/index.vue b/web/src/components/chooseImg/index.vue index 70b353c4d..d494b2121 100644 --- a/web/src/components/chooseImg/index.vue +++ b/web/src/components/chooseImg/index.vue @@ -127,7 +127,8 @@ const editFileNameFunc = async(row) => { confirmButtonText: '确定', cancelButtonText: '取消', inputPattern: /\S/, - inputErrorMessage: '不能为空' + inputErrorMessage: '不能为空', + inputValue: row.name }).then(async({ value }) => { row.name = value // console.log(row) diff --git a/web/src/view/example/upload/upload.vue b/web/src/view/example/upload/upload.vue index 938025477..6805bca54 100644 --- a/web/src/view/example/upload/upload.vue +++ b/web/src/view/example/upload/upload.vue @@ -169,7 +169,8 @@ const editFileNameFunc = async(row) => { confirmButtonText: '确定', cancelButtonText: '取消', inputPattern: /\S/, - inputErrorMessage: '不能为空' + inputErrorMessage: '不能为空', + inputValue: row.name }).then(async({ value }) => { row.name = value; //console.log(row) From c92a94bdd2a4e6a91493c65b4bb8c0575a6ff781 Mon Sep 17 00:00:00 2001 From: lvshaoyuan <49431800+lvshaoyuan@users.noreply.github.com> Date: Wed, 13 Apr 2022 21:20:09 +0800 Subject: [PATCH 5/9] =?UTF-8?q?email.go:=E5=86=8D=E9=87=8D=E6=96=B0?= =?UTF-8?q?=E5=86=99=E5=9B=9E=E8=AF=B7=E6=B1=82=E4=BD=93body=E4=B8=AD?= =?UTF-8?q?=EF=BC=8Cioutil.ReadAll=E4=BC=9A=E6=B8=85=E7=A9=BAc.Request.Bod?= =?UTF-8?q?y=E4=B8=AD=E7=9A=84=E6=95=B0=E6=8D=AE=20(#1027)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: oldlv <15237336850@163.com> --- server/middleware/email.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/middleware/email.go b/server/middleware/email.go index 5879c9939..2d38f7e25 100644 --- a/server/middleware/email.go +++ b/server/middleware/email.go @@ -1,6 +1,7 @@ package middleware import ( + "bytes" "io/ioutil" "strconv" "time" @@ -32,6 +33,8 @@ func ErrorToEmail() gin.HandlerFunc { username = user.Username } body, _ := ioutil.ReadAll(c.Request.Body) + // 再重新写回请求体body中,ioutil.ReadAll会清空c.Request.Body中的数据 + c.Request.Body = ioutil.NopCloser(bytes.NewBuffer(body)) record := system.SysOperationRecord{ Ip: c.ClientIP(), Method: c.Request.Method, From 8dd87d017243d3f858821b7ead945faf0c476913 Mon Sep 17 00:00:00 2001 From: bx <553628212@qq.com> Date: Wed, 13 Apr 2022 22:03:58 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96=E4=BB=A3=E7=A0=81=E6=B3=A8=E9=87=8A=E9=94=99=E5=88=AB?= =?UTF-8?q?=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更改自动化代码注释错别字 --- server/router/system/sys_auto_code.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/router/system/sys_auto_code.go b/server/router/system/sys_auto_code.go index 62678520c..a1665cbb8 100644 --- a/server/router/system/sys_auto_code.go +++ b/server/router/system/sys_auto_code.go @@ -18,6 +18,6 @@ func (s *AutoCodeRouter) InitAutoCodeRouter(Router *gin.RouterGroup) { autoCodeRouter.POST("createTemp", autoCodeApi.CreateTemp) // 创建自动化代码 autoCodeRouter.POST("createPackage",autoCodeApi.CreatePackage) // 创建package包 autoCodeRouter.POST("getPackage",autoCodeApi.GetPackage) // 获取package包 - autoCodeRouter.POST("delPackage",autoCodeApi.DelPackage) // 获取package包 + autoCodeRouter.POST("delPackage",autoCodeApi.DelPackage) // 删除package包 } } From 42b51243a704e0d8dca245a978b690612af44448 Mon Sep 17 00:00:00 2001 From: ShuBo6 <41125338+ShuBo6@users.noreply.github.com> Date: Thu, 14 Apr 2022 17:56:01 +0800 Subject: [PATCH 7/9] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86Ram=E6=8B=BC?= =?UTF-8?q?=E5=86=99=E9=94=99=E8=AF=AF=20(#1030)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/service/system/sys_system.go | 2 +- server/utils/server.go | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/server/service/system/sys_system.go b/server/service/system/sys_system.go index 929049a14..94aa7a8b3 100644 --- a/server/service/system/sys_system.go +++ b/server/service/system/sys_system.go @@ -47,7 +47,7 @@ func (systemConfigService *SystemConfigService) GetServerInfo() (server *utils.S global.GVA_LOG.Error("func utils.InitCPU() Failed", zap.String("err", err.Error())) return &s, err } - if s.Rrm, err = utils.InitRAM(); err != nil { + if s.Ram, err = utils.InitRAM(); err != nil { global.GVA_LOG.Error("func utils.InitRAM() Failed", zap.String("err", err.Error())) return &s, err } diff --git a/server/utils/server.go b/server/utils/server.go index ede3a73aa..ce680e6bc 100644 --- a/server/utils/server.go +++ b/server/utils/server.go @@ -19,7 +19,7 @@ const ( type Server struct { Os Os `json:"os"` Cpu Cpu `json:"cpu"` - Rrm Rrm `json:"ram"` + Ram Ram `json:"ram"` Disk Disk `json:"disk"` } @@ -36,7 +36,7 @@ type Cpu struct { Cores int `json:"cores"` } -type Rrm struct { +type Ram struct { UsedMB int `json:"usedMb"` TotalMB int `json:"totalMb"` UsedPercent int `json:"usedPercent"` @@ -85,10 +85,10 @@ func InitCPU() (c Cpu, err error) { //@author: [SliverHorn](https://github.com/SliverHorn) //@function: InitRAM -//@description: ARM信息 -//@return: r Rrm, err error +//@description: RAM信息 +//@return: r Ram, err error -func InitRAM() (r Rrm, err error) { +func InitRAM() (r Ram, err error) { if u, err := mem.VirtualMemory(); err != nil { return r, err } else { From e4d448a66156f5e6605c5338e7bc584af5f65ee6 Mon Sep 17 00:00:00 2001 From: fengyikang88 <54435163+fengyikang88@users.noreply.github.com> Date: Thu, 14 Apr 2022 17:58:24 +0800 Subject: [PATCH 8/9] Update exa_file_upload_and_download.go (#1029) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 更改上传文件路由文件 代码注释错误 Co-authored-by: 奇淼(piexlmax --- server/router/example/exa_file_upload_and_download.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/router/example/exa_file_upload_and_download.go b/server/router/example/exa_file_upload_and_download.go index 767f5bd64..5cc367fcc 100644 --- a/server/router/example/exa_file_upload_and_download.go +++ b/server/router/example/exa_file_upload_and_download.go @@ -17,7 +17,7 @@ func (e *FileUploadAndDownloadRouter) InitFileUploadAndDownloadRouter(Router *gi fileUploadAndDownloadRouter.POST("editFileName", exaFileUploadAndDownloadApi.EditFileName) // 编辑文件名或者备注 fileUploadAndDownloadRouter.POST("breakpointContinue", exaFileUploadAndDownloadApi.BreakpointContinue) // 断点续传 fileUploadAndDownloadRouter.GET("findFile", exaFileUploadAndDownloadApi.FindFile) // 查询当前文件成功的切片 - fileUploadAndDownloadRouter.POST("breakpointContinueFinish", exaFileUploadAndDownloadApi.BreakpointContinueFinish) // 查询当前文件成功的切片 - fileUploadAndDownloadRouter.POST("removeChunk", exaFileUploadAndDownloadApi.RemoveChunk) // 查询当前文件成功的切片 + fileUploadAndDownloadRouter.POST("breakpointContinueFinish", exaFileUploadAndDownloadApi.BreakpointContinueFinish) // 切片传输完成 + fileUploadAndDownloadRouter.POST("removeChunk", exaFileUploadAndDownloadApi.RemoveChunk) // 删除切片 } } From b158849d07aae85a5c90867deef194cc2984013f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A5=87=E6=B7=BC=EF=BC=88piexlmax?= <303176530@qq.com> Date: Fri, 15 Apr 2022 16:09:59 +0800 Subject: [PATCH 9/9] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ca00f90f0..81d9cc686 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ -5.如果您需要服务器的话 2C4G8M 80GB 腾讯云 一年74 三年222 在这里购买:https://curl.qcloud.com/Rm5Rhd4k +5.如果您需要服务器的话 2核2G腾讯云服务器45元/年 在这里购买:https://cloud.tencent.com/act/new?fromSource=gwzcw.4325959.4325959.4325959&utm_medium=cps&utm_id=gwzcw.4325959.4325959.4325959&cps_key=962a7fdaa930cda1c06e36a7608e95cc 阿里云服务器 1c2g1m 38一年 在这里购买:https://www.aliyun.com/minisite/goods?userCode=xqe01uob