scorpio 2 年之前
父节点
当前提交
87c01c4f96
共有 1 个文件被更改,包括 1 次插入5 次删除
  1. 1 5
      src/views/home/component/authorize.vue

+ 1 - 5
src/views/home/component/authorize.vue

@@ -152,10 +152,6 @@ export default {
     initCode (type) {
       this.loading = true
       let list = this.folderList
-      // if (this.folderId.length === 0) {
-      //   this.$message.error('当前目录下没有可以授权的文件')
-      //   return
-      // }
       if (type === 2) {
         list = this.fileList
       }
@@ -182,7 +178,7 @@ export default {
       })
       this.$api.project.initCode({
         files: type === 1 ? [] : fileTmps,
-        folders: type === 2 ? folder : folder.concat(folderTmp),
+        folders: type === 2 ? folder : this.folderId.length === 0 ? folderTmp : folder.concat(folderTmp),
         type: 1,
         projectId: this.projectId
       }).then(res => {