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
e0deb693
Commit
e0deb693
authored
May 22, 2024
by
pete谢兆麟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
跟据url部署正确的bucket
parent
e933abb7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
1 deletion
+46
-1
YHOSSManager.swift
galaxy/galaxy/Classes/Tools/Upload/YHOSSManager.swift
+46
-1
No files found.
galaxy/galaxy/Classes/Tools/Upload/YHOSSManager.swift
View file @
e0deb693
...
...
@@ -140,7 +140,7 @@ class YHOSSManager: NSObject, URLSessionDelegate {
}
func
getPublic
(
url
:
String
,
callBackBlock
:
@escaping
(
_
success
:
String
?,
_
error
:
YHErrorModel
?)
->
())
{
let
bucketName
=
self
.
model
.
bucket
let
bucketName
=
self
.
getBucket
(
url
)
let
pathComponents
=
url
.
pathComponents
var
objectKey
=
""
for
i
in
0
..<
pathComponents
.
count
{
...
...
@@ -166,4 +166,49 @@ class YHOSSManager: NSObject, URLSessionDelegate {
return
})
.
waitUntilFinished
()
}
func
getBucket
(
_
url
:
String
)
->
String
{
if
url
.
contains
(
self
.
model
.
bucket
)
{
return
self
.
model
.
bucket
}
else
if
url
.
contains
(
"test-cdn.galaxy-immi.com"
)
{
return
"test-bucket-v1"
}
else
if
url
.
contains
(
"test-cdn-pub.galaxy-immi.com"
)
{
return
"test-bucket-v1-pub"
}
else
if
url
.
contains
(
"cdnfile.galaxy-immi.com"
)
{
return
"galaxy-immi-cdn"
}
else
if
url
.
contains
(
"upload.cdn.galaxy-immi.com"
)
||
url
.
contains
(
"upload-cdn.galaxy-immi.com"
)
{
return
"galaxy-immi-mp"
}
else
if
url
.
contains
(
"cache.galaxy-immi.com"
)
{
return
"galaxy-immi"
}
else
if
url
.
contains
(
"galaxy-hkjoin-cdn.galaxy-immi.com"
)
{
return
"galaxy-hkjoin"
}
else
if
url
.
contains
(
"galaxy-dwp-cdn.galaxy-immi.com"
)
{
return
"galaxy-dwp"
}
else
if
url
.
contains
(
"galaxy-immi-mp.oss-cn-shenzhen.aliyuncs.com"
)
{
return
"galaxy-filecvt"
}
else
if
url
.
contains
(
"yinhe-test.oss-cn-shenzhen.aliyuncs.com"
)
{
return
"yinhe-test"
}
else
if
url
.
contains
(
"file.galaxy-immi.com"
)
{
return
"galaxy-file"
}
else
if
url
.
contains
(
"galaxy-smartwriting.oss-cn-shenzhen.aliyuncs.com"
)
{
return
"galaxy-smartwriting"
}
else
if
url
.
contains
(
"galaxy-dwp2.oss-cn-shenzhen.aliyuncs.com"
)
{
return
"galaxy-dwp2"
}
else
if
url
.
contains
(
"galaxy-diy.oss-cn-shenzhen.aliyuncs.com"
)
{
return
"galaxy-diy"
}
else
if
url
.
contains
(
"test-hk-bucket.oss-cn-hongkong.aliyuncs.com"
)
{
return
"test-hk-bucket"
}
else
if
url
.
contains
(
"prod-hk-bucket.oss-cn-hongkong.aliyuncs.com"
)
{
return
"prod-hk-bucket"
}
else
if
url
.
contains
(
"prod-cdn.galaxy-immi.com"
)
{
return
"prod-bucket-v1"
}
else
if
url
.
contains
(
"prod-cdn-pub.galaxy-immi.com"
)
{
return
"prod-bucket-v1-pub"
}
else
{
#if DEBUG
printLog
(
"OSS找不到正确的Bucket"
)
#endif
return
""
}
}
}
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