From 2896ef2b4e5f37898a45fc1ac98bea073aa659ec Mon Sep 17 00:00:00 2001 From: SliverHorn Date: Sat, 7 Nov 2020 22:50:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=BA=9B=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/api/v1/sys_auto_code.go | 7 ++++--- web/src/api/autoCode.js | 2 +- web/src/view/systemTools/autoCode/index.vue | 4 ++-- web/vue.config.js | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/server/api/v1/sys_auto_code.go b/server/api/v1/sys_auto_code.go index 4c9aafad..7ee5ff25 100644 --- a/server/api/v1/sys_auto_code.go +++ b/server/api/v1/sys_auto_code.go @@ -84,14 +84,15 @@ func CreateTemp(c *gin.Context) { } err := service.CreateTemp(a) if err != nil { - response.FailWithMessage(fmt.Sprintf("创建失败,%v", err), c) - os.Remove("./ginvueadmin.zip") + c.Writer.Header().Add("success", "false") + c.Writer.Header().Add("msg", url.QueryEscape(err.Error())) + _ = os.Remove("./ginvueadmin.zip") } else { c.Writer.Header().Add("Content-Disposition", fmt.Sprintf("attachment; filename=%s", "ginvueadmin.zip")) // fmt.Sprintf("attachment; filename=%s", filename)对下载的文件重命名 c.Writer.Header().Add("Content-Type", "application/json") c.Writer.Header().Add("success", "true") c.File("./ginvueadmin.zip") - os.Remove("./ginvueadmin.zip") + _ = os.Remove("./ginvueadmin.zip") } } diff --git a/web/src/api/autoCode.js b/web/src/api/autoCode.js index bee86190..df146aff 100644 --- a/web/src/api/autoCode.js +++ b/web/src/api/autoCode.js @@ -58,7 +58,7 @@ export const getTable = (params) => { // @accept application/json // @Produce application/json // @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}" -// @Router /autoCode/getColume [get] +// @Router /autoCode/getColumn [get] export const getColumn = (params) => { return service({ url: "/autoCode/getColumn", diff --git a/web/src/view/systemTools/autoCode/index.vue b/web/src/view/systemTools/autoCode/index.vue index e5797b4c..88da510e 100644 --- a/web/src/view/systemTools/autoCode/index.vue +++ b/web/src/view/systemTools/autoCode/index.vue @@ -349,8 +349,8 @@ export default { } }, async setFdMap() { - const fdTpyes = ["string", "int", "bool", "float64", "time.Time"]; - fdTpyes.map(async fdtype => { + const fdTypes= ["string", "int", "bool", "float64", "time.Time"]; + fdTypes.map(async fdtype => { const res = await getDict(fdtype); res.map(item => { this.fdMap[item.label] = fdtype; diff --git a/web/vue.config.js b/web/vue.config.js index 71961ce0..7b3b7cf6 100644 --- a/web/vue.config.js +++ b/web/vue.config.js @@ -23,7 +23,7 @@ module.exports = { // 把key的路径代理到target位置 // detail: https://cli.vuejs.org/config/#devserver-proxy [process.env.VUE_APP_BASE_API]: { //需要代理的路径 例如 '/api' - target: `http://139.9.113.229:8888/`, //代理到 目标路径 + target: `http://127.0.0.1:8888/`, //代理到 目标路径 changeOrigin: true, pathRewrite: { // 修改路径数据 ['^' + process.env.VUE_APP_BASE_API]: '' // 举例 '^/api:""' 把路径中的/api字符串删除