fix 创建目录错误的问题

This commit is contained in:
陈景阳
2019-10-07 12:21:32 +08:00
parent 17442fc893
commit dabf5cacf1
2 changed files with 2 additions and 1 deletions

View File

@@ -135,7 +135,7 @@ func PutSpider(c *gin.Context) {
// 以防tmp目录不存在
tmpPath := viper.GetString("other.tmppath")
if !utils.Exists(tmpPath) {
if err := os.Mkdir(tmpPath, os.ModePerm); err != nil {
if err := os.MkdirAll(tmpPath, os.ModePerm); err != nil {
log.Error("mkdir other.tmppath dir error:" + err.Error())
debug.PrintStack()
HandleError(http.StatusBadRequest, c, errors.New("Mkdir other.tmppath dir error"))