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
d18bb551
Commit
d18bb551
authored
Apr 10, 2024
by
David黄金龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、删除不使用的库
2、修改文书状态流程
parent
94cb1c0a
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
165 additions
and
599 deletions
+165
-599
Podfile
galaxy/Podfile
+11
-11
project.pbxproj
galaxy/galaxy.xcodeproj/project.pbxproj
+3
-15
YHMyDocumentsListViewController.swift
...MyDocuments(我的文书)/C/YHMyDocumentsListViewController.swift
+27
-6
YHDocListCell.swift
...gentService(服务中心)/MyDocuments(我的文书)/V/YHDocListCell.swift
+90
-56
YHHomeCollectionViewCell.swift
...IntelligentService(服务中心)/V/YHHomeCollectionViewCell.swift
+17
-16
YHServiceTableFootView.swift
...s/IntelligentService(服务中心)/V/YHServiceTableFootView.swift
+16
-16
YHOSSManager.swift
galaxy/galaxy/Classes/Tools/YHOOS/YHOSSManager.swift
+0
-478
galaxy-Bridge-Header.h
galaxy/galaxy/Res/galaxy-Bridge-Header.h
+1
-1
No files found.
galaxy/Podfile
View file @
d18bb551
...
@@ -17,8 +17,8 @@ target 'galaxy' do
...
@@ -17,8 +17,8 @@ target 'galaxy' do
# pod 'RxSwift','6.6.0'
# pod 'RxSwift','6.6.0'
# pod 'RxCocoa','6.6.0'
# pod 'RxCocoa','6.6.0'
# pod 'RxAlamofire','6.1.1'
# pod 'RxAlamofire','6.1.1'
#数据存储
#
#数据存储
pod
'SwiftyUserDefaults'
,
'5.3.0'
#
pod 'SwiftyUserDefaults','5.3.0'
#数据加、解密
#数据加、解密
pod
'CryptoSwift'
,
'1.8.0'
pod
'CryptoSwift'
,
'1.8.0'
#手动布局
#手动布局
...
@@ -31,21 +31,21 @@ target 'galaxy' do
...
@@ -31,21 +31,21 @@ target 'galaxy' do
pod
'ESPullToRefresh'
,
"2.9.3"
pod
'ESPullToRefresh'
,
"2.9.3"
# #Toast
# #Toast
# pod 'Toast-Swift', '5.0.1'
# pod 'Toast-Swift', '5.0.1'
#富文本 UILabel
#
#富文本 UILabel
pod
'Nantes'
,
'0.1.2'
#
pod 'Nantes','0.1.2'
#提示框
#提示框
pod
'PKHUD'
,
'5.3.0'
pod
'PKHUD'
,
'5.3.0'
#日志 调试
#日志 调试
# pod 'CocoaDebug', '1.7.7'
# pod 'CocoaDebug', '1.7.7'
#date分类
#
#date分类
pod
'SwiftDate'
,
'7.0.0'
#
pod 'SwiftDate','7.0.0'
#定时器
#
#定时器
pod
'SwiftyTimer'
,
'2.1.0'
#
pod 'SwiftyTimer','2.1.0'
#UIColor 的扩展
#UIColor 的扩展
# pod 'Hue','5.0.0'
# pod 'Hue','5.0.0'
# #内存泄漏
# #内存泄漏
# pod 'LifetimeTracker','1.8.1'
# pod 'LifetimeTracker','1.8.1'
#控制台转换成中文
#
#控制台转换成中文
pod
'ByebyeUnicode'
,
'1.1.0'
pod
'ByebyeUnicode'
,
'1.1.0'
#轮播图
#轮播图
pod
'FSPagerView'
,
'0.8.3'
pod
'FSPagerView'
,
'0.8.3'
...
@@ -65,8 +65,8 @@ target 'galaxy' do
...
@@ -65,8 +65,8 @@ target 'galaxy' do
pod
'JXSegmentedView'
,
'1.3.0'
pod
'JXSegmentedView'
,
'1.3.0'
#UI调试组件
#UI调试组件
pod
'LookinServer'
,
'1.2.6'
,
:subspecs
=>
[
'Swift'
],
:configurations
=>
[
'Debug'
]
pod
'LookinServer'
,
'1.2.6'
,
:subspecs
=>
[
'Swift'
],
:configurations
=>
[
'Debug'
]
#阿里云OOS
#
#阿里云OOS
pod
'AliyunOSSiOS'
,
'2.10.18'
#
pod 'AliyunOSSiOS','2.10.18'
#极光推送
#极光推送
pod
'JPush'
,
'5.2.0'
pod
'JPush'
,
'5.2.0'
pod
'JCore'
,
'4.6.0-noidfa'
pod
'JCore'
,
'4.6.0-noidfa'
...
...
galaxy/galaxy.xcodeproj/project.pbxproj
View file @
d18bb551
...
@@ -217,7 +217,6 @@
...
@@ -217,7 +217,6 @@
0468D42E2B5654A500CFB916
/* CoreTelephony.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0468D42D2B5654A500CFB916
/* CoreTelephony.framework */
;
};
0468D42E2B5654A500CFB916
/* CoreTelephony.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0468D42D2B5654A500CFB916
/* CoreTelephony.framework */
;
};
0468D4302B5654B500CFB916
/* SystemConfiguration.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0468D42F2B5654B500CFB916
/* SystemConfiguration.framework */
;
};
0468D4302B5654B500CFB916
/* SystemConfiguration.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0468D42F2B5654B500CFB916
/* SystemConfiguration.framework */
;
};
0468D4312B5654C100CFB916
/* libresolv.tbd in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0468D42C2B56549200CFB916
/* libresolv.tbd */
;
};
0468D4312B5654C100CFB916
/* libresolv.tbd in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0468D42C2B56549200CFB916
/* libresolv.tbd */
;
};
0468D4342B56587B00CFB916
/* YHOSSManager.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0468D4332B56587B00CFB916
/* YHOSSManager.swift */
;
};
0468D4362B57752F00CFB916
/* YHUserModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0468D4352B57752F00CFB916
/* YHUserModel.swift */
;
};
0468D4362B57752F00CFB916
/* YHUserModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0468D4352B57752F00CFB916
/* YHUserModel.swift */
;
};
0468D43A2B579EAC00CFB916
/* YHLoginViewModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0468D4392B579EAC00CFB916
/* YHLoginViewModel.swift */
;
};
0468D43A2B579EAC00CFB916
/* YHLoginViewModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0468D4392B579EAC00CFB916
/* YHLoginViewModel.swift */
;
};
047294E82B988A19008E0B84
/* YHNewWebViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
047294E72B988A19008E0B84
/* YHNewWebViewController.swift */
;
};
047294E82B988A19008E0B84
/* YHNewWebViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
047294E72B988A19008E0B84
/* YHNewWebViewController.swift */
;
};
...
@@ -651,7 +650,6 @@
...
@@ -651,7 +650,6 @@
0468D42C2B56549200CFB916
/* libresolv.tbd */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
"sourcecode.text-based-dylib-definition"
;
name
=
libresolv.tbd
;
path
=
usr/lib/libresolv.tbd
;
sourceTree
=
SDKROOT
;
};
0468D42C2B56549200CFB916
/* libresolv.tbd */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
"sourcecode.text-based-dylib-definition"
;
name
=
libresolv.tbd
;
path
=
usr/lib/libresolv.tbd
;
sourceTree
=
SDKROOT
;
};
0468D42D2B5654A500CFB916
/* CoreTelephony.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
CoreTelephony.framework
;
path
=
System/Library/Frameworks/CoreTelephony.framework
;
sourceTree
=
SDKROOT
;
};
0468D42D2B5654A500CFB916
/* CoreTelephony.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
CoreTelephony.framework
;
path
=
System/Library/Frameworks/CoreTelephony.framework
;
sourceTree
=
SDKROOT
;
};
0468D42F2B5654B500CFB916
/* SystemConfiguration.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
SystemConfiguration.framework
;
path
=
System/Library/Frameworks/SystemConfiguration.framework
;
sourceTree
=
SDKROOT
;
};
0468D42F2B5654B500CFB916
/* SystemConfiguration.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
SystemConfiguration.framework
;
path
=
System/Library/Frameworks/SystemConfiguration.framework
;
sourceTree
=
SDKROOT
;
};
0468D4332B56587B00CFB916
/* YHOSSManager.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHOSSManager.swift
;
sourceTree
=
"<group>"
;
};
0468D4352B57752F00CFB916
/* YHUserModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
name
=
YHUserModel.swift
;
path
=
"galaxy/Classes/Modules/Login(登录)/M/YHUserModel.swift"
;
sourceTree
=
SOURCE_ROOT
;
};
0468D4352B57752F00CFB916
/* YHUserModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
name
=
YHUserModel.swift
;
path
=
"galaxy/Classes/Modules/Login(登录)/M/YHUserModel.swift"
;
sourceTree
=
SOURCE_ROOT
;
};
0468D4392B579EAC00CFB916
/* YHLoginViewModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHLoginViewModel.swift
;
sourceTree
=
"<group>"
;
};
0468D4392B579EAC00CFB916
/* YHLoginViewModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHLoginViewModel.swift
;
sourceTree
=
"<group>"
;
};
047294E72B988A19008E0B84
/* YHNewWebViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHNewWebViewController.swift
;
sourceTree
=
"<group>"
;
};
047294E72B988A19008E0B84
/* YHNewWebViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHNewWebViewController.swift
;
sourceTree
=
"<group>"
;
};
...
@@ -1505,14 +1503,6 @@
...
@@ -1505,14 +1503,6 @@
path
=
Analytics
;
path
=
Analytics
;
sourceTree
=
"<group>"
;
sourceTree
=
"<group>"
;
};
};
0468D4322B56581000CFB916
/* YHOOS */
=
{
isa
=
PBXGroup
;
children
=
(
0468D4332B56587B00CFB916
/* YHOSSManager.swift */
,
);
path
=
YHOOS
;
sourceTree
=
"<group>"
;
};
0468D4372B57756300CFB916
/* M */
=
{
0468D4372B57756300CFB916
/* M */
=
{
isa
=
PBXGroup
;
isa
=
PBXGroup
;
children
=
(
children
=
(
...
@@ -1940,7 +1930,6 @@
...
@@ -1940,7 +1930,6 @@
A5ACE8EE2B4564F7002C94D2
/* Tools */
=
{
A5ACE8EE2B4564F7002C94D2
/* Tools */
=
{
isa
=
PBXGroup
;
isa
=
PBXGroup
;
children
=
(
children
=
(
0468D4322B56581000CFB916
/* YHOOS */
,
0468D4292B55017400CFB916
/* Analytics */
,
0468D4292B55017400CFB916
/* Analytics */
,
04AF58BA2B4FB71C0066011A
/* Localized */
,
04AF58BA2B4FB71C0066011A
/* Localized */
,
A5ACE8F12B4564F7002C94D2
/* NetWork */
,
A5ACE8F12B4564F7002C94D2
/* NetWork */
,
...
@@ -2538,7 +2527,6 @@
...
@@ -2538,7 +2527,6 @@
045EEEB22B9F171A0022A143
/* YHWorkActionView.swift in Sources */
,
045EEEB22B9F171A0022A143
/* YHWorkActionView.swift in Sources */
,
A58AC09F2BAC05BA00A30FA9
/* YHFileListItemsView.swift in Sources */
,
A58AC09F2BAC05BA00A30FA9
/* YHFileListItemsView.swift in Sources */
,
045EEE8C2B9F171A0022A143
/* YHPreviewMainViewController.swift in Sources */
,
045EEE8C2B9F171A0022A143
/* YHPreviewMainViewController.swift in Sources */
,
0468D4342B56587B00CFB916
/* YHOSSManager.swift in Sources */
,
A5C382D12B5FAAB300C5E65C
/* YHContactItemModel.swift in Sources */
,
A5C382D12B5FAAB300C5E65C
/* YHContactItemModel.swift in Sources */
,
A5ACE9522B4564F7002C94D2
/* YHServiceCenterMainViewController.swift in Sources */
,
A5ACE9522B4564F7002C94D2
/* YHServiceCenterMainViewController.swift in Sources */
,
045EEF072B9F171A0022A143
/* YHBasicInfoFillViewModel.swift in Sources */
,
045EEF072B9F171A0022A143
/* YHBasicInfoFillViewModel.swift in Sources */
,
...
@@ -2908,7 +2896,7 @@
...
@@ -2908,7 +2896,7 @@
CODE_SIGN_IDENTITY
=
"Apple Development"
;
CODE_SIGN_IDENTITY
=
"Apple Development"
;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]"
=
"iPhone Developer"
;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]"
=
"iPhone Developer"
;
CODE_SIGN_STYLE
=
Manual
;
CODE_SIGN_STYLE
=
Manual
;
CURRENT_PROJECT_VERSION
=
6
;
CURRENT_PROJECT_VERSION
=
8
;
DEVELOPMENT_TEAM
=
""
;
DEVELOPMENT_TEAM
=
""
;
"DEVELOPMENT_TEAM[sdk=iphoneos*]"
=
RXHYW88XR7
;
"DEVELOPMENT_TEAM[sdk=iphoneos*]"
=
RXHYW88XR7
;
ENABLE_USER_SCRIPT_SANDBOXING
=
NO
;
ENABLE_USER_SCRIPT_SANDBOXING
=
NO
;
...
@@ -3109,7 +3097,7 @@
...
@@ -3109,7 +3097,7 @@
CODE_SIGN_IDENTITY
=
"Apple Development"
;
CODE_SIGN_IDENTITY
=
"Apple Development"
;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]"
=
"iPhone Developer"
;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]"
=
"iPhone Developer"
;
CODE_SIGN_STYLE
=
Manual
;
CODE_SIGN_STYLE
=
Manual
;
CURRENT_PROJECT_VERSION
=
6
;
CURRENT_PROJECT_VERSION
=
8
;
DEVELOPMENT_TEAM
=
""
;
DEVELOPMENT_TEAM
=
""
;
"DEVELOPMENT_TEAM[sdk=iphoneos*]"
=
RXHYW88XR7
;
"DEVELOPMENT_TEAM[sdk=iphoneos*]"
=
RXHYW88XR7
;
ENABLE_USER_SCRIPT_SANDBOXING
=
NO
;
ENABLE_USER_SCRIPT_SANDBOXING
=
NO
;
...
@@ -3151,7 +3139,7 @@
...
@@ -3151,7 +3139,7 @@
CODE_SIGN_IDENTITY
=
"Apple Development"
;
CODE_SIGN_IDENTITY
=
"Apple Development"
;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]"
=
"iPhone Developer"
;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]"
=
"iPhone Developer"
;
CODE_SIGN_STYLE
=
Manual
;
CODE_SIGN_STYLE
=
Manual
;
CURRENT_PROJECT_VERSION
=
6
;
CURRENT_PROJECT_VERSION
=
8
;
DEVELOPMENT_TEAM
=
""
;
DEVELOPMENT_TEAM
=
""
;
"DEVELOPMENT_TEAM[sdk=iphoneos*]"
=
RXHYW88XR7
;
"DEVELOPMENT_TEAM[sdk=iphoneos*]"
=
RXHYW88XR7
;
ENABLE_USER_SCRIPT_SANDBOXING
=
NO
;
ENABLE_USER_SCRIPT_SANDBOXING
=
NO
;
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/MyDocuments(我的文书)/C/YHMyDocumentsListViewController.swift
View file @
d18bb551
...
@@ -346,7 +346,32 @@ extension YHMyDocumentsListViewController: UITableViewDelegate, UITableViewDataS
...
@@ -346,7 +346,32 @@ extension YHMyDocumentsListViewController: UITableViewDelegate, UITableViewDataS
tableView
.
reloadRows
(
at
:
[
indexPath
],
with
:
UITableView
.
RowAnimation
.
none
)
tableView
.
reloadRows
(
at
:
[
indexPath
],
with
:
UITableView
.
RowAnimation
.
none
)
updateBottomViewNumbers
()
updateBottomViewNumbers
()
}
else
{
}
else
{
if
model
.
file_type
==
"doc"
{
// if model.file_type == "doc" {
// if model.template_id == 195 {
// //跳转赴港计划书
// let vc = YHHKPlanDoctumentVC()
// vc.supplement_id = model.id
// vc.status = model.status
// self.navigationController?.pushViewController(vc)
// } else {
// let vc = YHMyDocumentsDetailViewController()
// vc.id = model.id
// self.navigationController?.pushViewController(vc)
// }
// } else {
// let vc = YHMySignatureDetailViewController()
// vc.id = model.sign_doc.id
// self.navigationController?.pushViewController(vc)
// }
if
model
.
document
.
status
==
6
&&
model
.
sign_doc
.
id
>
0
{
//签字状态
let
vc
=
YHMySignatureDetailViewController
()
vc
.
id
=
model
.
sign_doc
.
id
self
.
navigationController
?
.
pushViewController
(
vc
)
}
else
{
//文书状态
if
model
.
template_id
==
195
{
if
model
.
template_id
==
195
{
//跳转赴港计划书
//跳转赴港计划书
let
vc
=
YHHKPlanDoctumentVC
()
let
vc
=
YHHKPlanDoctumentVC
()
...
@@ -355,13 +380,9 @@ extension YHMyDocumentsListViewController: UITableViewDelegate, UITableViewDataS
...
@@ -355,13 +380,9 @@ extension YHMyDocumentsListViewController: UITableViewDelegate, UITableViewDataS
self
.
navigationController
?
.
pushViewController
(
vc
)
self
.
navigationController
?
.
pushViewController
(
vc
)
}
else
{
}
else
{
let
vc
=
YHMyDocumentsDetailViewController
()
let
vc
=
YHMyDocumentsDetailViewController
()
vc
.
id
=
model
.
id
vc
.
id
=
model
.
id
self
.
navigationController
?
.
pushViewController
(
vc
)
self
.
navigationController
?
.
pushViewController
(
vc
)
}
}
}
else
{
let
vc
=
YHMySignatureDetailViewController
()
vc
.
id
=
model
.
sign_doc
.
id
self
.
navigationController
?
.
pushViewController
(
vc
)
}
}
}
}
}
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/MyDocuments(我的文书)/V/YHDocListCell.swift
View file @
d18bb551
...
@@ -144,65 +144,99 @@ class YHDocListCell: UITableViewCell {
...
@@ -144,65 +144,99 @@ class YHDocListCell: UITableViewCell {
}
else
{
}
else
{
checkButton
.
isHidden
=
true
checkButton
.
isHidden
=
true
statusHoldView
.
isHidden
=
false
statusHoldView
.
isHidden
=
false
/*
var
statusTxt
=
"--"
docOpt: {
var
color
:
UIColor
=
.
failColor
1: '不展示',
2: '待确认',
3: '核对中',
4: '核对中',
5: '已驳回',
6: '已定稿',
},
*/
if
dataSource
.
document
.
status
==
6
&&
dataSource
.
sign_doc
.
id
>
0
{
//签字状态
let
status
=
dataSource
.
sign_doc
.
status
if
status
==
3
{
statusTxt
=
"待签章"
color
=
UIColor
.
brandMainColor
}
else
if
status
==
4
{
statusTxt
=
"已签章"
color
=
UIColor
.
successColor
}
else
if
status
==
5
{
statusTxt
=
"已完成"
color
=
UIColor
.
labelTextColor2
}
else
if
status
==
6
{
statusTxt
=
"已驳回"
color
=
UIColor
.
failColor
}
else
{
statusTxt
=
"--"
color
=
UIColor
.
failColor
}
}
else
{
//文书状态
let
status
=
dataSource
.
document
.
status
if
status
==
2
{
statusTxt
=
"待确认"
color
=
UIColor
.
brandMainColor
}
else
if
status
==
3
{
statusTxt
=
"核对中"
color
=
UIColor
.
warnColor
}
else
if
status
==
4
{
statusTxt
=
"核对中"
color
=
UIColor
.
warnColor
}
else
if
status
==
5
{
statusTxt
=
"已驳回"
color
=
UIColor
.
failColor
}
else
if
status
==
6
{
statusTxt
=
"已定稿"
color
=
UIColor
.
labelTextColor2
}
else
{
statusTxt
=
"--"
color
=
UIColor
.
failColor
}
}
var
statusTxt
=
"--"
var
color
:
UIColor
=
.
brandMainColor
if
dataSource
.
file_type
.
contains
(
"sign"
,
caseSensitive
:
true
)
{
//
let
status
=
dataSource
.
sign_doc
.
status
// if dataSource.file_type.contains("sign", caseSensitive: true) {
if
status
==
3
{
// let status = dataSource.sign_doc.status
statusTxt
=
"待签章"
// if status == 3 {
color
=
UIColor
.
brandMainColor
// statusTxt = "待签章"
}
else
if
status
==
4
{
// color = UIColor.brandMainColor
statusTxt
=
"已签章"
// } else if status == 4 {
color
=
UIColor
.
successColor
// statusTxt = "已签章"
}
else
if
status
==
5
{
// color = UIColor.successColor
statusTxt
=
"已完成"
// } else if status == 5 {
color
=
UIColor
.
labelTextColor2
// statusTxt = "已完成"
}
else
if
status
==
6
{
// color = UIColor.labelTextColor2
statusTxt
=
"已驳回"
// } else if status == 6 {
color
=
UIColor
.
failColor
// statusTxt = "已驳回"
}
else
{
// color = UIColor.failColor
statusTxt
=
"--"
// } else {
color
=
UIColor
.
failColor
// statusTxt = "--"
}
// color = UIColor.failColor
}
else
if
dataSource
.
file_type
.
contains
(
"doc"
,
caseSensitive
:
true
)
{
// }
let
status
=
dataSource
.
status
// } else if dataSource.file_type.contains("doc", caseSensitive: true) {
if
status
==
2
{
// let status = dataSource.status
statusTxt
=
"待确认"
// if status == 2 {
color
=
UIColor
.
brandMainColor
// statusTxt = "待确认"
}
else
if
status
==
3
{
// color = UIColor.brandMainColor
statusTxt
=
"核对中"
// } else if status == 3 {
color
=
UIColor
.
warnColor
// statusTxt = "核对中"
}
else
if
status
==
4
{
// color = UIColor.warnColor
statusTxt
=
"核对中"
// } else if status == 4 {
color
=
UIColor
.
warnColor
// statusTxt = "核对中"
}
else
if
status
==
5
{
// color = UIColor.warnColor
statusTxt
=
"已驳回"
// } else if status == 5 {
color
=
UIColor
.
failColor
// statusTxt = "已驳回"
}
else
if
status
==
6
{
// color = UIColor.failColor
statusTxt
=
"已定稿"
// } else if status == 6 {
color
=
UIColor
.
labelTextColor2
// statusTxt = "已定稿"
}
else
{
// color = UIColor.labelTextColor2
statusTxt
=
"--"
// } else {
color
=
UIColor
.
failColor
// statusTxt = "--"
}
// color = UIColor.failColor
}
else
{
// }
statusTxt
=
"--"
// } else {
color
=
UIColor
.
failColor
// statusTxt = "--"
// color = UIColor.failColor
}
//
// }
statusLabel
.
text
=
statusTxt
statusLabel
.
text
=
statusTxt
statusLabel
.
textColor
=
color
statusLabel
.
textColor
=
color
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/V/YHHomeCollectionViewCell.swift
View file @
d18bb551
...
@@ -155,21 +155,22 @@ class YHHomeCollectionViewCell: UICollectionViewCell {
...
@@ -155,21 +155,22 @@ class YHHomeCollectionViewCell: UICollectionViewCell {
}
}
func
getImageSize
(
_
url
:
String
?)
->
CGSize
{
func
getImageSize
(
_
url
:
String
?)
->
CGSize
{
guard
let
urlStr
=
url
,
urlStr
.
count
!=
0
else
{
// guard let urlStr = url, urlStr.count != 0 else {
return
CGSize
.
zero
// return CGSize.zero
}
// }
let
tempUrl
=
URL
(
string
:
urlStr
)
// let tempUrl = URL(string: urlStr)
let
imageSourceRef
=
CGImageSourceCreateWithURL
(
tempUrl
!
as
CFURL
,
nil
)
// let imageSourceRef = CGImageSourceCreateWithURL(tempUrl! as CFURL, nil)
var
width
:
CGFloat
=
0
// var width: CGFloat = 0
var
height
:
CGFloat
=
0
// var height: CGFloat = 0
if
let
imageSRef
=
imageSourceRef
{
// if let imageSRef = imageSourceRef {
let
imageProperties
=
CGImageSourceCopyPropertiesAtIndex
(
imageSRef
,
0
,
nil
)
// let imageProperties = CGImageSourceCopyPropertiesAtIndex(imageSRef, 0, nil)
if
let
imageP
=
imageProperties
{
// if let imageP = imageProperties {
let
imageDict
=
imageP
as
Dictionary
// let imageDict = imageP as Dictionary
width
=
imageDict
[
kCGImagePropertyPixelWidth
]
as!
CGFloat
// width = imageDict[kCGImagePropertyPixelWidth] as! CGFloat
height
=
imageDict
[
kCGImagePropertyPixelHeight
]
as!
CGFloat
// height = imageDict[kCGImagePropertyPixelHeight] as! CGFloat
}
// }
}
// }
return
CGSize
(
width
:
width
,
height
:
height
)
return
CGSize
(
width
:
200
,
height
:
250
)
}
}
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/V/YHServiceTableFootView.swift
View file @
d18bb551
...
@@ -76,22 +76,22 @@ class YHServiceTableFootView: UIView {
...
@@ -76,22 +76,22 @@ class YHServiceTableFootView: UIView {
}
}
func
getImageSize
(
_
url
:
String
?)
->
CGSize
{
func
getImageSize
(
_
url
:
String
?)
->
CGSize
{
guard
let
urlStr
=
url
,
urlStr
.
count
!=
0
else
{
//
guard let urlStr = url, urlStr.count != 0 else {
return
CGSize
.
zero
//
return CGSize.zero
}
//
}
let
tempUrl
=
URL
(
string
:
urlStr
)
//
let tempUrl = URL(string: urlStr)
let
imageSourceRef
=
CGImageSourceCreateWithURL
(
tempUrl
!
as
CFURL
,
nil
)
//
let imageSourceRef = CGImageSourceCreateWithURL(tempUrl! as CFURL, nil)
var
width
:
CGFloat
=
0
//
var width: CGFloat = 0
var
height
:
CGFloat
=
0
//
var height: CGFloat = 0
if
let
imageSRef
=
imageSourceRef
{
//
if let imageSRef = imageSourceRef {
let
imageProperties
=
CGImageSourceCopyPropertiesAtIndex
(
imageSRef
,
0
,
nil
)
//
let imageProperties = CGImageSourceCopyPropertiesAtIndex(imageSRef, 0, nil)
if
let
imageP
=
imageProperties
{
//
if let imageP = imageProperties {
let
imageDict
=
imageP
as
Dictionary
//
let imageDict = imageP as Dictionary
width
=
imageDict
[
kCGImagePropertyPixelWidth
]
as!
CGFloat
//
width = imageDict[kCGImagePropertyPixelWidth] as! CGFloat
height
=
imageDict
[
kCGImagePropertyPixelHeight
]
as!
CGFloat
//
height = imageDict[kCGImagePropertyPixelHeight] as! CGFloat
}
//
}
}
//
}
return
CGSize
(
width
:
width
,
height
:
height
)
return
CGSize
(
width
:
150
,
height
:
250
)
}
}
}
}
...
...
galaxy/galaxy/Classes/Tools/YHOOS/YHOSSManager.swift
deleted
100644 → 0
View file @
94cb1c0a
//
// YHOOSManager.swift
// galaxy
//
// Created by EDY on 2024/1/16.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
public
protocol
Error
{
var
_domain
:
String
{
get
}
var
_code
:
Int
{
get
}
var
_userInfo
:
AnyObject
?
{
get
}
}
extension
NSError
:
Error
{
@nonobjc
public
var
_domain
:
String
{
return
domain
}
@nonobjc
public
var
_code
:
Int
{
return
code
}
@nonobjc
public
var
_userInfo
:
AnyObject
?
{
return
userInfo
as
NSDictionary
}
}
class
YHOSSDefine
{
static
let
OSS_ACCESSKEY_ID
:
String
=
"access_key_id"
static
let
OSS_SECRETKEY_ID
:
String
=
"access_key_secret"
static
let
OSS_BUCKET_PUBLIC
:
String
=
"public-bucket"
static
let
OSS_BUCKET_PRIVATE
:
String
=
"private-bucket"
static
let
OSS_ENDPOINT
:
String
=
"http://oss-cn-region.aliyuncs.com"
static
let
OSS_MULTIPART_UPLOADKEY
:
String
=
"multipart"
static
let
OSS_RESUMABLE_UPLOADKEY
:
String
=
"resumable"
static
let
OSS_CALLBACK_URL
:
String
=
"http://oss-demo.aliyuncs.com:23450"
static
let
OSS_CNAME_URL
:
String
=
"http://www.cnametest.com/"
static
let
OSS_STSTOKEN_URL
:
String
=
"http://*.*.*.*.****/sts/getsts"
static
let
OSS_IMAGE_KEY
:
String
=
"testImage.png"
static
let
OSS_CRC64_ENABLE
:
Bool
=
true
static
let
OSS_CONTENT_TYPE
:
String
=
"Content-Type"
static
let
OSS_CONTENT_LENGTH
:
String
=
"Content-Length"
static
let
OSS_TEST_CONTENT_TYPE
:
String
=
"application/special"
static
let
OSS_APPEND_OBJECT_KEY
:
String
=
"appendObject"
static
let
SCHEME
=
"https://"
static
let
ENDPOINT
=
"oss-cn-hangzhou.aliyuncs.com"
static
let
CNAME_ENDPOINT
=
"oss.custom.com"
static
let
IP_ENDPOINT
=
"192.168.1.1:8080"
static
let
BUCKET_NAME
=
"BucketName"
static
let
OBJECT_KEY
=
"ObjectKey"
}
class
YHOSSManager
:
NSObject
,
URLSessionDelegate
{
static
let
share
=
YHOSSManager
()
var
mProvider
:
OSSAuthCredentialProvider
!
var
mClient
:
OSSClient
!
override
init
()
{
mProvider
=
OSSAuthCredentialProvider
(
authServerUrl
:
YHOSSDefine
.
OSS_STSTOKEN_URL
)
mClient
=
OSSClient
(
endpoint
:
YHOSSDefine
.
OSS_ENDPOINT
,
credentialProvider
:
mProvider
)
}
func
getObject
()
{
let
getObjectReq
:
OSSGetObjectRequest
=
OSSGetObjectRequest
()
getObjectReq
.
bucketName
=
YHOSSDefine
.
OSS_BUCKET_PRIVATE
getObjectReq
.
objectKey
=
YHOSSDefine
.
OSS_IMAGE_KEY
getObjectReq
.
downloadProgress
=
{
(
bytesWritten
:
Int64
,
totalBytesWritten
:
Int64
,
totalBytesExpectedToWrite
:
Int64
)
->
Void
in
printLog
(
"bytesWritten:
\(
bytesWritten
)
,totalBytesWritten:
\(
totalBytesWritten
)
,totalBytesExpectedToWrite:
\(
totalBytesExpectedToWrite
)
"
)
};
let
task
:
OSSTask
=
mClient
.
getObject
(
getObjectReq
);
task
.
continue
({(
t
)
->
OSSTask
<
AnyObject
>
?
in
self
.
showResult
(
task
:
t
)
return
nil
})
task
.
waitUntilFinished
()
printLog
(
"Error:
\(
String
(
describing
:
task
.
error
)
)
"
)
}
func
getImage
()
{
let
getObjectReq
:
OSSGetObjectRequest
=
OSSGetObjectRequest
()
getObjectReq
.
bucketName
=
YHOSSDefine
.
OSS_BUCKET_PRIVATE
getObjectReq
.
objectKey
=
"ImageKey"
getObjectReq
.
xOssProcess
=
"image/resize,m_lfit,w_100,h_100"
getObjectReq
.
downloadProgress
=
{
(
bytesWritten
:
Int64
,
totalBytesWritten
:
Int64
,
totalBytesExpectedToWrite
:
Int64
)
->
Void
in
printLog
(
"bytesWritten:
\(
bytesWritten
)
,totalBytesWritten:
\(
totalBytesWritten
)
,totalBytesExpectedToWrite:
\(
totalBytesExpectedToWrite
)
"
)
};
let
task
:
OSSTask
=
mClient
.
getObject
(
getObjectReq
);
task
.
continue
({(
t
)
->
OSSTask
<
AnyObject
>
?
in
self
.
showResult
(
task
:
t
)
return
nil
})
task
.
waitUntilFinished
()
printLog
(
"Error:
\(
String
(
describing
:
task
.
error
)
)
"
)
}
func
getStsToken
()
{
let
tcs
=
OSSTaskCompletionSource
<
AnyObject
>
()
let
federationProvider
:
OSSFederationCredentialProvider
=
OSSFederationCredentialProvider
(
federationTokenGetter
:
{()
->
OSSFederationToken
?
in
let
url
:
URL
=
URL
(
string
:
YHOSSDefine
.
OSS_STSTOKEN_URL
)
!
let
config
:
URLSessionConfiguration
=
URLSessionConfiguration
.
default
let
session
:
URLSession
=
URLSession
(
configuration
:
config
,
delegate
:
self
as
URLSessionDelegate
,
delegateQueue
:
nil
)
let
task
=
session
.
dataTask
(
with
:
url
,
completionHandler
:
{
(
data
,
response
,
error
)
->
Void
in
//Convert Data to Jsons
tcs
.
setResult
(
data
as
AnyObject
)
})
task
.
resume
()
tcs
.
task
.
waitUntilFinished
()
let
json
=
try
?
JSONSerialization
.
jsonObject
(
with
:
tcs
.
task
.
result
as!
Data
,
options
:
.
allowFragments
)
as?
[
String
:
Any
]
print
(
"Json Object:"
,
json
as
Any
)
//verify json
let
accessKeyId
=
json
?[
"AccessKeyId"
]
let
accessKeySecret
=
json
?[
"AccessKeySecret"
]
self
.
ossAlert
(
title
:
"notice"
,
message
:
json
?
.
description
)
let
token
=
OSSFederationToken
()
token
.
tAccessKey
=
accessKeyId
as!
String
token
.
tSecretKey
=
accessKeySecret
as!
String
return
token
})
do
{
try
federationProvider
.
getToken
()
}
catch
{
print
(
"get Error"
)
}
}
func
headObject
()
{
let
objectKey
=
"key"
if
objectKey
.
isEmpty
{
ossAlert
(
title
:
nil
,
message
:
"objectKey can not be empty!"
)
}
let
request
=
OSSHeadObjectRequest
()
request
.
bucketName
=
YHOSSDefine
.
OSS_BUCKET_PRIVATE
request
.
objectKey
=
objectKey
let
task
:
OSSTask
=
mClient
.
headObject
(
request
)
task
.
continue
({(
task
)
->
OSSTask
<
AnyObject
>
?
in
self
.
showResult
(
task
:
task
)
return
nil
})
task
.
waitUntilFinished
()
}
func
getBucket
()
{
let
request
=
OSSGetBucketRequest
()
request
.
bucketName
=
YHOSSDefine
.
OSS_BUCKET_PRIVATE
let
task
=
mClient
.
getBucket
(
request
)
task
.
continue
(
{
(
t
)
->
Any
?
in
if
let
result
=
t
.
result
as?
OSSGetBucketResult
{
self
.
showResult
(
task
:
OSSTask
(
result
:
result
.
contents
as
AnyObject
))
}
else
{
self
.
showResult
(
task
:
t
)
}
return
nil
})
}
func
getBucketACL
()
->
Void
{
let
request
=
OSSGetBucketACLRequest
()
request
.
bucketName
=
YHOSSDefine
.
OSS_BUCKET_PRIVATE
let
task
=
mClient
.
getBucketACL
(
request
)
task
.
continue
(
{
(
t
)
->
Any
?
in
if
let
result
=
t
.
result
as?
OSSGetBucketACLResult
{
self
.
showResult
(
task
:
OSSTask
(
result
:
result
.
aclGranted
as
AnyObject
))
}
else
{
self
.
showResult
(
task
:
t
)
}
return
nil
})
}
func
createBucket
()
->
Void
{
let
request
=
OSSCreateBucketRequest
()
request
.
bucketName
=
"com-dhc-test"
let
task
=
mClient
.
createBucket
(
request
)
task
.
continue
(
{
(
t
)
->
Any
?
in
self
.
showResult
(
task
:
t
)
return
nil
})
}
func
deleteBucket
()
->
Void
{
let
request
=
OSSDeleteBucketRequest
()
request
.
bucketName
=
"com-dhc-test"
let
task
=
mClient
.
deleteBucket
(
request
)
task
.
continue
(
{
(
t
)
->
Any
?
in
self
.
showResult
(
task
:
t
)
return
nil
})
}
func
putObject
(
image
:
UIImage
)
{
let
request
=
OSSPutObjectRequest
()
request
.
uploadingData
=
image
.
pngData
()
!
request
.
bucketName
=
YHOSSDefine
.
OSS_BUCKET_PRIVATE
request
.
objectKey
=
"landscape-painting.jpeg"
request
.
uploadProgress
=
{
(
bytesSent
:
Int64
,
totalBytesSent
:
Int64
,
totalBytesExpectedToSend
:
Int64
)
->
Void
in
printLog
(
"bytesSent:
\(
bytesSent
)
,totalBytesSent:
\(
totalBytesSent
)
,totalBytesExpectedToSend:
\(
totalBytesExpectedToSend
)
"
)
};
let
provider
=
OSSFederationTokenCredentialProvider
{
let
tcs
=
TaskCompletionSource
()
DispatchQueue
(
label
:
"test"
)
.
async
{
Thread
.
sleep
(
forTimeInterval
:
10
)
let
token
=
OSSFederationToken
()
token
.
tAccessKey
=
"STS.tAccessKey"
token
.
tSecretKey
=
"tSecretKey"
token
.
tToken
=
"tToken"
token
.
expirationTimeInGMTFormat
=
"2023-05-23T07:34:27Z"
// or tcs.trySetError(<#T##error: Error##Error#>)
tcs
.
trySetResult
(
token
)
}
tcs
.
wait
(
timeout
:
5
)
if
let
error
=
tcs
.
task
.
error
{
let
nsError
=
error
as
NSError
if
nsError
.
code
==
OSSClientErrorCODE
.
codeNotKnown
.
rawValue
,
let
errorMessage
=
nsError
.
userInfo
[
OSSErrorMessageTOKEN
]
as?
String
,
errorMessage
==
"TaskCompletionSource wait timeout."
{
// 超时错误
}
throw
error
}
else
if
let
result
=
tcs
.
task
.
result
as?
OSSFederationToken
{
return
result
}
throw
NSError
(
domain
:
OSSClientErrorDomain
,
code
:
OSSClientErrorCODE
.
codeSignFailed
.
rawValue
,
userInfo
:
[
OSSErrorMessageTOKEN
:
"Can not get FederationToken."
])
}
let
client
=
OSSClient
(
endpoint
:
YHOSSDefine
.
OSS_ENDPOINT
,
credentialProvider
:
provider
)
let
task
=
client
.
putObject
(
request
)
task
.
continue
({
(
t
)
->
Any
?
in
self
.
showResult
(
task
:
t
)
})
.
waitUntilFinished
()
}
func
multipartUpload
()
{
let
request
=
OSSMultipartUploadRequest
()
request
.
uploadingFileURL
=
Bundle
.
main
.
url
(
forResource
:
"wangwang"
,
withExtension
:
"zip"
)
!
request
.
bucketName
=
YHOSSDefine
.
OSS_BUCKET_PRIVATE
request
.
objectKey
=
"wangwang(swift).zip"
request
.
partSize
=
102400
;
request
.
uploadProgress
=
{
(
bytesSent
:
Int64
,
totalBytesSent
:
Int64
,
totalBytesExpectedToSend
:
Int64
)
->
Void
in
printLog
(
"bytesSent:
\(
bytesSent
)
,totalBytesSent:
\(
totalBytesSent
)
,totalBytesExpectedToSend:
\(
totalBytesExpectedToSend
)
"
)
};
let
provider
=
OSSAuthCredentialProvider
(
authServerUrl
:
YHOSSDefine
.
OSS_STSTOKEN_URL
)
let
client
=
OSSClient
(
endpoint
:
YHOSSDefine
.
OSS_ENDPOINT
,
credentialProvider
:
provider
)
let
task
=
client
.
multipartUpload
(
request
)
task
.
continue
({
(
t
)
->
Any
?
in
self
.
showResult
(
task
:
t
)
})
.
waitUntilFinished
()
}
func
sequentialMultipartUpload
()
{
let
request
=
OSSResumableUploadRequest
()
request
.
bucketName
=
YHOSSDefine
.
OSS_BUCKET_PRIVATE
;
request
.
objectKey
=
"sequential-swift-multipart"
request
.
uploadingFileURL
=
Bundle
.
main
.
url
(
forResource
:
"wangwang"
,
withExtension
:
"zip"
)
!
request
.
deleteUploadIdOnCancelling
=
false
request
.
crcFlag
=
OSSRequestCRCFlag
.
open
let
filePath
=
Bundle
.
main
.
path
(
forResource
:
"wangwang"
,
ofType
:
"zip"
)
request
.
contentSHA1
=
OSSUtil
.
sha1
(
withFilePath
:
filePath
)
let
task
=
mClient
.
sequentialMultipartUpload
(
request
)
task
.
continue
({
(
t
)
->
Any
?
in
self
.
showResult
(
task
:
t
)
return
nil
})
.
waitUntilFinished
()
}
func
resumableUpload
()
{
var
request
=
OSSResumableUploadRequest
()
request
.
uploadingFileURL
=
Bundle
.
main
.
url
(
forResource
:
"wangwang"
,
withExtension
:
"zip"
)
!
request
.
bucketName
=
YHOSSDefine
.
OSS_BUCKET_PRIVATE
request
.
deleteUploadIdOnCancelling
=
false
request
.
objectKey
=
"wangwang(swift).zip"
let
cacheDir
=
NSSearchPathForDirectoriesInDomains
(
FileManager
.
SearchPathDirectory
.
cachesDirectory
,
FileManager
.
SearchPathDomainMask
.
userDomainMask
,
true
)
.
first
request
.
recordDirectoryPath
=
cacheDir
!
request
.
partSize
=
102400
request
.
uploadProgress
=
{
(
bytesSent
:
Int64
,
totalBytesSent
:
Int64
,
totalBytesExpectedToSend
:
Int64
)
->
Void
in
printLog
(
"bytesSent:
\(
bytesSent
)
,totalBytesSent:
\(
totalBytesSent
)
,totalBytesExpectedToSend:
\(
totalBytesExpectedToSend
)
"
)
if
totalBytesSent
>
(
totalBytesExpectedToSend
/
2
)
{
request
.
cancel
()
}
}
var
task
=
mClient
.
resumableUpload
(
request
)
task
.
continue
({
(
t
)
->
Any
?
in
print
(
"Error:
\(
String
(
describing
:
t
.
error
)
)
"
)
return
nil
})
.
waitUntilFinished
()
request
=
OSSResumableUploadRequest
()
request
.
uploadingFileURL
=
Bundle
.
main
.
url
(
forResource
:
"wangwang"
,
withExtension
:
"zip"
)
!
request
.
bucketName
=
YHOSSDefine
.
OSS_BUCKET_PRIVATE
request
.
objectKey
=
"wangwang(swift).zip"
request
.
partSize
=
102400
;
request
.
deleteUploadIdOnCancelling
=
false
request
.
recordDirectoryPath
=
cacheDir
!
request
.
uploadProgress
=
{
(
bytesSent
:
Int64
,
totalBytesSent
:
Int64
,
totalBytesExpectedToSend
:
Int64
)
->
Void
in
printLog
(
"bytesSent:
\(
bytesSent
)
,totalBytesSent:
\(
totalBytesSent
)
,totalBytesExpectedToSend:
\(
totalBytesExpectedToSend
)
"
)
}
task
=
mClient
.
resumableUpload
(
request
)
task
.
continue
({
(
t
)
->
Any
?
in
self
.
showResult
(
task
:
t
)
return
nil
})
.
waitUntilFinished
()
}
func
putObjectWithXML
()
{
let
request
=
OSSPutObjectRequest
()
request
.
uploadingFileURL
=
Bundle
.
main
.
url
(
forResource
:
"test"
,
withExtension
:
"xml"
)
!
request
.
bucketName
=
YHOSSDefine
.
OSS_BUCKET_PRIVATE
request
.
objectKey
=
"test.xml"
request
.
contentSHA1
=
OSSUtil
.
sha1
(
withFilePath
:
Bundle
.
main
.
path
(
forResource
:
"test"
,
ofType
:
"xml"
))
request
.
uploadProgress
=
{
(
bytesSent
:
Int64
,
totalBytesSent
:
Int64
,
totalBytesExpectedToSend
:
Int64
)
->
Void
in
print
(
"bytesSent:
\(
bytesSent
)
,totalBytesSent:
\(
totalBytesSent
)
,totalBytesExpectedToSend:
\(
totalBytesExpectedToSend
)
"
);
};
let
task
=
mClient
.
putObject
(
request
)
task
.
continue
({
(
t
)
->
Any
?
in
self
.
showResult
(
task
:
t
)
})
.
waitUntilFinished
()
}
func
getObjectACL
()
{
let
request
=
OSSGetObjectACLRequest
()
request
.
bucketName
=
YHOSSDefine
.
OSS_BUCKET_PRIVATE
request
.
objectName
=
YHOSSDefine
.
OSS_IMAGE_KEY
let
task
=
mClient
.
getObjectACL
(
request
)
task
.
continue
({
(
t
)
->
Any
?
in
self
.
showResult
(
task
:
t
)
return
nil
})
.
waitUntilFinished
()
}
func
deleteMultipleObjects
()
{
let
request
=
OSSDeleteMultipleObjectsRequest
()
request
.
bucketName
=
YHOSSDefine
.
OSS_BUCKET_PRIVATE
request
.
keys
=
[
"testFor5m"
]
request
.
quiet
=
false
request
.
encodingType
=
"url"
let
task
=
mClient
.
deleteMultipleObjects
(
request
)
task
.
continue
({
(
t
)
->
Any
?
in
self
.
showResult
(
task
:
t
)
return
nil
})
.
waitUntilFinished
()
}
func
triggerCallBack
()
{
let
provider
=
OSSPlainTextAKSKPairCredentialProvider
.
init
(
plainTextAccessKey
:
"AK"
,
secretKey
:
"SK"
)
let
pClient
=
OSSClient
.
init
(
endpoint
:
YHOSSDefine
.
OSS_ENDPOINT
,
credentialProvider
:
provider
)
let
request
=
OSSCallBackRequest
()
request
.
bucketName
=
YHOSSDefine
.
OSS_BUCKET_PRIVATE
request
.
objectName
=
"file1m"
request
.
callbackVar
=
[
"key1"
:
"value1"
,
"key2"
:
"value2"
]
request
.
callbackParam
=
[
"callbackUrl"
:
YHOSSDefine
.
OSS_CALLBACK_URL
,
"callbackBody"
:
"test"
]
let
task
=
pClient
.
triggerCallBack
(
request
)
task
.
continue
({
(
t
)
->
Any
?
in
if
(
t
.
result
!=
nil
)
{
let
result
=
t
.
result
as!
OSSCallBackResult
;
self
.
ossAlert
(
title
:
"提示"
,
message
:
result
.
serverReturnJsonString
);
}
return
nil
})
.
waitUntilFinished
()
}
//验证结果
func
showResult
(
task
:
OSSTask
<
AnyObject
>
?)
{
if
(
task
?
.
error
!=
nil
)
{
let
error
:
NSError
=
(
task
?
.
error
)
!
as
NSError
self
.
ossAlert
(
title
:
"error"
,
message
:
error
.
description
)
}
else
{
let
result
=
task
?
.
result
self
.
ossAlert
(
title
:
"notice"
,
message
:
result
?
.
description
)
}
}
func
ossAlert
(
title
:
String
?,
message
:
String
?)
{
DispatchQueue
.
main
.
async
{
let
alertCtrl
=
UIAlertController
(
title
:
title
,
message
:
message
,
preferredStyle
:
UIAlertController
.
Style
.
alert
)
alertCtrl
.
addAction
(
UIAlertAction
(
title
:
"confirm"
,
style
:
UIAlertAction
.
Style
.
default
,
handler
:
{
(
action
)
in
print
(
"
\(
action
.
title
!
)
has been clicked"
);
alertCtrl
.
dismiss
(
animated
:
true
,
completion
:
nil
)
}))
UIViewController
.
current
?
.
present
(
alertCtrl
,
animated
:
true
,
completion
:
nil
)
}
}
}
public
class
OSSFederationTokenCredentialProvider
:
OSSFederationCredentialProvider
{
var
token
:
OSSFederationToken
?
private
var
tokenGetter
:
()
throws
->
OSSFederationToken
public
init
(
tokenGetter
:
@escaping
()
throws
->
OSSFederationToken
)
{
self
.
tokenGetter
=
tokenGetter
super
.
init
()
}
public
override
func
getToken
()
throws
->
OSSFederationToken
{
do
{
if
var
token
=
token
{
if
let
expirationTimeInGMTFormat
=
token
.
expirationTimeInGMTFormat
{
let
dateFormatter
=
DateFormatter
()
dateFormatter
.
timeZone
=
TimeZone
(
identifier
:
"GMT"
)
dateFormatter
.
locale
=
Locale
(
identifier
:
"en_US_POSIX"
)
dateFormatter
.
dateFormat
=
"yyyy-MM-dd'T'HH:mm:ssZ"
if
let
data
=
dateFormatter
.
date
(
from
:
expirationTimeInGMTFormat
)
{
token
.
expirationTimeInMilliSecond
=
Int64
(
data
.
timeIntervalSince1970
*
1000
)
}
}
let
expirationDate
=
Date
(
timeIntervalSince1970
:
TimeInterval
(
token
.
expirationTimeInMilliSecond
/
1000
))
let
interval
=
expirationDate
.
timeIntervalSince
(
NSDate
.
oss_clockSkewFixed
())
if
interval
<
5
*
60
{
token
=
try
self
.
tokenGetter
()
self
.
token
=
token
}
return
token
}
else
{
let
token
=
try
self
.
tokenGetter
()
self
.
token
=
token
return
token
}
}
catch
{
throw
NSError
(
domain
:
OSSClientErrorDomain
,
code
:
OSSClientErrorCODE
.
codeSignFailed
.
rawValue
,
userInfo
:
[
OSSErrorMessageTOKEN
:
error
])
}
}
}
public
class
TaskCompletionSource
:
OSSTaskCompletionSource
<
AnyObject
>
{
public
func
wait
(
timeout
:
TimeInterval
)
{
let
timer
=
DispatchSource
.
makeTimerSource
()
timer
.
schedule
(
deadline
:
.
now
()
+
timeout
)
timer
.
setEventHandler
{
if
!
self
.
task
.
isCompleted
{
let
error
=
NSError
(
domain
:
OSSClientErrorDomain
,
code
:
OSSClientErrorCODE
.
codeNotKnown
.
rawValue
,
userInfo
:
[
OSSErrorMessageTOKEN
:
"TaskCompletionSource wait timeout."
])
self
.
trySetError
(
error
)
}
}
timer
.
resume
()
task
.
waitUntilFinished
()
timer
.
cancel
()
}
}
galaxy/galaxy/Res/galaxy-Bridge-Header.h
View file @
d18bb551
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
#import <Bugly/Bugly.h>
#import <Bugly/Bugly.h>
#import <ATAuthSDK_D/ATAuthSDK.h>
#import <ATAuthSDK_D/ATAuthSDK.h>
#import <AliyunOSSiOS/OSSService.h>
//
#import <AliyunOSSiOS/OSSService.h>
#import "JPUSHService.h"
#import "JPUSHService.h"
// iOS10注册APNs所需头文件
// iOS10注册APNs所需头文件
...
...
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