From f0bf193077dca9d07a37e1ff24e198716925f257 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=9F=E5=B8=85?= <133814250@qq.com> Date: Fri, 8 Mar 2024 10:32:07 +0800 Subject: [PATCH] 1 --- server/.gitignore | 1 + server/hack/config.yaml | 4 ++-- server/internal/logic/middleware/response.go | 3 +-- web/src/components/FileChooser/src/Upload.vue | 2 +- web/src/components/Upload/src/BasicUpload.vue | 6 +++++- web/src/views/apply/attachment/index.vue | 1 - web/src/views/develop/code/deploy.vue | 2 +- web/src/views/develop/code/index.vue | 1 - web/src/views/log/ems-log/index.vue | 2 -- web/src/views/login/components/style.less | 2 +- web/src/views/system/dict/index.vue | 2 -- 11 files changed, 12 insertions(+), 14 deletions(-) diff --git a/server/.gitignore b/server/.gitignore index 4fbb0ad..a314378 100644 --- a/server/.gitignore +++ b/server/.gitignore @@ -36,3 +36,4 @@ main.exe~ !hotgo/ *.lock /bin/package.sh +internal/packed/packed.go diff --git a/server/hack/config.yaml b/server/hack/config.yaml index 38ced50..d98f903 100644 --- a/server/hack/config.yaml +++ b/server/hack/config.yaml @@ -3,8 +3,8 @@ gfcli: build: name: "hotgo" # 编译后的可执行文件名称 -# arch: "all" #不填默认当前系统架构,可选:386,amd64,arm,all -# system: "all" #不填默认当前系统平台,可选:linux,darwin,windows,all + arch: "amd64" # 不填默认当前系统架构,可选:386,amd64,arm,all + system: "linux" # 不填默认当前系统平台,可选:linux,darwin,windows,all mod: "none" cgo: 0 packSrc: "resource" # 将resource目录打包进可执行文件,静态资源无需单独部署 diff --git a/server/internal/logic/middleware/response.go b/server/internal/logic/middleware/response.go index f5b619d..679d8e3 100644 --- a/server/internal/logic/middleware/response.go +++ b/server/internal/logic/middleware/response.go @@ -12,7 +12,6 @@ import ( "github.com/gogf/gf/v2/net/ghttp" "github.com/gogf/gf/v2/util/gmeta" "hotgo/internal/consts" - "hotgo/internal/library/contexts" "hotgo/internal/library/response" "hotgo/utility/charset" "hotgo/utility/simple" @@ -34,7 +33,7 @@ func (s *sMiddleware) ResponseHandler(r *ghttp.Request) { contentType := getContentType(r) // 已存在响应 - if contentType != consts.HTTPContentTypeStream && r.Response.BufferLength() > 0 && contexts.Get(r.Context()).Response != nil { + if contentType != consts.HTTPContentTypeStream && r.Response.BufferLength() > 0 { // && contexts.Get(r.Context()).Response != nil return } diff --git a/web/src/components/FileChooser/src/Upload.vue b/web/src/components/FileChooser/src/Upload.vue index 4de6991..23eed3a 100644 --- a/web/src/components/FileChooser/src/Upload.vue +++ b/web/src/components/FileChooser/src/Upload.vue @@ -76,7 +76,7 @@ //上传结束 function finish({ event: Event }) { - const res = eval('(' + Event.target.response + ')'); + const res = JSON.parse(Event.target.response); const infoField = componentSetting.upload.apiSetting.infoField; const { code } = res; const msg = res.msg || res.message || '上传失败'; diff --git a/web/src/components/Upload/src/BasicUpload.vue b/web/src/components/Upload/src/BasicUpload.vue index 35f8f14..2936ad5 100644 --- a/web/src/components/Upload/src/BasicUpload.vue +++ b/web/src/components/Upload/src/BasicUpload.vue @@ -106,6 +106,9 @@ const message = useMessage(); const dialog = useDialog(); const uploadTitle = ref(props.fileType === 'image' ? '上传图片' : '上传附件'); + const maxNumber = computed(() => { + return props.maxNumber; + }); const fileAvatarCSS = computed(() => { return { '--n-merged-size': `var(--n-avatar-size-override, ${props.width * 0.8}px)`, @@ -245,7 +248,7 @@ //上传结束 function finish({ event: Event }) { - const res = eval('(' + Event.target.response + ')'); + const res = JSON.parse(Event.target.response); const infoField = componentSetting.upload.apiSetting.infoField; const imgField = componentSetting.upload.apiSetting.imgField; const { code } = res; @@ -289,6 +292,7 @@ getFileExt, Preview, previewRef, + maxNumber, }; }, }); diff --git a/web/src/views/apply/attachment/index.vue b/web/src/views/apply/attachment/index.vue index 840c40a..ee0b0c9 100644 --- a/web/src/views/apply/attachment/index.vue +++ b/web/src/views/apply/attachment/index.vue @@ -175,7 +175,6 @@ negativeText: '取消', onPositiveClick: () => { Delete(record).then((_res) => { - console.log('_res:' + JSON.stringify(_res)); message.success('操作成功'); reloadTable(); }); diff --git a/web/src/views/develop/code/deploy.vue b/web/src/views/develop/code/deploy.vue index f0c6999..bb43a9b 100644 --- a/web/src/views/develop/code/deploy.vue +++ b/web/src/views/develop/code/deploy.vue @@ -29,7 +29,7 @@ v-for="panel in slavePanels" :key="panel" :name="panel" - v-show="slavePanels.length > 0 && slavePanels !== []" + v-show="slavePanels.length > 0" > { Delete(record).then((_res) => { - console.log('_res:' + JSON.stringify(_res)); message.success('操作成功'); reloadTable(); }); diff --git a/web/src/views/log/ems-log/index.vue b/web/src/views/log/ems-log/index.vue index f43e253..37bbdb8 100644 --- a/web/src/views/log/ems-log/index.vue +++ b/web/src/views/log/ems-log/index.vue @@ -228,7 +228,6 @@ onPositiveClick: () => { Delete(record) .then((_res) => { - console.log('_res:' + JSON.stringify(_res)); message.success('操作成功'); reloadTable(); }) @@ -251,7 +250,6 @@ onPositiveClick: () => { Delete({ id: checkedIds.value }) .then((_res) => { - console.log('_res:' + JSON.stringify(_res)); message.success('操作成功'); reloadTable(); }) diff --git a/web/src/views/login/components/style.less b/web/src/views/login/components/style.less index 208df11..99e17ca 100644 --- a/web/src/views/login/components/style.less +++ b/web/src/views/login/components/style.less @@ -37,7 +37,7 @@ @media (min-width: 768px) { .view-account { - background-image: url('~@/assets/images/login.svg'); + background-image: url('@/assets/images/login.svg'); background-repeat: no-repeat; background-position: 50%; background-size: 100%; diff --git a/web/src/views/system/dict/index.vue b/web/src/views/system/dict/index.vue index 5203bea..531ecce 100644 --- a/web/src/views/system/dict/index.vue +++ b/web/src/views/system/dict/index.vue @@ -200,10 +200,8 @@ positiveText: '确定', negativeText: '取消', onPositiveClick: () => { - console.log('DeleteMenu formParams:' + JSON.stringify(formParams)); DeleteDict({ ...formParams }) .then(async (_res) => { - console.log('_res:' + JSON.stringify(_res)); message.success('操作成功'); // handleReset(); await loadData();