Browse Source

修复一些问题

main
SliverHorn 4 years ago
parent
commit
2896ef2b4e
  1. 7
      server/api/v1/sys_auto_code.go
  2. 2
      web/src/api/autoCode.js
  3. 4
      web/src/view/systemTools/autoCode/index.vue
  4. 2
      web/vue.config.js

7
server/api/v1/sys_auto_code.go

@ -84,14 +84,15 @@ func CreateTemp(c *gin.Context) {
} }
err := service.CreateTemp(a) err := service.CreateTemp(a)
if err != nil { 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 { } 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-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("Content-Type", "application/json")
c.Writer.Header().Add("success", "true") c.Writer.Header().Add("success", "true")
c.File("./ginvueadmin.zip") c.File("./ginvueadmin.zip")
os.Remove("./ginvueadmin.zip")
_ = os.Remove("./ginvueadmin.zip")
} }
} }

2
web/src/api/autoCode.js

@ -58,7 +58,7 @@ export const getTable = (params) => {
// @accept application/json // @accept application/json
// @Produce application/json // @Produce application/json
// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}" // @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
// @Router /autoCode/getColume [get]
// @Router /autoCode/getColumn [get]
export const getColumn = (params) => { export const getColumn = (params) => {
return service({ return service({
url: "/autoCode/getColumn", url: "/autoCode/getColumn",

4
web/src/view/systemTools/autoCode/index.vue

@ -349,8 +349,8 @@ export default {
} }
}, },
async setFdMap() { 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); const res = await getDict(fdtype);
res.map(item => { res.map(item => {
this.fdMap[item.label] = fdtype; this.fdMap[item.label] = fdtype;

2
web/vue.config.js

@ -23,7 +23,7 @@ module.exports = {
// 把key的路径代理到target位置 // 把key的路径代理到target位置
// detail: https://cli.vuejs.org/config/#devserver-proxy // detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: { //需要代理的路径 例如 '/api' [process.env.VUE_APP_BASE_API]: { //需要代理的路径 例如 '/api'
target: `http://139.9.113.229:8888/`, //代理到 目标路径
target: `http://127.0.0.1:8888/`, //代理到 目标路径
changeOrigin: true, changeOrigin: true,
pathRewrite: { // 修改路径数据 pathRewrite: { // 修改路径数据
['^' + process.env.VUE_APP_BASE_API]: '' // 举例 '^/api:""' 把路径中的/api字符串删除 ['^' + process.env.VUE_APP_BASE_API]: '' // 举例 '^/api:""' 把路径中的/api字符串删除

Loading…
Cancel
Save