@chenghongyu/xpt-file-viewer 1.1.0
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/.vscode/extensions.json +3 -0
- package/README.md +5 -0
- package/auto-imports.d.ts +12 -0
- package/components.d.ts +45 -0
- package/dist.zip +0 -0
- package/index.html +13 -0
- package/package.json +100 -0
- package/presets/eslint/.eslintrc-auto-import.json +462 -0
- package/presets/plugins/html.ts +14 -0
- package/presets/shared/env.ts +46 -0
- package/presets/shared/resolvers.ts +29 -0
- package/presets/tov.ts +132 -0
- package/presets/types/auto-imports.d.ts +806 -0
- package/presets/types/components.d.ts +164 -0
- package/presets/types/env.d.ts +17 -0
- package/public/favicon.svg +1 -0
- package/public/icons.svg +24 -0
- package/public/testfile/README.md +5 -0
- package/public/testfile/useFileContextMenu.js +74 -0
- package/public/testfile//345/217/221/347/245/250.pdf +0 -0
- package/public/testfile//346/216/245/346/224/266/345/207/275.docx +0 -0
- package/public/testfile//350/247/204/346/240/274/345/236/213/345/217/2671.txt +263 -0
- package/public/testfile//350/247/206/351/242/2211.mp4 +0 -0
- package/public/testfile//351/237/263/351/242/2211.mp3 +0 -0
- package/src/App.vue +8 -0
- package/src/api/admin/admin-2fa.js +18 -0
- package/src/api/admin/admin-download-log.js +37 -0
- package/src/api/admin/admin-login-log.js +9 -0
- package/src/api/admin/admin-permission.js +9 -0
- package/src/api/admin/admin-setting.js +121 -0
- package/src/api/admin/admin-share.js +20 -0
- package/src/api/admin/admin-short-link.js +49 -0
- package/src/api/admin/admin-sso.js +38 -0
- package/src/api/admin/admin-storage.js +189 -0
- package/src/api/admin/admin-user.js +61 -0
- package/src/api/home/common.js +9 -0
- package/src/api/home/file-operator.js +89 -0
- package/src/api/home/home.js +87 -0
- package/src/api/home/install.js +18 -0
- package/src/api/home/login.js +9 -0
- package/src/api/home/only-office.js +10 -0
- package/src/api/home/share.js +115 -0
- package/src/api/home/user.js +74 -0
- package/src/api/tools/tools-115.js +17 -0
- package/src/api/tools/tools-gd.js +13 -0
- package/src/api/tools/tools-s3.js +25 -0
- package/src/api/tools/tools-sharepoint.js +19 -0
- package/src/assets/hero.png +0 -0
- package/src/assets/icons/401.svg +1 -0
- package/src/assets/icons/403.svg +45 -0
- package/src/assets/icons/404.svg +1 -0
- package/src/assets/icons/500.svg +1 -0
- package/src/assets/icons/admin-login.svg +1 -0
- package/src/assets/icons/document.svg +1 -0
- package/src/assets/icons/empty.svg +145 -0
- package/src/assets/icons/file-type-apk.svg +1 -0
- package/src/assets/icons/file-type-archive.svg +1 -0
- package/src/assets/icons/file-type-audio.svg +1 -0
- package/src/assets/icons/file-type-back.svg +1 -0
- package/src/assets/icons/file-type-css.svg +1 -0
- package/src/assets/icons/file-type-deb.svg +1 -0
- package/src/assets/icons/file-type-dll.svg +1 -0
- package/src/assets/icons/file-type-doc.svg +1 -0
- package/src/assets/icons/file-type-document.svg +1 -0
- package/src/assets/icons/file-type-docx.svg +1 -0
- package/src/assets/icons/file-type-exe.svg +1 -0
- package/src/assets/icons/file-type-expression.svg +1 -0
- package/src/assets/icons/file-type-file.svg +1 -0
- package/src/assets/icons/file-type-folder.svg +1 -0
- package/src/assets/icons/file-type-html.svg +1 -0
- package/src/assets/icons/file-type-image.svg +1 -0
- package/src/assets/icons/file-type-java.svg +1 -0
- package/src/assets/icons/file-type-js.svg +1 -0
- package/src/assets/icons/file-type-less.svg +1 -0
- package/src/assets/icons/file-type-md.svg +1 -0
- package/src/assets/icons/file-type-office.svg +1 -0
- package/src/assets/icons/file-type-pdf.svg +1 -0
- package/src/assets/icons/file-type-php.svg +1 -0
- package/src/assets/icons/file-type-ppt.svg +1 -0
- package/src/assets/icons/file-type-pptx.svg +1 -0
- package/src/assets/icons/file-type-py.svg +1 -0
- package/src/assets/icons/file-type-rb.svg +1 -0
- package/src/assets/icons/file-type-root.svg +1 -0
- package/src/assets/icons/file-type-rpm.svg +1 -0
- package/src/assets/icons/file-type-rust.svg +1 -0
- package/src/assets/icons/file-type-script.svg +1 -0
- package/src/assets/icons/file-type-text.svg +1 -0
- package/src/assets/icons/file-type-three3d.svg +5 -0
- package/src/assets/icons/file-type-vbs.svg +1 -0
- package/src/assets/icons/file-type-video.svg +1 -0
- package/src/assets/icons/file-type-xls.svg +1 -0
- package/src/assets/icons/file-type-xlsx.svg +1 -0
- package/src/assets/icons/file-type-xml.svg +1 -0
- package/src/assets/icons/file-type-yaml.svg +1 -0
- package/src/assets/icons/file-upload.svg +1 -0
- package/src/assets/icons/github.svg +1 -0
- package/src/assets/icons/install-step.svg +40 -0
- package/src/assets/icons/reset-password.svg +1 -0
- package/src/assets/icons/storage-aliyun.svg +1 -0
- package/src/assets/icons/storage-baidu.svg +1 -0
- package/src/assets/icons/storage-doge-cloud.svg +207 -0
- package/src/assets/icons/storage-ftp.svg +13 -0
- package/src/assets/icons/storage-google-drive.svg +8 -0
- package/src/assets/icons/storage-huawei.svg +1 -0
- package/src/assets/icons/storage-local.svg +11 -0
- package/src/assets/icons/storage-minio.svg +1 -0
- package/src/assets/icons/storage-onedrive-china.svg +18 -0
- package/src/assets/icons/storage-onedrive.svg +4 -0
- package/src/assets/icons/storage-open115.svg +23 -0
- package/src/assets/icons/storage-qiniu.svg +1 -0
- package/src/assets/icons/storage-s3.svg +5 -0
- package/src/assets/icons/storage-sftp.svg +13 -0
- package/src/assets/icons/storage-sharepoint-china.svg +23 -0
- package/src/assets/icons/storage-sharepoint.svg +1 -0
- package/src/assets/icons/storage-tencent.svg +9 -0
- package/src/assets/icons/storage-ufile.svg +14 -0
- package/src/assets/icons/storage-upyun.svg +1 -0
- package/src/assets/icons/storage-webdav.svg +1 -0
- package/src/assets/icons/upload.svg +50 -0
- package/src/assets/icons/zfile-basic.svg +17 -0
- package/src/assets/icons/zfile-horizontal.svg +16 -0
- package/src/assets/icons/zfile.svg +1 -0
- package/src/assets/vite.svg +1 -0
- package/src/assets/vue.svg +1 -0
- package/src/components/HelloWorld.vue +319 -0
- package/src/components/common/QrCodePreview.vue +118 -0
- package/src/components/common/dialog/ZDialog.vue +171 -0
- package/src/components/common/dialog/types.ts +19 -0
- package/src/components/common/dialog/useDialog.ts +18 -0
- package/src/components/common/dialog/useDialogWithForm.ts +21 -0
- package/src/components/copy.vue +133 -0
- package/src/components/file/preview/AudioPlayer.vue +333 -0
- package/src/components/file/preview/CopyCode.vue +47 -0
- package/src/components/file/preview/FileGallery.vue +199 -0
- package/src/components/file/preview/ImageViewer.vue +432 -0
- package/src/components/file/preview/KkFileViewer.vue +86 -0
- package/src/components/file/preview/KkFileViewerDialog.vue +42 -0
- package/src/components/file/preview/MarkdownViewer.vue +102 -0
- package/src/components/file/preview/MarkdownViewerAsyncLoading.vue +17 -0
- package/src/components/file/preview/MarkdownViewerDialogAsyncLoading.vue +12 -0
- package/src/components/file/preview/OfficeViewer.vue +76 -0
- package/src/components/file/preview/OfficeViewerDialog.vue +55 -0
- package/src/components/file/preview/PdfViewer.vue +157 -0
- package/src/components/file/preview/PdfViewerDialog.vue +41 -0
- package/src/components/file/preview/TextViewer.vue +232 -0
- package/src/components/file/preview/TextViewerAsyncLoading.vue +22 -0
- package/src/components/file/preview/TextViewerDialog.vue +53 -0
- package/src/components/file/preview/Three3dPreview.vue +114 -0
- package/src/components/file/preview/Three3dPreviewDialog.vue +50 -0
- package/src/components/file/preview/VideoPlayer.vue +341 -0
- package/src/components/file/preview/VideoPlayerAsyncLoading.vue +45 -0
- package/src/components/file/preview/VideoPlayerDialog.vue +51 -0
- package/src/components/file/selectFolder/SelectFolder.vue +208 -0
- package/src/components/file/selectFolder/index.ts +50 -0
- package/src/components/file/selectFolder/types.ts +5 -0
- package/src/components/fileReview/AudioPlayer-copy.vue +333 -0
- package/src/components/fileReview/PdfViewer-copy.vue +157 -0
- package/src/components/fileReview/TextViewer-copy.vue +44 -0
- package/src/components/fileReview/VideoPlayer-copy.vue +341 -0
- package/src/components/messageBox/confirm/confirm.vue +137 -0
- package/src/components/messageBox/confirm/index.ts +27 -0
- package/src/components/messageBox/confirm/types.ts +15 -0
- package/src/components/messageBox/messageBox.ts +9 -0
- package/src/components/messageBox/prompt/index.ts +27 -0
- package/src/components/messageBox/prompt/prompt.vue +178 -0
- package/src/components/messageBox/prompt/types.ts +24 -0
- package/src/components/vue-codemirror/editor.vue +212 -0
- package/src/components/vue-codemirror/encodings.ts +27 -0
- package/src/components/vue-codemirror/index.vue +380 -0
- package/src/components/vue-codemirror/lang-code/cpp/index.ts +3 -0
- package/src/components/vue-codemirror/lang-code/css/index.ts +2 -0
- package/src/components/vue-codemirror/lang-code/dockerfile/index.ts +5 -0
- package/src/components/vue-codemirror/lang-code/erlang/index.ts +6 -0
- package/src/components/vue-codemirror/lang-code/go/index.ts +5 -0
- package/src/components/vue-codemirror/lang-code/html/index.ts +3 -0
- package/src/components/vue-codemirror/lang-code/java/index.ts +3 -0
- package/src/components/vue-codemirror/lang-code/javascript/index.ts +3 -0
- package/src/components/vue-codemirror/lang-code/json/index.ts +3 -0
- package/src/components/vue-codemirror/lang-code/jsx/index.ts +3 -0
- package/src/components/vue-codemirror/lang-code/lua/index.ts +6 -0
- package/src/components/vue-codemirror/lang-code/markdown/index.ts +2 -0
- package/src/components/vue-codemirror/lang-code/mysql/index.ts +3 -0
- package/src/components/vue-codemirror/lang-code/nginx/index.ts +6 -0
- package/src/components/vue-codemirror/lang-code/perl/index.ts +5 -0
- package/src/components/vue-codemirror/lang-code/pgsql/index.ts +2 -0
- package/src/components/vue-codemirror/lang-code/php/index.ts +3 -0
- package/src/components/vue-codemirror/lang-code/powershell/index.ts +3 -0
- package/src/components/vue-codemirror/lang-code/python/index.ts +2 -0
- package/src/components/vue-codemirror/lang-code/r/index.ts +5 -0
- package/src/components/vue-codemirror/lang-code/ruby/index.ts +5 -0
- package/src/components/vue-codemirror/lang-code/rust/index.ts +2 -0
- package/src/components/vue-codemirror/lang-code/shell/index.ts +5 -0
- package/src/components/vue-codemirror/lang-code/sql/index.ts +3 -0
- package/src/components/vue-codemirror/lang-code/stylus/index.ts +3 -0
- package/src/components/vue-codemirror/lang-code/swift/index.ts +4 -0
- package/src/components/vue-codemirror/lang-code/toml/index.ts +3 -0
- package/src/components/vue-codemirror/lang-code/tsx/index.ts +2 -0
- package/src/components/vue-codemirror/lang-code/typescript/index.ts +2 -0
- package/src/components/vue-codemirror/lang-code/vb/index.ts +3 -0
- package/src/components/vue-codemirror/lang-code/vbscript/index.ts +3 -0
- package/src/components/vue-codemirror/lang-code/xml/index.ts +2 -0
- package/src/components/vue-codemirror/lang-code/yaml/index.ts +3 -0
- package/src/components/vue-codemirror/languages.ts +8 -0
- package/src/components/vue-codemirror/themes.ts +5 -0
- package/src/components/vue-codemirror/toolbar.vue +183 -0
- package/src/components/vue-codemirror/types.ts +12 -0
- package/src/components.d.ts +49 -0
- package/src/composables/admin/layout/admin-layout.js +53 -0
- package/src/composables/admin/link/useLinkSetting.js +16 -0
- package/src/composables/admin/sso/baseSsoConfig.js +54 -0
- package/src/composables/admin/sso/useSsoConfig.js +176 -0
- package/src/composables/admin/storage/storage-copy.js +89 -0
- package/src/composables/admin/storage/storage-filter.js +64 -0
- package/src/composables/admin/storage/storage-list.js +202 -0
- package/src/composables/admin/storage/storage-password.js +101 -0
- package/src/composables/admin/storage/storage-readme.js +102 -0
- package/src/composables/admin/storage/utils/open115-util.js +61 -0
- package/src/composables/admin/useAdminSetting.js +60 -0
- package/src/composables/admin/useClientInfo.js +20 -0
- package/src/composables/admin/user/user-copy.js +79 -0
- package/src/composables/file/useBatchOperatorResult.js +19 -0
- package/src/composables/file/useFileContextMenu.js +74 -0
- package/src/composables/file/useFileData.js +243 -0
- package/src/composables/file/useFileLink.js +175 -0
- package/src/composables/file/useFileLoading.js +41 -0
- package/src/composables/file/useFileLongPressEvent.js +71 -0
- package/src/composables/file/useFileOperator.js +347 -0
- package/src/composables/file/useFilePreview.js +99 -0
- package/src/composables/file/useFilePwd.js +138 -0
- package/src/composables/file/useFileSelect.js +105 -0
- package/src/composables/file/useFileShare.js +39 -0
- package/src/composables/file/useFileUpload.js +1045 -0
- package/src/composables/file/useKkFileViewDialog.js +24 -0
- package/src/composables/file/useOfficeViewerDialog.js +20 -0
- package/src/composables/file/usePdfViewerDialog.js +22 -0
- package/src/composables/file/useShareActions.js +94 -0
- package/src/composables/file/useShareTableOperator.js +84 -0
- package/src/composables/file/useTableOperator.js +211 -0
- package/src/composables/file/useTextViewerDialog.js +22 -0
- package/src/composables/file/useThree3dPreviewDialog.js +23 -0
- package/src/composables/file/useVideoPlayerDialog.js +19 -0
- package/src/composables/header/useHeaderBreadcrumb.js +111 -0
- package/src/composables/header/useHeaderStorageList.js +150 -0
- package/src/composables/header/useSetting.js +58 -0
- package/src/composables/share/useShareData.js +178 -0
- package/src/composables/useDarks.ts +4 -0
- package/src/composables/useRouterData.js +41 -0
- package/src/constant/index.js +193 -0
- package/src/http/index.js +153 -0
- package/src/http/request.js +31 -0
- package/src/main.ts +23 -0
- package/src/stores/file-data.ts +108 -0
- package/src/stores/global-config.ts +115 -0
- package/src/stores/storage-config.ts +123 -0
- package/src/style.css +296 -0
- package/src/styles/admin.scss +91 -0
- package/src/styles/code-editor-variables.scss +52 -0
- package/src/styles/element-plus.scss +22 -0
- package/src/styles/error-page.css +26 -0
- package/src/styles/main.css +142 -0
- package/src/styles/tailwind/index.scss +33 -0
- package/src/utils/index.ts +7 -0
- package/src/utils/models/base.ts +34 -0
- package/src/utils/models/file.ts +95 -0
- package/src/utils/models/path.ts +117 -0
- package/src/utils/models/qrcode.ts +21 -0
- package/src/utils/models/time.ts +132 -0
- package/src/utils/models/util.ts +42 -0
- package/src/utils/models/window.ts +14 -0
- package/stats.html +4950 -0
- package/tsconfig.app.json +16 -0
- package/tsconfig.json +7 -0
- package/tsconfig.node.json +26 -0
- package/vite.config.ts +57 -0
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { ref, computed, watch } from "vue";
|
|
2
|
+
import { getSourceListReq } from "~/api/home/home";
|
|
3
|
+
|
|
4
|
+
import MessageBox from "~/components/messageBox/messageBox";
|
|
5
|
+
|
|
6
|
+
import useFileLoading from "~/composables/file/useFileLoading";
|
|
7
|
+
const { loading } = useFileLoading();
|
|
8
|
+
|
|
9
|
+
import useFileDataStore from "~/stores/file-data";
|
|
10
|
+
let fileDataStore = useFileDataStore();
|
|
11
|
+
|
|
12
|
+
import useStorageConfigStore from "~/stores/storage-config";
|
|
13
|
+
let storageConfigStore = useStorageConfigStore();
|
|
14
|
+
|
|
15
|
+
import useRouterData from "~/composables/useRouterData";
|
|
16
|
+
let { routerRef, fullpath, storageKey, routeRef } = useRouterData();
|
|
17
|
+
|
|
18
|
+
let storageList = ref([]);
|
|
19
|
+
let currentStorageKey = ref();
|
|
20
|
+
|
|
21
|
+
let initialized = false;
|
|
22
|
+
|
|
23
|
+
export default function useHeaderStorageList() {
|
|
24
|
+
|
|
25
|
+
let rootShowStorage = storageConfigStore.globalConfig.rootShowStorage;
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
// 加载存储源列表
|
|
29
|
+
let loadStorageSourceList = () => {
|
|
30
|
+
return new Promise((resolve) => {
|
|
31
|
+
// 请求获取所有存储器列表
|
|
32
|
+
getSourceListReq().then((response) => {
|
|
33
|
+
storageList.value = response.data;
|
|
34
|
+
|
|
35
|
+
// 如果没有存储源, 则直接提示是否添加
|
|
36
|
+
if (storageList.value.length === 0) {
|
|
37
|
+
let isBasicUser = storageConfigStore.loginInfo.isLogin && !storageConfigStore.loginInfo.isAdmin;
|
|
38
|
+
let isAdmin = storageConfigStore.loginInfo.isLogin && storageConfigStore.loginInfo.isAdmin;
|
|
39
|
+
if (isBasicUser) {
|
|
40
|
+
ElMessage.warning('您当前没有可用存储源,请联系管理员为当前用户添加存储源权限');
|
|
41
|
+
} else if (isAdmin) {
|
|
42
|
+
MessageBox.confirm('当前无可用存储源,是否前往后台添加存储源?', '提示', {
|
|
43
|
+
confirmButtonText: '确定',
|
|
44
|
+
cancelButtonText: '取消',
|
|
45
|
+
type: 'info'
|
|
46
|
+
}).then(() => {
|
|
47
|
+
routerRef.value.push('/login')
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
rootPathAction(rootShowStorage);
|
|
54
|
+
resolve(response);
|
|
55
|
+
});
|
|
56
|
+
})
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// 如果路由处理根目录的操作.
|
|
60
|
+
const rootPathAction = (rootShowStorage) => {
|
|
61
|
+
// 在分享页面不干预文件列表(避免覆盖分享文件列表为存储源列表)
|
|
62
|
+
if (routeRef.value?.path?.startsWith('/share')) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
// 如果当前 URL 参数中有存储源 ID, 则直接用当前的.
|
|
66
|
+
if (storageKey.value) {
|
|
67
|
+
// 判断 url 中的 storageKey 是否存在于 storageList 中. 如果不存在, 则跳转到首页
|
|
68
|
+
let storageByKey = findStorageByKey(storageKey.value);
|
|
69
|
+
|
|
70
|
+
if (storageByKey) {
|
|
71
|
+
currentStorageKey.value = storageKey.value;
|
|
72
|
+
} else {
|
|
73
|
+
// 否则读取存储源列表中的第一个, 并跳转到响应的 URL 中.
|
|
74
|
+
routerToFirstStorage();
|
|
75
|
+
}
|
|
76
|
+
} else {
|
|
77
|
+
if (rootShowStorage) {
|
|
78
|
+
fileDataStore.updateFileList(storageListAsFileList.value);
|
|
79
|
+
document.title = storageConfigStore.globalConfig.siteName + ' | 首页';
|
|
80
|
+
loading.value = false;
|
|
81
|
+
} else {
|
|
82
|
+
routerToFirstStorage();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
refreshCurrentStorageSource();
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// 将存储源类别转换到文件列表
|
|
89
|
+
const storageListAsFileList = computed(() => {
|
|
90
|
+
let fileList = [];
|
|
91
|
+
storageList.value.forEach((item) => {
|
|
92
|
+
fileList.push({
|
|
93
|
+
name: item.name, path: item.key, size: 0, time: '-', type: 'ROOT'
|
|
94
|
+
})
|
|
95
|
+
})
|
|
96
|
+
return fileList;
|
|
97
|
+
})
|
|
98
|
+
|
|
99
|
+
// 更新当前存储策略到 pinia 中
|
|
100
|
+
const refreshCurrentStorageSource = () => {
|
|
101
|
+
storageList.value.some((item) => {
|
|
102
|
+
if (item.key === currentStorageKey.value) {
|
|
103
|
+
fileDataStore.updateCurrentStorageSource(item);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (!initialized) {
|
|
109
|
+
// 当存储策略变化时, 切换路由中的值
|
|
110
|
+
watch(() => currentStorageKey.value, (newVal, oldVal) => {
|
|
111
|
+
|
|
112
|
+
// 如果切换到了新存储源,且没有指定路径,则进行切换
|
|
113
|
+
if ((newVal && !fullpath.value) || oldVal !== undefined) {
|
|
114
|
+
storageConfigStore.folderConfig.readmeText = '';
|
|
115
|
+
routerRef.value.push('/' + newVal);
|
|
116
|
+
refreshCurrentStorageSource();
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
watch(() => storageKey.value, (val) => {
|
|
121
|
+
rootPathAction(true);
|
|
122
|
+
})
|
|
123
|
+
initialized = true;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// 跳转到第一个存储器
|
|
127
|
+
const routerToFirstStorage = () => {
|
|
128
|
+
// 否则读取存储源列表中的第一个, 并跳转到响应的 URL 中.
|
|
129
|
+
if (storageList.value.length > 0) {
|
|
130
|
+
let firstStorageKey = storageList.value[0].key;
|
|
131
|
+
currentStorageKey.value = firstStorageKey;
|
|
132
|
+
routerRef.value.push('/' + firstStorageKey);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* 根据存储源 key 查找对象
|
|
138
|
+
*/
|
|
139
|
+
const findStorageByKey = (key) => {
|
|
140
|
+
return storageList.value.find(item => {
|
|
141
|
+
if (item.key == key) {
|
|
142
|
+
return item;
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
return {
|
|
148
|
+
loadStorageSourceList, storageList, findStorageByKey, currentStorageKey, storageListAsFileList
|
|
149
|
+
}
|
|
150
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { isMobile } from "~/utils";
|
|
2
|
+
|
|
3
|
+
const visible = ref(false);
|
|
4
|
+
|
|
5
|
+
// 获取默认值
|
|
6
|
+
import useGlobalConfigStore from "~/stores/global-config";
|
|
7
|
+
let globalConfigStore = useGlobalConfigStore();
|
|
8
|
+
let zfileConfig = globalConfigStore.zfileConfig;
|
|
9
|
+
|
|
10
|
+
let baseData = {
|
|
11
|
+
view: {
|
|
12
|
+
size: 2,
|
|
13
|
+
type: 'table',
|
|
14
|
+
},
|
|
15
|
+
gallery: {
|
|
16
|
+
column: isMobile.value ? zfileConfig.gallery.mobileColumn : zfileConfig.gallery.column,
|
|
17
|
+
columnSpacing: zfileConfig.gallery.columnSpacing,
|
|
18
|
+
rowSpacing: zfileConfig.gallery.rowSpacing,
|
|
19
|
+
showInfo: zfileConfig.gallery.showInfo,
|
|
20
|
+
showInfoMode: zfileConfig.gallery.showInfoMode,
|
|
21
|
+
roundedBorder: zfileConfig.gallery.roundedBorder,
|
|
22
|
+
showBackTop: zfileConfig.gallery.showBackTop
|
|
23
|
+
},
|
|
24
|
+
imagePreview: {
|
|
25
|
+
mode: zfileConfig.imagePreview.mode,
|
|
26
|
+
gallery: zfileConfig.imagePreview.gallery
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const extend = (a, b) => {
|
|
31
|
+
b = b || this;
|
|
32
|
+
|
|
33
|
+
for(let key in a) {
|
|
34
|
+
if (b[key] === undefined) {
|
|
35
|
+
b[key] = a[key];
|
|
36
|
+
} else if (a[key] instanceof Object && b[key] instanceof Object) {
|
|
37
|
+
extend(a[key], b[key]);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const zfileSettingCache = useStorage('zfile-setting-cache', baseData);
|
|
43
|
+
if (!zfileSettingCache.value.view.type) {
|
|
44
|
+
zfileSettingCache.value.view.type = 'table';
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export default function useSetting() {
|
|
48
|
+
|
|
49
|
+
const openSettingVisible = () => {
|
|
50
|
+
visible.value = true;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
extend(baseData, zfileSettingCache.value)
|
|
54
|
+
|
|
55
|
+
return {
|
|
56
|
+
visible, zfileSettingCache, openSettingVisible
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
|
|
2
|
+
import { computed, ref, reactive } from "vue";
|
|
3
|
+
import { getShareInfoReq, verifySharePasswordReq, getShareFileListReq, getShareFileDownloadUrlReq } from "~/api/home/share";
|
|
4
|
+
import { ElMessage } from "element-plus";
|
|
5
|
+
import useFilePwd from "~/composables/file/useFilePwd";
|
|
6
|
+
import useFileDataStore from "~/stores/file-data";
|
|
7
|
+
import useStorageConfigStore from "~/stores/storage-config";
|
|
8
|
+
import useFileLoading from "~/composables/file/useFileLoading";
|
|
9
|
+
|
|
10
|
+
let singleton; // 确保全局唯一实例,避免在子组件中调用时丢失状态(如密码)
|
|
11
|
+
|
|
12
|
+
import useRouterData from "~/composables/useRouterData";
|
|
13
|
+
let { routerRef, routeRef } = useRouterData()
|
|
14
|
+
|
|
15
|
+
export default function useShareData() {
|
|
16
|
+
if (singleton) return singleton;
|
|
17
|
+
|
|
18
|
+
const shareKey = computed(() => routeRef.value.params.shareKey);
|
|
19
|
+
const shareInfo = ref(null);
|
|
20
|
+
const shareVerified = ref(false);
|
|
21
|
+
const sharePassword = ref('');
|
|
22
|
+
const currentPath = ref('/');
|
|
23
|
+
const lastSuccessPath = ref(undefined); // 最后一次成功加载的路径
|
|
24
|
+
const shareInvalid = ref(false);
|
|
25
|
+
const shareErrorMsg = ref('');
|
|
26
|
+
const shareSearchParam = reactive({ orderBy: '', orderDirection: '' });
|
|
27
|
+
|
|
28
|
+
const fileDataStore = useFileDataStore();
|
|
29
|
+
const { popPassword } = useFilePwd();
|
|
30
|
+
const storageConfigStore = useStorageConfigStore();
|
|
31
|
+
const { loading, firstLoading } = useFileLoading();
|
|
32
|
+
|
|
33
|
+
const pushShareRoute = (queryOverrides = {}) => {
|
|
34
|
+
const base = `/share/${encodeURIComponent(shareKey.value)}`;
|
|
35
|
+
const nextQuery = { ...(routeRef.value.query || {}), ...queryOverrides };
|
|
36
|
+
routerRef.value.push({ path: base, query: nextQuery });
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const getParentPath = (p) => {
|
|
40
|
+
const parts = (p || '/').split('/').filter(Boolean);
|
|
41
|
+
parts.pop();
|
|
42
|
+
const parent = '/' + parts.join('/');
|
|
43
|
+
return parent === '//' ? '/' : parent || '/';
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const revertOnCancel = (requestedPath) => {
|
|
47
|
+
// 优先退回到最后一次成功加载的路径,其次退回到传入路径的上级
|
|
48
|
+
const target = (lastSuccessPath.value && lastSuccessPath.value !== requestedPath)
|
|
49
|
+
? lastSuccessPath.value
|
|
50
|
+
: getParentPath(requestedPath || '/');
|
|
51
|
+
if ((routeRef.value.query.path || '/') !== target) {
|
|
52
|
+
pushShareRoute({ path: target });
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const verifySharePassword = async (password) => {
|
|
57
|
+
const res = await verifySharePasswordReq({ shareKey: shareKey.value, password });
|
|
58
|
+
return res.data;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const loadShareFiles = async (path = '/', folderPassword) => {
|
|
62
|
+
loading.value = true;
|
|
63
|
+
try {
|
|
64
|
+
const res = await getShareFileListReq({
|
|
65
|
+
shareKey: shareKey.value,
|
|
66
|
+
path: path || '/',
|
|
67
|
+
password: sharePassword.value,
|
|
68
|
+
folderPassword,
|
|
69
|
+
orderBy: shareSearchParam.orderBy || storageConfigStore.globalConfig.defaultSortField || 'name',
|
|
70
|
+
orderDirection: shareSearchParam.orderDirection || storageConfigStore.globalConfig.defaultSortOrder || 'asc'
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
// 列表加工:文件直链(指向分享下载接口),并在非根目录插入返回上级
|
|
74
|
+
let list = (res.data.fileItemList || []).map(item => {
|
|
75
|
+
if (item.type === 'FILE') {
|
|
76
|
+
const full = item.path ? (item.path.endsWith('/') ? item.path + item.name : item.path + '/' + item.name) : item.name;
|
|
77
|
+
return { ...item, url: getShareFileDownloadUrlReq(shareKey.value, full, sharePassword.value) };
|
|
78
|
+
}
|
|
79
|
+
return item;
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
const cur = res.data.currentPath || path || '/';
|
|
83
|
+
currentPath.value = cur;
|
|
84
|
+
lastSuccessPath.value = cur;
|
|
85
|
+
|
|
86
|
+
if (cur !== '/') {
|
|
87
|
+
const parentPath = res.data.parentPath || getParentPath(cur);
|
|
88
|
+
const parentName = parentPath === '/' ? '/' : parentPath.split('/').filter(Boolean).pop() || '/';
|
|
89
|
+
list = [{ name: parentName, path: parentPath, type: 'BACK' }, ...list];
|
|
90
|
+
}
|
|
91
|
+
fileDataStore.updateFileList(list);
|
|
92
|
+
|
|
93
|
+
storageConfigStore.updateFolderConfig({
|
|
94
|
+
...storageConfigStore.folderConfig,
|
|
95
|
+
permission: res.data.permission || {}
|
|
96
|
+
});
|
|
97
|
+
loading.value = false;
|
|
98
|
+
firstLoading.value = true;
|
|
99
|
+
|
|
100
|
+
if (res.data.shareLinkInfo) {
|
|
101
|
+
shareInfo.value = res.data.shareLinkInfo;
|
|
102
|
+
}
|
|
103
|
+
} catch (error) {
|
|
104
|
+
loading.value = false;
|
|
105
|
+
const data = error?.response?.data;
|
|
106
|
+
if (data?.code === constant.responseCode.INVALID_PASSWORD || data?.code === constant.responseCode.REQUIRED_PASSWORD) {
|
|
107
|
+
// 目录密码:分享模式不展示“记住密码”
|
|
108
|
+
popPassword({ showRemember: false, defaultValue: '' })
|
|
109
|
+
.then(async ({ value }) => {
|
|
110
|
+
await loadShareFiles(path, value);
|
|
111
|
+
})
|
|
112
|
+
.catch(() => {
|
|
113
|
+
// 取消时根据情况回退
|
|
114
|
+
revertOnCancel(path);
|
|
115
|
+
});
|
|
116
|
+
} else {
|
|
117
|
+
console.error('加载分享文件失败:', error);
|
|
118
|
+
ElMessage.error(data?.msg || '加载文件列表失败');
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// 表格排序变更(分享页)
|
|
124
|
+
const sortShareChangeMethod = ({ prop, order }) => {
|
|
125
|
+
shareSearchParam.orderBy = prop;
|
|
126
|
+
shareSearchParam.orderDirection = order === 'descending' ? 'desc' : 'asc';
|
|
127
|
+
const nextPath = routeRef.value.query.path || '/';
|
|
128
|
+
loadShareFiles(nextPath);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const initShare = async () => {
|
|
132
|
+
// 分享信息
|
|
133
|
+
try {
|
|
134
|
+
const shareRes = await getShareInfoReq(shareKey.value);
|
|
135
|
+
shareInfo.value = shareRes.data;
|
|
136
|
+
} catch (error) {
|
|
137
|
+
// 无效分享:记录状态与信息,阻止继续显示密码页
|
|
138
|
+
shareInvalid.value = true;
|
|
139
|
+
shareErrorMsg.value = error?.response?.data?.msg || '分享链接不存在或已失效';
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// URL 中的分享密码
|
|
144
|
+
const urlPassword = routeRef.value.query.pwd;
|
|
145
|
+
if (urlPassword) {
|
|
146
|
+
sharePassword.value = String(urlPassword);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// 记录初始 URL 的 path,以便回退时有依据(若后续成功加载会被覆盖)
|
|
150
|
+
const initPath = routeRef.value.query.path || '/';
|
|
151
|
+
lastSuccessPath.value = undefined; // 未成功加载前置为空
|
|
152
|
+
|
|
153
|
+
if (!shareInfo.value.needPassword || urlPassword) {
|
|
154
|
+
if (urlPassword) {
|
|
155
|
+
const ok = await verifySharePassword(urlPassword);
|
|
156
|
+
if (ok) {
|
|
157
|
+
shareVerified.value = true;
|
|
158
|
+
await loadShareFiles(initPath);
|
|
159
|
+
}
|
|
160
|
+
} else {
|
|
161
|
+
shareVerified.value = true;
|
|
162
|
+
await loadShareFiles(initPath);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
singleton = {
|
|
168
|
+
shareVerified,
|
|
169
|
+
sharePassword,
|
|
170
|
+
shareInvalid,
|
|
171
|
+
shareErrorMsg,
|
|
172
|
+
initShare,
|
|
173
|
+
verifySharePassword,
|
|
174
|
+
loadShareFiles,
|
|
175
|
+
sortShareChangeMethod
|
|
176
|
+
}
|
|
177
|
+
return singleton;
|
|
178
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { computed, ref } from 'vue';
|
|
2
|
+
const routerRef = ref(null);
|
|
3
|
+
const routeRef = ref(null);
|
|
4
|
+
|
|
5
|
+
export default function useRouterData(initRouter, initRoute) {
|
|
6
|
+
|
|
7
|
+
if (initRouter && !routerRef.value) {
|
|
8
|
+
routerRef.value = initRouter;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
if (initRoute && !routeRef.value) {
|
|
12
|
+
routeRef.value = initRoute;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// 当前所在驱动器 key
|
|
16
|
+
const storageKey = computed(() => {
|
|
17
|
+
return routeRef.value?.params.storageKey;
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
// 当前所在目录
|
|
21
|
+
const currentPath = computed(() => {
|
|
22
|
+
if (routeRef.value?.params.fullpath) {
|
|
23
|
+
return '/' + routeRef.value.params.fullpath.join('/');
|
|
24
|
+
} else {
|
|
25
|
+
return '/';
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const fullpath = computed(() => {
|
|
30
|
+
return routeRef.value?.params.fullpath;
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
routeRef,
|
|
35
|
+
routerRef,
|
|
36
|
+
storageKey,
|
|
37
|
+
currentPath,
|
|
38
|
+
fullpath
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
// import ids from 'virtual:svg-icons-names'
|
|
2
|
+
import { version } from '../../package.json'
|
|
3
|
+
|
|
4
|
+
// 自动对 /src/assets/icons 目录下的文件图标进行显示
|
|
5
|
+
const iconFileType = [];
|
|
6
|
+
// ids.forEach(id => {
|
|
7
|
+
// iconFileType.push(id.replace(/^icon-file-type-/, ''));
|
|
8
|
+
// });
|
|
9
|
+
|
|
10
|
+
// 文件分类
|
|
11
|
+
const fileTypeMap = {
|
|
12
|
+
image: ['gif', 'jpg', 'jpeg', 'png', 'bmp', 'webp', 'ico'],
|
|
13
|
+
video: ['mp4', 'webm', 'm3u8', 'rmvb', 'avi', 'swf', '3gp', 'mkv', 'flv'],
|
|
14
|
+
audio: ['mp3', 'wav', 'wma', 'ogg', 'aac', 'flac', 'm4a'],
|
|
15
|
+
text: ['scss', 'sass', 'kt', 'gitignore', 'bat', 'properties', 'yml', 'css', 'js', 'md', 'xml', 'txt', 'py', 'go', 'html', 'less', 'php', 'rb', 'rust', 'script', 'java', 'sh', 'sql'],
|
|
16
|
+
executable: ['exe', 'dll', 'com', 'vbs'],
|
|
17
|
+
archive: ['7z', 'zip', 'rar', 'tar', 'gz'],
|
|
18
|
+
pdf: ['pdf'],
|
|
19
|
+
office: ['doc', 'docx', 'csv', 'xls', 'xlsx', 'ppt', 'pptx', 'xlsm'],
|
|
20
|
+
three3d: ['dae', 'fbx', 'gltf', 'glb', 'obj', 'ply', 'stl'],
|
|
21
|
+
document: ['pages', 'epub', 'numbers', 'keynote'],
|
|
22
|
+
kkfileview: [
|
|
23
|
+
'doc', 'docx', 'xls', 'xlsx', 'xlsm', 'ppt', 'pptx', 'csv', 'tsv', 'dotm', 'xlt', 'xltm', 'dot', 'dotx', 'xlam', 'xla', 'pages', // Office 办公文档
|
|
24
|
+
'wps', 'dps', 'et', 'ett', 'wpt', // 国产 WPS Office 办公文档
|
|
25
|
+
'odt', 'ods', 'ots', 'odp', 'otp', 'six', 'ott', 'fodt', 'fods', // OpenOffice、LibreOffice 办公文档
|
|
26
|
+
'vsd', 'vsdx', // Visio 流程图文件
|
|
27
|
+
'wmf', 'emf', // Windows 系统图像文件
|
|
28
|
+
'psd', 'eps', // Photoshop 软件模型文件
|
|
29
|
+
'pdf', 'ofd', 'rtf', // 文档
|
|
30
|
+
'xmind', // Xmind 软件模型文件
|
|
31
|
+
'bpmn', // 工作流文件
|
|
32
|
+
'eml', // 邮件文件
|
|
33
|
+
'epub', // 图书文档
|
|
34
|
+
'obj', '3ds', 'stl', 'ply', 'gltf', 'glb', 'off', '3dm', 'fbx', 'dae', 'wrl', '3mf', 'ifc', 'brep', 'step', 'iges', 'fcstd', 'bim', // 3D 模型文件
|
|
35
|
+
'dwg', 'dxf', 'dwf', 'igs', 'dwt', 'dng', 'dwfx', 'cf2', 'plt', // CAD 模型文件 (部分与3D模型重复,但根据您的描述保留)
|
|
36
|
+
'txt', 'xml', 'md', 'java', 'php', 'py', 'js', 'css', // 纯文本文件
|
|
37
|
+
'zip', 'rar', 'jar', 'tar', 'gzip', '7z', // 压缩包文件
|
|
38
|
+
'jpg', 'jpeg', 'png', 'gif', 'bmp', 'ico', 'jfif', 'webp', // 图片预览
|
|
39
|
+
'tif', 'tiff', // 图信息模型文件
|
|
40
|
+
'tga', // 图像格式文件
|
|
41
|
+
'svg', // 矢量图像格式文件
|
|
42
|
+
'mp3', 'wav', 'mp4', 'flv', // 音频和常见视频格式
|
|
43
|
+
'avi', 'mov', 'rm', 'webm', 'ts', 'mkv', 'mpeg', 'ogg', 'mpg', 'rmvb', 'wmv', '3gp', 'swf', // 视频格式转码预览
|
|
44
|
+
'dcm', // 医疗数位影像预览
|
|
45
|
+
'drawio' // 绘图预览
|
|
46
|
+
],
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
// 可预览的文件类型
|
|
50
|
+
const previewFileType = ['image', 'video', 'audio', 'text', 'office', 'pdf', 'three3d'];
|
|
51
|
+
|
|
52
|
+
// 响应码
|
|
53
|
+
const responseCode = {
|
|
54
|
+
REQUIRED_PASSWORD: '41020',
|
|
55
|
+
INVALID_PASSWORD: '41021',
|
|
56
|
+
UNAUTHORIZED: '42000',
|
|
57
|
+
FORBIDDEN: '30000',
|
|
58
|
+
BAD_REQUEST: '41000',
|
|
59
|
+
SUCCESS: '0',
|
|
60
|
+
PRO_CHECK_PREFIX: '2000',
|
|
61
|
+
ERROR: '-1',
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// 存储源类型
|
|
65
|
+
const storageType = {
|
|
66
|
+
s3Type: ['s3', 'tencent', 'aliyun', 'qiniu', 'minio', 'huawei', 'doge-cloud']
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const timeUnits = {
|
|
70
|
+
's': '秒',
|
|
71
|
+
'm': '分',
|
|
72
|
+
'h': '时',
|
|
73
|
+
'd': '天',
|
|
74
|
+
'w': '周',
|
|
75
|
+
'M': '月',
|
|
76
|
+
'y': '年',
|
|
77
|
+
'forever': '永久'
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const timeUnitArr = [
|
|
81
|
+
{ label: '秒', value: 's' },
|
|
82
|
+
{ label: '分', value: 'm' },
|
|
83
|
+
{ label: '时', value: 'h' },
|
|
84
|
+
{ label: '天', value: 'd' },
|
|
85
|
+
{ label: '周', value: 'w' },
|
|
86
|
+
{ label: '月', value: 'M' },
|
|
87
|
+
{ label: '年', value: 'y' },
|
|
88
|
+
{ label: '永久', value: 'forever' }
|
|
89
|
+
]
|
|
90
|
+
|
|
91
|
+
let region = {
|
|
92
|
+
aliyun: [
|
|
93
|
+
{name: '华东 1(杭州)', val: 'oss-cn-hangzhou.aliyuncs.com'},
|
|
94
|
+
{name: '华东 2(上海)', val: 'oss-cn-shanghai.aliyuncs.com'},
|
|
95
|
+
{name: '华东5(南京-本地地域)', val: 'oss-cn-nanjing.aliyuncs.com'},
|
|
96
|
+
{name: '华东6(福州-本地地域)', val: 'oss-cn-fuzhou.aliyuncs.com'},
|
|
97
|
+
{name: '华中1(武汉-本地地域)', val: 'oss-cn-wuhan-lr.aliyuncs.com'},
|
|
98
|
+
{name: '华北 1(青岛)', val: 'oss-cn-qingdao.aliyuncs.com'},
|
|
99
|
+
{name: '华北 2(北京)', val: 'oss-cn-beijing.aliyuncs.com'},
|
|
100
|
+
{name: '华北 3(张家口)', val: 'oss-cn-zhangjiakou.aliyuncs.com'},
|
|
101
|
+
{name: '华北 5(呼和浩特)', val: 'oss-cn-huhehaote.aliyuncs.com'},
|
|
102
|
+
{name: '华北 6(乌兰察布)', val: 'oss-cn-wulanchabu.aliyuncs.com'},
|
|
103
|
+
{name: '华南 1(深圳)', val: 'oss-cn-shenzhen.aliyuncs.com'},
|
|
104
|
+
{name: '华南 2(河源)', val: 'oss-cn-heyuan.aliyuncs.com'},
|
|
105
|
+
{name: '华南 3(广州)', val: 'oss-cn-guangzhou.aliyuncs.com'},
|
|
106
|
+
{name: '西南 1(成都)', val: 'oss-cn-chengdu.aliyuncs.com'},
|
|
107
|
+
{name: '中国香港', val: 'oss-cn-hongkong.aliyuncs.com'},
|
|
108
|
+
{name: '美国(硅谷)', val: 'oss-us-west-1.aliyuncs.com'},
|
|
109
|
+
{name: '美国(弗吉尼亚)', val: 'oss-us-east-1.aliyuncs.com'},
|
|
110
|
+
{name: '日本(东京)', val: 'oss-ap-northeast-1.aliyuncs.com'},
|
|
111
|
+
{name: '韩国(首尔)', val: 'oss-ap-northeast-2.aliyuncs.com'},
|
|
112
|
+
{name: '新加坡', val: 'oss-ap-southeast-1.aliyuncs.com'},
|
|
113
|
+
{name: '澳大利亚 (悉尼)', val: 'oss-ap-southeast-2.aliyuncs.com'},
|
|
114
|
+
{name: '马来西亚 (吉隆坡)', val: 'oss-ap-southeast-3.aliyuncs.com'},
|
|
115
|
+
{name: '印度尼西亚 (雅加达)', val: 'oss-ap-southeast-5.aliyuncs.com'},
|
|
116
|
+
{name: '菲律宾(马尼拉)', val: 'oss-ap-southeast-6.aliyuncs.com'},
|
|
117
|
+
{name: '泰国(曼谷)', val: 'oss-ap-southeast-7.aliyuncs.com'},
|
|
118
|
+
{name: '印度(孟买)', val: 'oss-ap-south-1.aliyuncs.com'},
|
|
119
|
+
{name: '德国(法兰克福)', val: 'oss-eu-central-1.aliyuncs.com'},
|
|
120
|
+
{name: '英国(伦敦)', val: 'oss-eu-west-1.aliyuncs.com'},
|
|
121
|
+
{name: '阿联酋(迪拜)', val: 'oss-me-east-1.aliyuncs.com'},
|
|
122
|
+
{name: '无地域属性(中国内地)', val: 'oss-rg-china-mainland.aliyuncs.com'},
|
|
123
|
+
|
|
124
|
+
{name: '杭州金融云公网', val: 'oss-cn-hzfinance.aliyuncs.com'},
|
|
125
|
+
{name: '上海金融云公网', val: 'oss-cn-shanghai-finance-1-pub.aliyuncs.com'},
|
|
126
|
+
{name: '深圳金融云公网', val: 'oss-cn-szfinance.aliyuncs.com'},
|
|
127
|
+
{name: '北京金融云公网', val: 'oss-cn-beijing-finance-1-pub.aliyuncs.com'}
|
|
128
|
+
],
|
|
129
|
+
tencent: [
|
|
130
|
+
{name: '北京一区', val: 'cos.ap-beijing-1.myqcloud.com'},
|
|
131
|
+
{name: '北京', val: 'cos.ap-beijing.myqcloud.com'},
|
|
132
|
+
{name: '南京', val: 'cos.ap-nanjing.myqcloud.com'},
|
|
133
|
+
{name: '上海', val: 'cos.ap-shanghai.myqcloud.com'},
|
|
134
|
+
{name: '广州', val: 'cos.ap-guangzhou.myqcloud.com'},
|
|
135
|
+
{name: '成都', val: 'cos.ap-chengdu.myqcloud.com'},
|
|
136
|
+
{name: '重庆', val: 'cos.ap-chongqing.myqcloud.com'},
|
|
137
|
+
{name: '深圳金融', val: 'cos.ap-shenzhen-fsi.myqcloud.com'},
|
|
138
|
+
{name: '上海金融', val: 'cos.ap-shanghai-fsi.myqcloud.com'},
|
|
139
|
+
{name: '北京金融', val: 'cos.ap-beijing-fsi.myqcloud.com'},
|
|
140
|
+
{name: '中国香港', val: 'cos.ap-hongkong.myqcloud.com'},
|
|
141
|
+
{name: '新加坡', val: 'cos.ap-singapore.myqcloud.com'},
|
|
142
|
+
{name: '孟买', val: 'cos.ap-mumbai.myqcloud.com'},
|
|
143
|
+
{name: '雅达加', val: 'cos.ap-jakarta.myqcloud.com'},
|
|
144
|
+
{name: '首尔', val: 'cos.ap-seoul.myqcloud.com'},
|
|
145
|
+
{name: '曼谷', val: 'cos.ap-bangkok.myqcloud.com'},
|
|
146
|
+
{name: '东京', val: 'cos.ap-tokyo.myqcloud.com'},
|
|
147
|
+
{name: '硅谷(美西)', val: 'cos.na-siliconvalley.myqcloud.com'},
|
|
148
|
+
{name: '弗吉尼亚(美东)', val: 'cos.na-ashburn.myqcloud.com'},
|
|
149
|
+
{name: '多伦多', val: 'cos.na-toronto.myqcloud.com'},
|
|
150
|
+
{name: '圣保罗', val: 'cos.sa-saopaulo.myqcloud.com'},
|
|
151
|
+
{name: '法兰克福', val: 'cos.eu-frankfurt.myqcloud.com'}
|
|
152
|
+
],
|
|
153
|
+
huawei: [
|
|
154
|
+
{name: '非洲-约翰内斯堡', val: 'obs.af-south-1.myhuaweicloud.com'},
|
|
155
|
+
{name: '华北-北京四', val: 'obs.cn-north-4.myhuaweicloud.com'},
|
|
156
|
+
{name: '华北-北京一', val: 'obs.cn-north-1.myhuaweicloud.com'},
|
|
157
|
+
{name: '华北-乌兰察布一', val: 'obs.cn-north-9.myhuaweicloud.com'},
|
|
158
|
+
{name: '华东-上海二', val: 'obs.cn-east-2.myhuaweicloud.com'},
|
|
159
|
+
{name: '华东-上海一', val: 'obs.cn-east-3.myhuaweicloud.com'},
|
|
160
|
+
{name: '华南-广州', val: 'obs.cn-south-1.myhuaweicloud.com'},
|
|
161
|
+
{name: '华南-广州-友好用户环境', val: 'obs.cn-south-4.myhuaweicloud.com'},
|
|
162
|
+
|
|
163
|
+
{name: '拉美-墨西哥城一', val: 'obs.la-north-2.myhuaweicloud.com'},
|
|
164
|
+
{name: '拉美-墨西哥城一', val: 'obs.na-mexico-1.myhuaweicloud.com'},
|
|
165
|
+
{name: '拉美-圣保罗一', val: 'obs.sa-brazil-1.myhuaweicloud.com'},
|
|
166
|
+
{name: '拉美-圣地亚哥', val: 'obs.la-south-2.myhuaweicloud.com'},
|
|
167
|
+
{name: '土耳其-伊斯坦布尔', val: 'obs.tr-west-1.myhuaweicloud.com'},
|
|
168
|
+
|
|
169
|
+
{name: '西南-贵阳一', val: 'obs.cn-southwest-2.myhuaweicloud.com'},
|
|
170
|
+
{name: '亚太-曼谷', val: 'obs.ap-southeast-2.myhuaweicloud.com'},
|
|
171
|
+
{name: '亚太-新加坡', val: 'obs.ap-southeast-3.myhuaweicloud.com'},
|
|
172
|
+
{name: '中东-利雅得', val: 'obs.me-east-1.myhuaweicloud.com'},
|
|
173
|
+
{name: '中国-香港', val: 'obs.ap-southeast-1.myhuaweicloud.com'},
|
|
174
|
+
],
|
|
175
|
+
qiniu: [
|
|
176
|
+
{name: '华东-浙江', val: 's3-cn-east-1.qiniucs.com'},
|
|
177
|
+
{name: '华东-浙江2', val: 's3-cn-east-2.qiniucs.com'},
|
|
178
|
+
{name: '华北-河北', val: 's3-cn-north-1.qiniucs.com'},
|
|
179
|
+
{name: '华南-广东', val: 's3-cn-south-1.qiniucs.com'},
|
|
180
|
+
{name: '北美-洛杉矶', val: 's3-us-north-1.qiniucs.com'},
|
|
181
|
+
{name: '亚太-新加坡(东南亚)', val: 's3-ap-southeast-1.qiniucs.com'},
|
|
182
|
+
]
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
const systemNames = ['admin', 'user', 'file', 'login', 'install', 's', 'share', 'onedrive', 'api', 'sharepoint', 's3', 'webdav', 'pd', 'gd', 'onlyOffice', '401', '403', '404', '500', 'guest'];
|
|
186
|
+
const disableUrlChars = ['+', ' ', '/', '?', '%', '=', '&', '#']
|
|
187
|
+
|
|
188
|
+
export const constant = {
|
|
189
|
+
iconFileType, fileTypeMap, previewFileType,
|
|
190
|
+
version, responseCode, storageType,
|
|
191
|
+
timeUnits, timeUnitArr,
|
|
192
|
+
region, systemNames, disableUrlChars
|
|
193
|
+
}
|