Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
antSword
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
HuangJunbo
antSword
Commits
c5f79f33
Commit
c5f79f33
authored
Jan 18, 2019
by
Medicean
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(BugFix:FileManager) 修复 Windows Shell 盘符小写引起的 bug
parent
b134d3e2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
folder.js
source/modules/filemanager/folder.js
+2
-0
index.js
source/modules/filemanager/index.js
+11
-1
No files found.
source/modules/filemanager/folder.js
View file @
c5f79f33
...
...
@@ -36,6 +36,8 @@ class Folder {
self
.
cache
[
_
]
=
{};
self
.
tree
.
deleteItem
(
_
);
});
// 移除根节点下的所有节点
self
.
tree
.
deleteChildItems
(
self
.
tree
.
rootId
);
// 1. 分解当前路径
let
curPath
=
''
;
path
.
split
(
'/'
).
map
((
p
)
=>
{
...
...
source/modules/filemanager/index.js
View file @
c5f79f33
...
...
@@ -89,10 +89,13 @@ class FileManager {
};
let
info_path
=
info
[
0
].
replace
(
/
\\
/g
,
'/'
).
replace
(
/
\.
$/
,
''
);
let
info_drive
=
info
[
1
];
// 判断是否为linux
if
(
info_path
.
substr
(
0
,
1
)
===
'/'
)
{
this
.
isWin
=
false
;
}
else
{
// windows 盘符统一大写
info_path
=
`
${
info_path
.
substr
(
0
,
1
).
toUpperCase
()}${
info_path
.
substr
(
1
)}
`
;
info_drive
=
info_drive
.
toUpperCase
();
};
this
.
path
=
info_path
;
this
.
home
=
info_path
;
...
...
@@ -132,7 +135,14 @@ class FileManager {
getFiles
(
p
,
callback
)
{
let
self
=
this
;
if
(
self
.
isWin
)
{
// 处理输入为 f:\ 这种情况
p
=
p
.
replace
(
/
\\
/g
,
'/'
).
replace
(
/
\.
$/
,
''
);
p
=
p
.
substr
(
1
,
2
)
==
":/"
?
`
${
p
.
substr
(
0
,
1
).
toUpperCase
()}${
p
.
substr
(
1
)}
`
:
p
;
}
let
path
=
this
.
changePath
(
p
);
if
(
self
.
isWin
){
// 处理输入为 f: 这种情况
path
=
path
.
substr
(
1
,
2
)
==
":/"
?
`
${
path
.
substr
(
0
,
1
).
toUpperCase
()}${
path
.
substr
(
1
)}
`
:
path
;
}
let
cache
;
if
(
!
path
.
endsWith
(
'/'
))
{
path
+=
'/'
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment