@xuda.io/drive_module 1.1.1321 → 1.1.1323
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.mjs +17 -2
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -665,7 +665,7 @@ export const update_drive_file = async (req, job_id, headers, file_obj) => {
|
|
|
665
665
|
|
|
666
666
|
export const create_drive_folder = async (req, job_id, headers) => {
|
|
667
667
|
try {
|
|
668
|
-
const { drive_type, app_id, folder_name, uid, is_system, path: file_path } = req;
|
|
668
|
+
const { drive_type, app_id, folder_name, tags, uid, is_system, path: file_path } = req;
|
|
669
669
|
validate_drive_type(drive_type);
|
|
670
670
|
|
|
671
671
|
let folder_id;
|
|
@@ -674,6 +674,16 @@ export const create_drive_folder = async (req, job_id, headers) => {
|
|
|
674
674
|
let folder_exist;
|
|
675
675
|
let save_ret;
|
|
676
676
|
|
|
677
|
+
let tags_arr = [];
|
|
678
|
+
|
|
679
|
+
if (tags) {
|
|
680
|
+
if (typeof tags === 'string') {
|
|
681
|
+
tags_arr = tags.split(',');
|
|
682
|
+
} else {
|
|
683
|
+
tags_arr = tags;
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
|
|
677
687
|
let doc = {
|
|
678
688
|
docType: `${drive_type}_drive`,
|
|
679
689
|
stat: 3,
|
|
@@ -687,6 +697,7 @@ export const create_drive_folder = async (req, job_id, headers) => {
|
|
|
687
697
|
type: 'directory',
|
|
688
698
|
file_path,
|
|
689
699
|
is_system,
|
|
700
|
+
tags: tags_arr,
|
|
690
701
|
};
|
|
691
702
|
|
|
692
703
|
let check_req = {
|
|
@@ -1075,7 +1086,11 @@ export const upload_drive_file = async (req, job_id, headers, file_obj) => {
|
|
|
1075
1086
|
let tags_arr = [];
|
|
1076
1087
|
try {
|
|
1077
1088
|
if (tags) {
|
|
1078
|
-
|
|
1089
|
+
if (typeof tags === 'string') {
|
|
1090
|
+
tags_arr = tags.split(',');
|
|
1091
|
+
} else {
|
|
1092
|
+
tags_arr = tags;
|
|
1093
|
+
}
|
|
1079
1094
|
}
|
|
1080
1095
|
} catch (error) {}
|
|
1081
1096
|
const ts = Date.now();
|