Commit 9a23bd8f authored by pete谢兆麟's avatar pete谢兆麟

oss上传私有链接改为预览链接

parent 092722b7
...@@ -342,8 +342,12 @@ extension String { ...@@ -342,8 +342,12 @@ extension String {
func getCdnUrl() -> String { func getCdnUrl() -> String {
var replacedString = self.replacingOccurrences(of: "prod-bucket-v1-pub.oss-cn-shenzhen.aliyuncs.com", with: "prod-cdn-pub.galaxy-immi.com") var replacedString = self.replacingOccurrences(of: "prod-bucket-v1-pub.oss-cn-shenzhen.aliyuncs.com", with: "prod-cdn-pub.galaxy-immi.com")
replacedString = replacedString.replacingOccurrences(of: "test-bucket-v1-pub.oss-cn-shenzhen.aliyuncs.com", with: "test-cdn-pub.galaxy-immi.com") replacedString = replacedString.replacingOccurrences(of: "test-bucket-v1-pub.oss-cn-shenzhen.aliyuncs.com", with: "test-cdn-pub.galaxy-immi.com")
// replacedString = replacedString.replacingOccurrences(of: "prod-bucket-v1.oss-cn-shenzhen.aliyuncs.com", with: "prod-cdn.galaxy-immi.com") return replacedString
// replacedString = replacedString.replacingOccurrences(of: "test-bucket-v1.oss-cn-shenzhen.aliyuncs.com", with: "test-cdn.galaxy-immi.com") }
func getPrivateUrl() -> String {
var replacedString = self.replacingOccurrences(of: "prod-bucket-v1.oss-cn-shenzhen.aliyuncs.com", with: "prod-cdn.galaxy-immi.com")
replacedString = replacedString.replacingOccurrences(of: "test-bucket-v1.oss-cn-shenzhen.aliyuncs.com", with: "test-cdn.galaxy-immi.com")
return replacedString return replacedString
} }
} }
...@@ -140,7 +140,7 @@ class YHOSSManager: NSObject, URLSessionDelegate { ...@@ -140,7 +140,7 @@ class YHOSSManager: NSObject, URLSessionDelegate {
} else { } else {
string = "https://" + self.model.bucket + "." + "oss-cn-shenzhen.aliyuncs.com/" + "4001001" + "/" + currentDateMMdd + "/" + "\(self.fileName.first ?? "")" string = "https://" + self.model.bucket + "." + "oss-cn-shenzhen.aliyuncs.com/" + "4001001" + "/" + currentDateMMdd + "/" + "\(self.fileName.first ?? "")"
} }
callBackBlock(string, YHErrorModel()) callBackBlock(string.getPrivateUrl(), YHErrorModel())
self.fileName.removeFirst() self.fileName.removeFirst()
} }
return return
...@@ -202,7 +202,7 @@ class YHOSSManager: NSObject, URLSessionDelegate { ...@@ -202,7 +202,7 @@ class YHOSSManager: NSObject, URLSessionDelegate {
} else { } else {
string = "https://" + self.model.bucket + "." + "oss-cn-shenzhen.aliyuncs.com/" + "4001001" + "/" + currentDateMMdd + "/" + "\(self.fileName.first ?? "")" string = "https://" + self.model.bucket + "." + "oss-cn-shenzhen.aliyuncs.com/" + "4001001" + "/" + currentDateMMdd + "/" + "\(self.fileName.first ?? "")"
} }
callBackBlock(string, YHErrorModel()) callBackBlock(string.getPrivateUrl(), YHErrorModel())
self.fileName.removeFirst() self.fileName.removeFirst()
} }
return return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment