Commit 54458e9c authored by David黄金龙's avatar David黄金龙

头像 地址替换 方便七鱼客服中展示用户自己头像

parent ce3d3719
......@@ -151,7 +151,10 @@ class YHEditBaseUserInfoViewController: YHBaseViewController {
self.photoImageView.image = result
self.viewModel.uploadImage(result, true) {[weak self] success, error in
guard let self = self else { return }
viewModel.model.avatar = success ?? ""
var replacedString = (success ?? "").getCdnUrl()
print(replacedString)
viewModel.model.avatar = replacedString
if self.viewModel.isCanNext(step: 1) {
nextButton.isEnabled = true
nextButton.backgroundColor = UIColor.brandMainColor
......
......@@ -322,4 +322,11 @@ extension String {
}
return nil
}
//头像使用cdn地址
func getCdnUrl() -> String {
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")
return replacedString
}
}
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