Skip to content

Commit

Permalink
Merge branch 'release/v0.18.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
gee1k committed Mar 28, 2020
2 parents aeb6b28 + 2ee8bbc commit e45e925
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 12 deletions.
8 changes: 4 additions & 4 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 = 20200309;
CURRENT_PROJECT_VERSION = 20200328;
DEVELOPMENT_TEAM = W863J6W8DZ;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = "$(SRCROOT)/uPic/Supporting Files/Info.plist";
Expand All @@ -1236,7 +1236,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.12;
MARKETING_VERSION = 0.18.0;
MARKETING_VERSION = 0.18.1;
PRODUCT_BUNDLE_IDENTIFIER = com.svend.uPic;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -1257,7 +1257,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 20200309;
CURRENT_PROJECT_VERSION = 20200328;
DEVELOPMENT_TEAM = W863J6W8DZ;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = "$(SRCROOT)/uPic/Supporting Files/Info.plist";
Expand All @@ -1266,7 +1266,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.12;
MARKETING_VERSION = 0.18.0;
MARKETING_VERSION = 0.18.1;
PRODUCT_BUNDLE_IDENTIFIER = com.svend.uPic;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
2 changes: 1 addition & 1 deletion uPic.xcodeproj/xcshareddata/xcschemes/uPic.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1130"
LastUpgradeVersion = "1140"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion uPic/Extensions/NotificationExt.swift
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ extension NotificationExt {
// MARK: 请求通知权限
static func requestAuthorization () {
if #available(OSX 10.14, *) {
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound]) { (success, error) in
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge]) { (success, error) in
if success {
// user accept
} else {
Expand Down
14 changes: 10 additions & 4 deletions uPic/Models/BaseUploaderUtil.swift
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,16 @@ class BaseUploaderUtil {
var folderPath: String?
if let fileUrl = fileUrl {
fileName = fileUrl.lastPathComponent
mimeType = Util.getMimeType(pathExtension: fileUrl.pathExtension)
if fileName.pathExtension.isEmpty {
fileName = fileName.appendingPathExtension(ext: "jpg")!
}
mimeType = Util.getMimeType(pathExtension: fileName.pathExtension)
retData = BaseUploaderUtil.compressImage(fileUrl)
folderPath = fileUrl._uploadFolderPath
} else if let fileData = fileData {
retData = BaseUploaderUtil.compressImage(fileData)
// 处理截图之类的图片,生成一个文件名
let fileExtension = Swime.mimeType(data: fileData)?.ext ?? "png"
let fileExtension = Swime.mimeType(data: fileData)?.ext ?? "jpg"
fileName = BaseUploaderUtil._getRrandomFileName(fileExtension)
mimeType = Util.getMimeType(pathExtension: fileExtension)
folderPath = fileData._uploadFolderPath
Expand Down Expand Up @@ -199,14 +202,17 @@ class BaseUploaderUtil {
var folderPath: String?
if let fileUrl = fileUrl {
fileName = fileUrl.lastPathComponent
mimeType = Util.getMimeType(pathExtension: fileUrl.pathExtension)
if fileName.pathExtension.isEmpty {
fileName = fileName.appendingPathExtension(ext: "jpg")!
}
mimeType = Util.getMimeType(pathExtension: fileName.pathExtension)
retData = BaseUploaderUtil.compressImage(fileUrl)
fileBase64 = retData?.toBase64()
folderPath = fileUrl._uploadFolderPath
} else if let fileData = fileData {
// 处理截图之类的图片,生成一个文件名

let fileExtension = Swime.mimeType(data: fileData)?.ext ?? "png"
let fileExtension = Swime.mimeType(data: fileData)?.ext ?? "jpg"
fileName = BaseUploaderUtil._getRrandomFileName(fileExtension)
mimeType = Util.getMimeType(pathExtension: fileExtension)
retData = BaseUploaderUtil.compressImage(fileData)
Expand Down
2 changes: 1 addition & 1 deletion uPic/Models/Qiniu/QiniuUploader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class QiniuUploader: BaseUploader {
let accessKey = config.accessKey
let secretKey = config.secretKey
let domain = config.domain
var region = QiniuRegion.formatRegion(config.region)
let region = QiniuRegion.formatRegion(config.region)

let saveKeyPath = config.saveKeyPath

Expand Down
2 changes: 1 addition & 1 deletion uPic/Models/Weibo/WeiboUploader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class WeiboUploader: BaseUploader {
let fileBase64 = configuration["fileBase64"] as! String
let fileName = configuration["fileName"] as! String

var fileExtension = fileName.pathExtension == "gif" ? ".gif" : ".jpg"
let fileExtension = fileName.pathExtension == "gif" ? ".gif" : ".jpg"

var headers = HTTPHeaders()
if let loginCookie = loginCookie {
Expand Down

0 comments on commit e45e925

Please sign in to comment.