Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
galaxy-iOS
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
mobile-group
galaxy-iOS
Commits
25163a26
Commit
25163a26
authored
May 20, 2024
by
pete谢兆麟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bucketPath处理
parent
f3c5ebb9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
YHOSSManager.swift
galaxy/galaxy/Classes/Tools/Upload/YHOSSManager.swift
+10
-5
No files found.
galaxy/galaxy/Classes/Tools/Upload/YHOSSManager.swift
View file @
25163a26
...
...
@@ -141,12 +141,17 @@ class YHOSSManager: NSObject, URLSessionDelegate {
func
getPublic
(
url
:
String
,
callBackBlock
:
@escaping
(
_
success
:
String
?,
_
error
:
YHErrorModel
?)
->
())
{
let
bucketName
=
self
.
model
.
bucket
let
pathComponents
=
url
.
pathComponents
var
bucketPath
=
""
if
pathComponents
.
count
>=
4
{
bucketPath
=
pathComponents
[
2
]
+
"/"
+
pathComponents
[
3
]
var
pathComponents
=
url
.
pathComponents
var
objectKey
=
""
for
i
in
0
..<
pathComponents
.
count
{
if
i
==
0
||
i
==
1
{
}
else
if
i
==
pathComponents
.
count
-
1
{
objectKey
=
objectKey
+
pathComponents
[
i
]
}
else
{
objectKey
=
objectKey
+
pathComponents
[
i
]
+
"/"
}
}
let
objectKey
=
bucketPath
+
"/"
+
url
.
lastPathComponent
let
task
=
mClient
.
presignConstrainURL
(
withBucketName
:
bucketName
,
withObjectKey
:
objectKey
,
withExpirationInterval
:
60
*
5
)
task
.
continue
({
(
t
)
->
Any
?
in
let
result
=
t
...
...
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