Skip to content

Commit

Permalink
Merge branch 'release/v0.18.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
gee1k committed Apr 3, 2020
2 parents ead3999 + 3dffe67 commit f49aae9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 20 deletions.
4 changes: 2 additions & 2 deletions uPic.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 20200402;
CURRENT_PROJECT_VERSION = 20200403;
DEVELOPMENT_TEAM = W863J6W8DZ;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = "$(SRCROOT)/uPic/Supporting Files/Info.plist";
Expand Down Expand Up @@ -1257,7 +1257,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 20200402;
CURRENT_PROJECT_VERSION = 20200403;
DEVELOPMENT_TEAM = W863J6W8DZ;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = "$(SRCROOT)/uPic/Supporting Files/Info.plist";
Expand Down
13 changes: 8 additions & 5 deletions uPic/Models/Custom/CustomUploader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -140,17 +140,20 @@ class CustomUploader: BaseUploader {
}.responseJSON(completionHandler: { response -> Void in
switch response.result {
case .success(let value):
debugPrint(value)
let json = JSON(value)
var retUrl = CustomHostUtil.parseResultUrl(json, config.resultPath ?? "")
if retUrl.isEmpty {
var retUrlPath = CustomHostUtil.parseResultUrl(json, config.resultPath ?? "")
if retUrlPath.isEmpty {
super.faild(errorMsg: "Did not get the file URL".localized)
return
}
if !domain.isEmpty {
retUrl = "\(domain)/\(retUrl)"
if retUrlPath.hasPrefix("/") {
retUrlPath = "\(domain)\(retUrlPath)"
} else {
retUrlPath = "\(domain)/\(retUrlPath)"
}
}
super.completed(url: "\(retUrl)\(suffix)", retData, fileUrl, nil)
super.completed(url: "\(retUrlPath)\(suffix)", retData, fileUrl, nil)
case .failure(let error):
super.faild(errorMsg: error.localizedDescription)
}
Expand Down
13 changes: 0 additions & 13 deletions uPic/Models/HostConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -158,19 +158,6 @@ class HostConfig: NSObject, Codable {
self.setValue(saveKeyPath, forKey: "saveKeyPath")
}
}

if self.containsKey(key: "domain") {
var domain = self.value(forKey: "domain") as! String
if domain.hasSuffix("/") {
domain.removeLast()
self.setValue(domain, forKey: "domain")
}

if (!domain.isEmpty && !domain.hasPrefix("http://") && !domain.hasPrefix("https://")) {
domain = "http://\(domain)"
self.setValue(domain, forKey: "domain")
}
}
}

}
Expand Down

0 comments on commit f49aae9

Please sign in to comment.