Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support multiple versions(支持多版本操作) #326

Open
wants to merge 388 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
388 commits
Select commit Hold shift + click to select a range
baaa39b
Merge pull request #83 from aliyun/dev
aleelock Jan 25, 2018
b80a2d7
修复临时授权码登录预览图片的bug,releaseNotes国际化
aleelock Jan 30, 2018
44dd89d
增加上传目录按钮。
aleelock Jan 30, 2018
9c1a965
fix
aleelock Jan 30, 2018
37b33bc
右键菜单增加下载目录
aleelock Jan 30, 2018
91e07e5
调整初始化窗口大小宽度
aleelock Jan 30, 2018
f3e3f66
兼容老版本获取releaseNotes
aleelock Jan 30, 2018
b107bae
Merge pull request #85 from aliyun/dev
aleelock Jan 30, 2018
e001cbe
Merge branch 'dev' of github.com:aliyun/oss-browser into dev
Jan 31, 2018
7e6aa80
修复上传文件夹按钮。 修复windows下自动升级。
aleelock Jan 31, 2018
d594e8c
Merge branch 'dev' of github.com:aliyun/oss-browser into dev
Jan 31, 2018
a0b0ab6
windows x64自动升级不一样
Jan 31, 2018
63d72c2
待验证
Jan 31, 2018
5598483
修复windows自动升级
aleelock Feb 1, 2018
7395dea
修复全量升级模式
aleelock Feb 1, 2018
4e8866e
move file
aleelock Feb 1, 2018
753967b
fixwindow 普通文件上传
aleelock Feb 1, 2018
aa1744b
fix about页面
aleelock Feb 1, 2018
09e30ec
Update 1.5.3.zh-CN.md
aleelock Feb 1, 2018
a97b03a
Update 1.5.3.zh-CN.md
aleelock Feb 1, 2018
f6e48c9
Update 1.5.3.zh-CN.md
aleelock Feb 1, 2018
53bf670
Update 1.5.3.zh-CN.md
aleelock Feb 1, 2018
fd008f8
Update 1.5.3.ja-JP.md
aleelock Feb 1, 2018
b932446
Update 1.5.3.en-US.md
aleelock Feb 1, 2018
e77daaa
Update 1.5.3.zh-CN.md
aleelock Feb 1, 2018
98e2c82
Update 1.5.3.zh-CN.md
aleelock Feb 1, 2018
0b953cd
Update 1.5.3.ja-JP.md
aleelock Feb 1, 2018
e81ae91
Update 1.5.3.en-US.md
aleelock Feb 1, 2018
2efa390
Merge pull request #88 from aliyun/dev
aleelock Feb 1, 2018
806f041
1. 增加 STS Token AK 登录功能。2. 修复较早前创建的 bucket 的访问 endpoint 不正确的 bug。
aleelock Feb 9, 2018
77e7422
修复翻译
aleelock Feb 9, 2018
4eeaf2f
Merge pull request #94 from aliyun/dev
aleelock Feb 9, 2018
461c615
修复endpoint不支持https和内部域名的bug。
aleelock Mar 12, 2018
961fe12
默认改成http
aleelock Mar 13, 2018
c2b30ee
fix
aleelock Mar 13, 2018
6d55369
Merge pull request #99 from aliyun/dev
aleelock Mar 13, 2018
bff7353
修复部分客户端由于内网环境判断条件错误无法登录的bug
aleelock Mar 23, 2018
2994a0d
Merge pull request #103 from aliyun/dev
aleelock Mar 23, 2018
4dcb639
创建临时授权码时,没有角色,增加去创建角色链接
aleelock Apr 4, 2018
3127648
Mutipart->Multipart
aleelock Apr 4, 2018
5438bb7
下载页面增加打开本地文件夹按钮
aleelock Apr 4, 2018
91a5f92
update version
aleelock Apr 4, 2018
d855b74
修改中文releastnote
aleelock Apr 4, 2018
f91f355
Merge pull request #104 from aliyun/dev
aleelock Apr 8, 2018
d1b1fbe
修复预览时的缓存问题,修复日语翻译。
aleelock Apr 20, 2018
19453ed
格式
aleelock Apr 20, 2018
62fc5db
Merge pull request #106 from aliyun/dev
aleelock Apr 20, 2018
aed3b5c
feat: add keyboard support about ‘Comman+H’ which aims to hide the wi…
duan007a Apr 19, 2018
7dacf0c
fix: fix get object’s download url which is not contains signature an…
duan007a Apr 19, 2018
0a2e585
feat: add new regions
duan007a Apr 19, 2018
49a5d28
Revert "fix: fix get object’s download url which is not contains sign…
duan007a Apr 23, 2018
1ec07b7
chore: update dependencies
duan007a Apr 23, 2018
86d43b6
fix: fix bug about using sts to log in browser, object's generated do…
duan007a Apr 23, 2018
caf9663
style: update translation
duan007a Apr 23, 2018
8769a3f
fix: fix bug when user use custom endpoint and osspath to login,objec…
duan007a Apr 24, 2018
ceb1932
fix: fix bug about using sts to log in browser, media object's genera…
duan007a Apr 24, 2018
cd2c853
chore: update zh-CN.js
duan007a Apr 24, 2018
9556d1a
refactor: modify regexp
duan007a Apr 24, 2018
0195749
Merge pull request #107 from aliyun/dev_feat
aleelock Apr 24, 2018
046749d
feat: add help about role!
duan007a Apr 28, 2018
fc2db6d
feat: batch delete files
duan007a May 4, 2018
a951716
Merge pull request #109 from aliyun/dev_batchDeleteFiles
aleelock May 8, 2018
bde0d6e
Merge pull request #111 from aliyun/feat_help
aleelock May 8, 2018
647160b
chore: update electron to 1.8.4
duan007a May 9, 2018
2059975
chore: build crc64 on linux_x64
duan007a May 9, 2018
bf2d3cd
chore: update electron to 1.8.4 on linux-32bit
duan007a May 9, 2018
09522f7
chore: update electron to 1.8.4 on windows x64
duan007a May 9, 2018
c59e3a7
chore: update electron to 1.8.4 on win32-ia32
duan007a May 10, 2018
f052b8f
docs: add release-notes
duan007a May 21, 2018
68d2f01
chore: fix syntax error.
duan007a May 21, 2018
1e5c7f7
test: test for auto-upgrade
duan007a May 21, 2018
e79d370
test: update package’s url
duan007a May 21, 2018
1a4fd8c
fix: fix package version
duan007a May 21, 2018
f248a2f
release: 1.7.0 release.
duan007a May 21, 2018
fcf7be1
fix: delete node_modules under folder which named electron-crc64-preb…
duan007a May 21, 2018
7a9e1f8
Merge pull request #113 from aliyun/dev_electron1.8.4
duan007a May 21, 2018
f1a9d85
Merge pull request #114 from aliyun/dev
duan007a May 22, 2018
1f3f2c0
修复 简化Policy授权 对bucket进行授权时发出的邮件reigion和comment字段值不正确的bug
duan007a May 22, 2018
285b699
修复 简化Policy授权 时发送邮件内容有错误的问题
duan007a May 23, 2018
d3270fd
fix: 修复使用自定义的endpoint(比如http://cn-hangzhou.oss.aliyun-inc.com) 登录时对ob…
duan007a May 24, 2018
c97bf0f
fix: modify max limit of expires for signatureUrl
duan007a Jun 1, 2018
5109b71
fix: 修复小权限子账户(只有特定的bucket权限)在回到buckets视图时显示没有权限,然后再次回到bucket内部时提示的No …
duan007a Jun 1, 2018
4e70a75
Ignores certificate related errors.参考文档https://github.com/electron/el…
duan007a Jul 12, 2018
219397f
release1.7.1
duan007a Jul 12, 2018
b12b047
update readme.md
duan007a Jul 12, 2018
b3a4429
修改切换账户时备注信息没有更新的bug
duan007a Jul 12, 2018
4b6e2d7
update readme
duan007a Jul 12, 2018
2ab9da9
Merge pull request #128 from aliyun/fix/fixPolicyToEmail
aleelock Jul 12, 2018
dc88af3
修改格式
duan007a Jul 12, 2018
364c213
Merge pull request #130 from aliyun/fix/fixPolicyToEmail
aleelock Jul 12, 2018
08f3096
Merge pull request #129 from aliyun/dev
aleelock Jul 12, 2018
77b6fc4
修复当bucket的acl为公共读时对名称带有特殊字符的object生成下载链接会导致无法生成的bug
duan007a Jul 23, 2018
e9e0c6b
1.新增完全控制选项,读写权限限制到读写操作。
duan007a Jul 27, 2018
6be178a
修改1.7.1的版本描述信息
duan007a Aug 3, 2018
fdcdc5c
添加默认分隔符/,在小权限子账户登录时有可能因为没有设置分隔符导致403错误
duan007a Aug 7, 2018
6c0c2eb
Merge pull request #135 from aliyun/dhc/bugfix
aleelock Aug 7, 2018
fbb8cac
图片预览大于5M的文件不支持预览
duan007a Aug 21, 2018
7d47f8f
修改文案公有云为公共云
duan007a Aug 21, 2018
06d9a77
根据acl来生成文件下载链接
duan007a Aug 21, 2018
36004d6
修改邮件设置的帮助描述
duan007a Aug 21, 2018
5ba0ca0
添加英语翻译
duan007a Aug 22, 2018
e787704
日文翻译
duan007a Aug 27, 2018
20ffa47
删除单个文件时调用delete接口,删除多个文件时再调用deleteMulti接口
duan007a Aug 27, 2018
d491d99
Merge pull request #142 from aliyun/dhc/bugfix
aleelock Aug 29, 2018
83559bd
修复acl获取的bug
duan007a Aug 29, 2018
71c8c70
release 1.7.2
duan007a Aug 29, 2018
1d42d66
Merge pull request #143 from aliyun/dev
duan007a Aug 30, 2018
ec5aa63
修改生成可用下载链接的逻辑
duan007a Sep 12, 2018
8c30179
修改验证发送邮箱合法性的正则表达式
duan007a Sep 18, 2018
60dd55d
bucket名称无效时给予用户提示
duan007a Sep 18, 2018
258f12a
electron-packager命令行工具选项 app-version release version to set f…
duan007a Sep 19, 2018
30a3ecd
Merge pull request #149 from aliyun/generate_download_url
aleelock Sep 19, 2018
c7a16cd
解决object公共读时生成的url会将/替换为%2F的问题
duan007a Sep 19, 2018
6882742
1.7.3 release info
duan007a Sep 19, 2018
4c2a189
Merge pull request #151 from aliyun/generate_download_url
duan007a Sep 19, 2018
474ad73
Merge pull request #153 from aliyun/dev
duan007a Sep 25, 2018
9c75b47
chore:modify gitignore and add debugger in Makefeile ,change ELECTON …
luozhang002 Oct 10, 2018
087ceb5
fix: keep same code style with es5 between main process and renderer …
luozhang002 Oct 12, 2018
d05d930
chore: eslint main.js
luozhang002 Oct 15, 2018
af71291
chore: eslint
luozhang002 Oct 15, 2018
d5cd3f2
refactor: 1.add ali-oss insteadof script 2.adjust index.html code 3.a…
luozhang002 Oct 15, 2018
a09abfe
chore: add attention and debug document for developper
luozhang002 Oct 16, 2018
cfd57a6
feat: support >5M image for preview
luozhang002 Oct 17, 2018
76553b5
docs: support pr request
luozhang002 Oct 22, 2018
b74674f
feat: support london
luozhang002 Oct 22, 2018
e310a2d
fix: maxium stack size error
luozhang002 Oct 23, 2018
e5549a4
chore: modify version 1.7.4
luozhang002 Nov 1, 2018
c26efa2
fix: fix big mistake
luozhang002 Nov 6, 2018
801bea0
Merge pull request #160 from aliyun/chore_luozhang
duan007a Nov 6, 2018
1cb6d8c
fix: remove unuse Exclamation mark
luozhang002 Nov 6, 2018
41b229a
Merge pull request #161 from aliyun/chore_luozhang
luozhang002 Nov 6, 2018
089490e
Merge pull request #163 from aliyun/dev
duan007a Nov 8, 2018
279bbbc
docs: add english readme.md
luozhang002 Nov 28, 2018
c928de1
Merge pull request #169 from aliyun/english
luozhang002 Nov 28, 2018
ae50346
feat: add local log
luozhang002 Nov 29, 2018
c1f5e6b
feat:support timeout and uploadPartSizeConfiguration
luozhang002 Nov 29, 2018
5324c6f
fix: modify uploadPartSize and connectionTimeout defalutvalue
luozhang002 Nov 29, 2018
abd09e4
feat:add uploadAndDowonload retry times
luozhang002 Dec 3, 2018
0cf8dc6
feat: add retry status and display retry status
luozhang002 Dec 3, 2018
4c3ccc7
fix: add upload part retry times
luozhang002 Dec 4, 2018
ba0eb5b
feat: add version 1.8.0 changelog in chinese
luozhang002 Dec 4, 2018
b297aa0
fix: remove connectTimeout refresh and add danwei Tips
luozhang002 Dec 5, 2018
728438c
增加IMM文档预览功能,增加PDF预览功能
aleelock Dec 6, 2018
4490825
feat: pulich 1.8.X check
luozhang002 Dec 9, 2018
b4f02c4
Merge pull request #172 from aliyun/1.8.X
luozhang002 Dec 11, 2018
7292251
docs: modify README_CN.md
luozhang002 Dec 11, 2018
952c9b5
Merge pull request #173 from aliyun/1.8.X
luozhang002 Dec 11, 2018
a2d28a2
Merge pull request #174 from aliyun/dev
luozhang002 Dec 11, 2018
524d418
publish: 1.8.1 support only pdf
luozhang002 Dec 17, 2018
835a09b
Merge pull request #177 from aliyun/1.8.X
luozhang002 Dec 17, 2018
ee57749
Merge pull request #178 from aliyun/dev
luozhang002 Dec 17, 2018
0dd2afc
feat: support reqeustpay and cname
luozhang002 Jan 7, 2019
9607932
chore: eslint
luozhang002 Jan 7, 2019
8000b61
chore: modify version and docs
luozhang002 Jan 8, 2019
f08325d
docs: docs
luozhang002 Jan 8, 2019
1431518
docs:modify platform
luozhang002 Jan 8, 2019
5bd33bb
docs: docs
luozhang002 Jan 8, 2019
e822569
docs: update docs
luozhang002 Jan 10, 2019
90a2a8f
chore: update Makefile
luozhang002 Jan 10, 2019
ecf7c12
docs:docs english
luozhang002 Jan 10, 2019
e494727
chore: remove unuse log
luozhang002 Jan 10, 2019
de227cc
docs: update docs
luozhang002 Jan 10, 2019
a680725
docs: supports->support
luozhang002 Jan 10, 2019
7d38de1
Merge pull request #186 from aliyun/1.9.0
luozhang002 Jan 10, 2019
9266cc2
fix: REPLACE->COPY
luozhang002 Jan 14, 2019
e946b04
fix: setHeader ContentEncoding
luozhang002 Jan 14, 2019
8652f74
chore: 1.9.1
luozhang002 Jan 16, 2019
f519267
Merge pull request #192 from aliyun/1.9_fix
luozhang002 Jan 16, 2019
5936bb8
docs: add question document
luozhang002 Jan 21, 2019
414f478
Merge pull request #196 from aliyun/question
luozhang002 Jan 21, 2019
b2597ea
docs: 添加QQ邮箱发送注意事项
luozhang002 Jan 29, 2019
955f4d5
docs:question
luozhang002 Jan 30, 2019
b31b7d8
Merge pull request #199 from aliyun/question_docs
luozhang002 Jan 30, 2019
feee257
FEAT: add batch restore and fix prompt copy
Jun 21, 2019
6bf65f0
FEAT:fix_reg
Jun 21, 2019
c02ee3b
Merge pull request #222 from Ari1c/wb552128fix_restore
luozhang002 Jun 21, 2019
052ccd2
Merge pull request #225 from aliyun/luozhang_CZM
luozhang002 Jun 28, 2019
71bd9cf
fix file move bug
Jun 28, 2019
f0c15dc
Merge pull request #227 from Ari1c/wb552128_fix-bug
luozhang002 Jun 28, 2019
858d09c
fix file move bug
Jun 28, 2019
f2094f4
Merge pull request #229 from Ari1c/wb552128fix_bug
luozhang002 Jun 28, 2019
4b91323
add DingTalk Qr code
Jul 3, 2019
4b2ad72
fix img size
Jul 3, 2019
2a6cf23
fix size
Jul 3, 2019
0e2cdb8
Merge pull request #231 from Ari1c/add_qr_code
luozhang002 Jul 3, 2019
60dc876
Merge pull request #232 from aliyun/luozhang_CZM
luozhang002 Jul 4, 2019
3eb9f8f
upload
Jul 4, 2019
fea97ca
oss qrcode
Jul 4, 2019
75bb7af
png
Jul 4, 2019
3287e6b
Merge pull request #233 from Ari1c/add_qr_code
luozhang002 Jul 5, 2019
0fb9b90
Merge pull request #234 from aliyun/luozhang_CZM
luozhang002 Jul 5, 2019
36ef6ce
FEAT:fix and add chengdu region
Jul 5, 2019
5a0af6a
upload japanese
Jul 5, 2019
388c5a2
JP translation
Jul 8, 2019
698eba1
Merge pull request #236 from Ari1c/wb552128-fix_move
luozhang002 Jul 8, 2019
95c037c
CHORE: makefile 1.9.3->1.9.4
luozhang002 Jul 8, 2019
1337e24
eg translation
Jul 8, 2019
8ad6b64
Merge pull request #238 from Ari1c/wb552128-fix_move
luozhang002 Jul 8, 2019
36d77ae
Merge pull request #237 from aliyun/luozhang_CZM
luozhang002 Jul 9, 2019
84a2b5e
add DingTalk group
Jul 10, 2019
6cdc0d0
add issue template
Jul 10, 2019
a957b8c
Merge pull request #241 from Ari1c/wb552128-issueTemplate
luozhang002 Jul 10, 2019
a9207c8
Merge pull request #242 from aliyun/luozhang_CZM
luozhang002 Jul 10, 2019
4c84032
FIX: 关闭预览PDF功能,更新日志设置、子用户管理搜索文案
Aug 29, 2019
fb0afa3
Merge pull request #251 from Ari1c/wb552128-preview-pdf
luozhang002 Aug 29, 2019
dda4b2f
Merge pull request #252 from aliyun/luozhang_CZM
luozhang002 Sep 2, 2019
917f09d
fix: remove files
PeterRao Sep 15, 2019
150cf82
fix: reduce app size
PeterRao Sep 16, 2019
a7a9606
Merge pull request #274 from aliyun/fix/cleanfile
luozhang002 Nov 19, 2019
131cba5
FIX: change acl add tips (#280)
Ari1c Nov 27, 2019
3a9ad24
feat: optimize file download speed (#282)
PeterRao Dec 2, 2019
9b24b77
chore: bump 1.10.0
PeterRao Dec 4, 2019
d08f944
feat: add heyuan region (#296)
Ari1c Feb 26, 2020
8dde4fa
fix: add certificate error ignore
PeterRao Mar 10, 2020
650b821
fix: set NODE_TLS_REJECT_UNAUTHORIZED
PeterRao Mar 11, 2020
6a188b1
fix: url error
Apr 13, 2020
77379b0
chore: add lint-staged (#305)
beajer Apr 27, 2020
eb03f18
feat: 允许批量设置http头,getMeta改为通过ali-oss node api获取 (#309)
beajer Apr 29, 2020
7eb9c7b
feat: 新增保持登录状态 (#311)
beajer May 6, 2020
5fd8877
feat: 默认方式登录时,下载地址可选自有域名 (#304)
beajer May 7, 2020
396e51c
Merge branch 'fix/https_error' into develop
May 7, 2020
bf5006d
chore: bump 1.11.0
May 7, 2020
b1c7cde
Style/prettier (#314)
beajer May 12, 2020
a556251
chore: 移动angular-tanslate,解除fs_events依赖 (#317)
beajer May 13, 2020
c48f905
fix: add ststoken
May 22, 2020
0953017
fix: item osspath
May 22, 2020
a06a5c2
fix: try to fix ubuntu (#320)
beajer May 27, 2020
13cf45d
feat: 记住登录时的endpoint类型 (#316)
beajer Jun 2, 2020
ac20d10
feat: 请求错误时提示requestId且复制 (#322)
beajer Jun 2, 2020
92d9880
feat: 多版本功能开发
beajer Jun 2, 2020
661b4fd
feat: login requestId
beajer Jun 2, 2020
07610bc
fix:获取code类型的文件预览时,使用ali-oss的get方法node调用,取代ALY.OSS的getObject方法;delete…
beajer Jun 4, 2020
0b43f60
chore: update ali-oss
beajer Jun 8, 2020
a3756dd
chore: lose rules for semi and quotes
beajer Jun 8, 2020
8210059
feat: 多版本功能开发
beajer Jun 2, 2020
6c5d856
feat: login requestId
beajer Jun 2, 2020
d071cb8
chore: update ali-oss
beajer Jun 8, 2020
ecff7a3
chore: lose rules for semi and quotes
beajer Jun 8, 2020
5cbc7a3
Merge branch 'feat/multi_versions' of https://github.com/beajer/oss-b…
beajer Jun 8, 2020
f3500ed
feat: i18n
beajer Jun 8, 2020
adccb47
fix: 获取地址,显示自定义域名列表某些情况不及时更新的问题 (#329)
beajer Jun 12, 2020
6539037
fix: 历史版本模式下,文件夹及删除标记文件大部分操作不可用
beajer Jun 23, 2020
1ae138d
feat: 支持svg预览 (#331)
beajer Jun 30, 2020
80ae6a3
feat: 增加统计ua (#327)
beajer Jun 30, 2020
a2378d2
Merge branch 'develop' into feat/multi_versions
beajer Jul 2, 2020
b05e25a
fix: http header设置错误 (#334)
beajer Jul 3, 2020
b34943a
feat: 当前对象数量说明,qrcode.download国际化字段重复 (#333)
beajer Jul 3, 2020
6b87e21
fix: 清空下载任务时,删除临时文件 (#335)
beajer Jul 6, 2020
65f3dcd
Merge branch 'develop' into feat/multi_versions
beajer Jul 7, 2020
aa3a004
fix: resolve merge conflicts
beajer Oct 27, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
}
},
"rules": {
"semi": 2
"semi": 0,
"quotes": 0
},
"extends": ["eslint:recommended", "plugin:prettier/recommended"],
"ignorePatterns": ["static/", "vendor/", "dist/", "node_modules/", "test/"],
Expand Down
39 changes: 19 additions & 20 deletions all-releases.md

Large diffs are not rendered by default.

8 changes: 2 additions & 6 deletions app/components/services/auto-upgrade.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
angular.module("web").factory("autoUpgradeSvs", [
"settingsSvs",
function (settingsSvs) {
function () {
var util = require("./node/ossstore/lib/util");
var NAME = "oss-browser";

Expand Down Expand Up @@ -219,8 +219,6 @@ angular.module("web").factory("autoUpgradeSvs", [
//暂时只支持1个文件更新
data.file = data.files.length > 0 ? data.files[0] : null;

var jobs = [];

//var fileName = NAME + '-' + process.platform + '-' + process.arch + '.zip';

var pkgLink =
Expand All @@ -238,8 +236,6 @@ angular.module("web").factory("autoUpgradeSvs", [
upgradeOpt.upgradeJob.progress = 0;
upgradeOpt.upgradeJob.pkgLink = pkgLink;

var jobsFinishedCount = 0;

var to = path.join(__dirname, "..", lastVersion + "-" + data.file);

job = new FlatDownloadJob(data.file, pkgLink, to);
Expand Down Expand Up @@ -292,7 +288,7 @@ angular.module("web").factory("autoUpgradeSvs", [
Range: "bytes=30-210",
},
}).then(
function (data) {
function () {
var t2 = Date.now();
t.push({ time: t2 - t1, linkPre: linkPre });

Expand Down
42 changes: 31 additions & 11 deletions app/components/services/oss-download-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ angular.module("web").factory("ossDownloadManager", [
//save
saveProg();

job.on("partcomplete", function (prog) {
job.on("partcomplete", function () {
safeApply($scope);
//save
saveProg($scope);
Expand Down Expand Up @@ -140,10 +140,19 @@ angular.module("web").factory("ossDownloadManager", [
//console.log('--------downloadFilesHandler', fromOssInfos, toLocalPath);
var authInfo = AuthInfo.get();
var dirPath = path.dirname(fromOssInfos[0].path);
// 多版本下可能会下载同一文件不同历史版本,自动重命名文件
const fileVersionCount = {};
fromOssInfos.forEach((info) => {
if (!fileVersionCount[info.path]) {
fileVersionCount[info.path] = 1;
} else {
fileVersionCount[info.path] += 1;
}
});

loop(
fromOssInfos,
function (jobs) {},
function () {},
function () {
if (jobsAddedFn) jobsAddedFn();
}
Expand Down Expand Up @@ -202,11 +211,18 @@ angular.module("web").factory("ossDownloadManager", [
return;
}

var fileName = path.basename(ossInfo.path);
var filePath = path.join(
toLocalPath,
path.relative(dirPath, ossInfo.path)
);
let fileName;
if (fileVersionCount[ossInfo.path] > 1) {
fileName =
path.basename(ossInfo.path, path.extname(ossInfo.path)) +
"(" +
moment(ossInfo.lastModified).format("YYYY_MM_DD_HH_mm_ss") +
")" +
path.extname(ossInfo.path);
} else {
fileName = path.basename(ossInfo.path);
}
var filePath = path.join(toLocalPath, path.relative(dirPath, fileName));

if (ossInfo.isFolder) {
//目录
Expand Down Expand Up @@ -249,7 +265,7 @@ angular.module("web").factory("ossDownloadManager", [
//文件
if (process.platform == "win32") {
//修复window下,文件名含非法字符需要转义
if (/[\/\\\:\<\>\?\*\"\|]/.test(fileName)) {
if (/[/\\:<>?*"|]/.test(fileName)) {
fileName = encodeURIComponent(fileName);
filePath = path.join(
path.dirname(filePath),
Expand All @@ -274,6 +290,7 @@ angular.module("web").factory("ossDownloadManager", [
from: {
bucket: ossInfo.bucket,
key: truePath,
versionId: ossInfo.versionId,
},
to: {
name: fileName,
Expand Down Expand Up @@ -302,9 +319,10 @@ angular.module("web").factory("ossDownloadManager", [
var cname = AuthInfo.get().cname || false;

var endpointname = cname ? auth.eptplcname : auth.eptpl;
let store;
//stsToken
if (auth.stoken && auth.id.indexOf("STS.") == 0) {
var store = new OssStore({
store = new OssStore({
stsToken: {
Credentials: {
AccessKeyId: auth.id,
Expand All @@ -320,7 +338,7 @@ angular.module("web").factory("ossDownloadManager", [
cname: cname,
});
} else {
var store = new OssStore({
store = new OssStore({
aliyunCredential: {
accessKeyId: auth.id,
secretAccessKey: auth.secret,
Expand Down Expand Up @@ -373,7 +391,9 @@ angular.module("web").factory("ossDownloadManager", [
try {
var data = fs.readFileSync(getDownProgFilePath());
return JSON.parse(data ? data.toString() : "[]");
} catch (e) {}
} catch (e) {
//
}
return [];
}

Expand Down
Loading