Skip to content

Commit f7667ad

Browse files
committed
修复bug
1 parent b947f04 commit f7667ad

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

server/service/sys_auto_code.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package service
22

33
import (
4+
"errors"
45
"fmt"
56
"gin-vue-admin/global"
67
"gin-vue-admin/model"
@@ -101,13 +102,12 @@ func CreateTemp(autoCode model.AutoCodeStruct) (err error) {
101102
addAutoMoveFile(&dataList[index])
102103
}
103104
for _, value := range dataList { // 移动文件
104-
err := utils.FileMove(value.autoCodePath, value.autoMoveFilePath)
105-
if err != nil {
105+
if err := utils.FileMove(value.autoCodePath, value.autoMoveFilePath); err != nil {
106106
fmt.Println(err)
107107
return err
108108
}
109109
}
110-
return
110+
return errors.New("创建代码成功并移动文件成功")
111111
} else { // 打包
112112
if err := utils.ZipFiles("./ginvueadmin.zip", fileList, ".", "."); err != nil {
113113
return err
@@ -174,7 +174,7 @@ func addAutoMoveFile(data *tplData) {
174174
} else if strings.Contains(data.autoCodePath, "form") {
175175
formList := strings.Split(data.autoCodePath, "/")
176176
data.autoMoveFilePath = filepath.Join("../", "web", "view", formList[len(formList)-3], strings.Split(formList[len(formList)-1], ".")[0]+"From.vue")
177-
} else if strings.Contains(data.autoCodePath, "form") {
177+
} else if strings.Contains(data.autoCodePath, "table") {
178178
vueList := strings.Split(data.autoCodePath, "/")
179179
data.autoMoveFilePath = filepath.Join("../", "web", "view", vueList[len(vueList)-3], vueList[len(vueList)-1])
180180
}

0 commit comments

Comments
 (0)