Commit d526fc42 authored by Steven杜宇's avatar Steven杜宇

// web添加阿里云日志

parent c3e7ca4e
......@@ -82,6 +82,8 @@ class YHHomeHoldViewPageViewController: YHBaseViewController {
}
checkHomeAlertView()
getCurrentUserInfo()
}
......@@ -368,7 +370,7 @@ extension YHHomeHoldViewPageViewController {
if !YHLoginManager.shared.isLogin() {
return
}
guard let mobile = YHLoginManager.shared.userModel?.mobile else {
if let mobile = YHLoginManager.shared.userModel?.mobile, !mobile.isEmpty {
return
}
self.loginViewModel.getUserInfo { success, error in
......
......@@ -22,6 +22,12 @@ extension YHJsApi {
@objc func disableFullScreenGestureSyn(_ tag : Any) {
DispatchQueue.main.async {
if let tag = tag as? String, tag.count == 1 {
let dic: [AnyHashable : Any] = [
"function" : "disableFullScreenGestureSyn",
"tag" : tag]
YHAliYunLogManager.shared.addModuleName(.h5InteractionType, remark: dic)
if let delegate = self.delegate as? YHH5WebViewVC {
delegate.disableFullScreenGestureSyn(tag)
}
......@@ -31,6 +37,13 @@ extension YHJsApi {
//21、使用safari WebView打开Url
@objc func openUrlWithSafariSyn(_ payUrl: String) {
let dic: [AnyHashable : Any] = [
"function" : "openUrlWithSafariSyn",
"payUrl" : payUrl
]
YHAliYunLogManager.shared.addModuleName(.h5InteractionType, remark: dic)
DispatchQueue.main.async {
if !payUrl.isEmpty,let url = URL(string: payUrl) {
let safariViewController = SFSafariViewController(url: url)
......@@ -47,6 +60,12 @@ extension YHJsApi {
@objc func hideNavigationTitleSyn(_ tag : Any) {
DispatchQueue.main.async {
if let tag = tag as? String, tag.count == 1 {
let dic: [AnyHashable : Any] = [
"function" : "hideNavigationTitleSyn",
"tag" : tag]
YHAliYunLogManager.shared.addModuleName(.h5InteractionType, remark: dic)
if let delegate = self.delegate as? YHH5WebViewVC {
delegate.hideNavigationTitleSyn(tag)
}
......@@ -56,6 +75,11 @@ extension YHJsApi {
//19、返回时刷新界面
@objc func reloadwebVeiwSyn(_ tag : Any) {
let dic: [AnyHashable : Any] = [
"function" : "reloadwebVeiwSyn"]
YHAliYunLogManager.shared.addModuleName(.h5InteractionType, remark: dic)
DispatchQueue.main.async {
if let delegate = self.delegate as? YHH5WebViewVC {
delegate.reloadwebVeiwSyn()
......@@ -76,6 +100,13 @@ extension YHJsApi {
if let data = dicData.data(using: .utf8) {
do {
if let jsonObject = try JSONSerialization.jsonObject(with: data, options: []) as? [String: Any] {
let dic: [AnyHashable : Any] = [
"function" : "shareH5Syn",
"dicData" : dicData
]
YHAliYunLogManager.shared.addModuleName(.h5InteractionType, remark: dic)
// 转换成功,jsonObject 是一个字典
print("JSON字符串转换为字典成功: \(jsonObject)")
/*
......@@ -116,6 +147,13 @@ extension YHJsApi {
DispatchQueue.main.async {
// let tUrl = "https://test-sign.galaxy-immi.com/webPayConfirm?id=dXlHS3RRQUV4QmZ2KzRwM0phRTVyMXdWUnVjUjJvRHdmQmNWVDV0UW1Zbz0="//测试环境
// let tUrl = "https://beta-sign.galaxy-immi.com/webPayConfirm?id=Qk9sbUlzenp0OGFOdVZ4ekphQXJGWnJ0ODdBS3gxdWNJcURrOHBLbm4xND0%3D"//正式环境
let dic: [AnyHashable : Any] = [
"function" : "cmbPaySyn",
"payUrl" : payUrl
]
YHAliYunLogManager.shared.addModuleName(.h5InteractionType, remark: dic)
if !payUrl.isEmpty,let url = URL(string: payUrl) {
let safariViewController = SFSafariViewController(url: url)
safariViewController.dismissButtonStyle = .close
......@@ -131,6 +169,13 @@ extension YHJsApi {
@objc func loginAndRefeshWithTokenSyn(_ tag : Any) {
DispatchQueue.main.async {
if let tag = tag as? String, tag.count == 1 {
let dic: [AnyHashable : Any] = [
"function" : "loginAndRefeshWithTokenSyn",
"tag" : tag
]
YHAliYunLogManager.shared.addModuleName(.h5InteractionType, remark: dic)
if let delegate = self.delegate as? YHH5WebViewVC {
delegate.loginAndRefeshWithTokenSyn(tag)
}
......@@ -142,6 +187,13 @@ extension YHJsApi {
@objc func hideNavigationBarSyn(_ tag : Any) {
DispatchQueue.main.async {
if let tag = tag as? String, tag.count == 1 {
let dic: [AnyHashable : Any] = [
"function" : "hideNavigationBarSyn",
"tag" : tag
]
YHAliYunLogManager.shared.addModuleName(.h5InteractionType, remark: dic)
if let delegate = self.delegate as? YHH5WebViewVC {
delegate.hideNavigationBarSyn(tag)
}
......@@ -153,6 +205,13 @@ extension YHJsApi {
@objc func supportFullScreenSyn(_ tag : Any) {
DispatchQueue.main.async {
if let tag = tag as? String, tag.count == 1 {
let dic: [AnyHashable : Any] = [
"function" : "supportFullScreenSyn",
"tag" : tag
]
YHAliYunLogManager.shared.addModuleName(.h5InteractionType, remark: dic)
if let delegate = self.delegate as? YHH5WebViewVC {
delegate.supportFullScreenSyn(tag)
}
......@@ -164,6 +223,13 @@ extension YHJsApi {
@objc func supportInnerBackSyn(_ tag : Any) {
DispatchQueue.main.async {
if let tag = tag as? String, tag.count == 1 {
let dic: [AnyHashable : Any] = [
"function" : "supportInnerBackSyn",
"tag" : tag
]
YHAliYunLogManager.shared.addModuleName(.h5InteractionType, remark: dic)
if let delegate = self.delegate as? YHH5WebViewVC {
delegate.supportInnerBackSyn(tag)
}
......@@ -176,6 +242,12 @@ extension YHJsApi {
DispatchQueue.main.async {
if let color = color as? String, color.count == 1 {
let dic: [AnyHashable : Any] = [
"function" : "setNavigationBackColor",
"color" : color
]
YHAliYunLogManager.shared.addModuleName(.h5InteractionType, remark: dic)
if let delegate = self.delegate as? YHH5WebViewVC {
delegate.setNavigationBackColor(color)
}
......@@ -187,6 +259,13 @@ extension YHJsApi {
@objc func appCallPhoneSyn(_ phoneNumber : Any) {
DispatchQueue.main.async {
if let phone = phoneNumber as? String, phone.count > 0 {
let dic: [AnyHashable : Any] = [
"function" : "appCallPhoneSyn",
"phone" : phone
]
YHAliYunLogManager.shared.addModuleName(.h5InteractionType, remark: dic)
if let url = URL(string: "tel://\(phone)"),UIApplication.shared.canOpenURL(url) {
UIApplication.shared.open(url, options: [:], completionHandler: nil)
} else {
......@@ -202,6 +281,13 @@ extension YHJsApi {
if let data = dicData.data(using: .utf8) {
do {
if let jsonObject = try JSONSerialization.jsonObject(with: data, options: []) as? [String: Any] {
let dic: [AnyHashable : Any] = [
"function" : "goNewsInformationListUISyn",
"dicData" : dicData
]
YHAliYunLogManager.shared.addModuleName(.h5InteractionType, remark: dic)
// 转换成功,jsonObject 是一个字典
print("JSON字符串转换为字典成功: \(jsonObject)")
/*
......@@ -239,6 +325,13 @@ extension YHJsApi {
@objc func goCaseShareUISyn(_ caseId: Any) {
DispatchQueue.main.async {
if let sId = caseId as? String, let id = Int(sId) {
let dic: [AnyHashable : Any] = [
"function" : "goCaseShareUISyn",
"id" : id
]
YHAliYunLogManager.shared.addModuleName(.h5InteractionType, remark: dic)
let vc = YHResignGuidelinesExampleViewController()
vc.id = id
self.delegate?.navigationController?.pushViewController(vc)
......@@ -248,6 +341,12 @@ extension YHJsApi {
//7、跳转 首页-生活 tab
@objc func goHomeLifeTabSyn(_ fake : Any) {
let dic: [AnyHashable : Any] = [
"function" : "goHomeLifeTabSyn",
]
YHAliYunLogManager.shared.addModuleName(.h5InteractionType, remark: dic)
DispatchQueue.main.async {
UIViewController.current?.navigationController?.popToRootViewController(animated: false)
goTabBarBy(tabType: .home)
......@@ -265,6 +364,13 @@ extension YHJsApi {
if let data = dicData.data(using: .utf8) {
do {
if let jsonObject = try JSONSerialization.jsonObject(with: data, options: []) as? [String: Any] {
let dic: [AnyHashable : Any] = [
"function" : "goH5UISyn",
"dicData" : dicData
]
YHAliYunLogManager.shared.addModuleName(.h5InteractionType, remark: dic)
// 转换成功,jsonObject 是一个字典
print("JSON字符串转换为字典成功: \(jsonObject)")
/*
......@@ -329,6 +435,12 @@ extension YHJsApi {
//5、返回App上一个界面
@objc func backToAppPreView(_ fake : Any) {
let dic: [AnyHashable : Any] = [
"function" : "backToAppPreView",
]
YHAliYunLogManager.shared.addModuleName(.h5InteractionType, remark: dic)
DispatchQueue.main.async {
if let delegate = self.delegate as? YHH5WebViewVC {
delegate.backToAppPreView()
......@@ -340,6 +452,14 @@ extension YHJsApi {
@objc func setAppNavigation(_ tag : Any) {
DispatchQueue.main.async {
let tmp : Bool = tag as? Bool ?? false
let dic: [AnyHashable : Any] = [
"function" : "setAppNavigation",
"tag" : tmp
]
YHAliYunLogManager.shared.addModuleName(.h5InteractionType, remark: dic)
if let delegate = self.delegate as? YHH5WebViewVC {
delegate.setAppNavigation(tmp)
}
......@@ -351,6 +471,13 @@ extension YHJsApi {
@objc func gotoAppointCertificateSyn(_ orderID : String) {
DispatchQueue.main.async {
if let orderId = Int(orderID) {
let dic: [AnyHashable : Any] = [
"function" : "gotoAppointCertificateSyn",
"orderID" : orderId
]
YHAliYunLogManager.shared.addModuleName(.h5InteractionType, remark: dic)
let vc = YHCertificateAppointViewController()
vc.orderId = orderId
self.delegate?.navigationController?.pushViewController(vc)
......@@ -364,6 +491,13 @@ extension YHJsApi {
if let data = dicData.data(using: .utf8) {
do {
if let jsonObject = try JSONSerialization.jsonObject(with: data, options: []) as? [String: Any] {
let dic: [AnyHashable : Any] = [
"function" : "gotoAppointCertificateSyn",
"dicData" : dicData
]
YHAliYunLogManager.shared.addModuleName(.h5InteractionType, remark: dic)
// 转换成功,jsonObject 是一个字典
print("JSON字符串转换为字典成功: \(jsonObject)")
......@@ -390,6 +524,12 @@ extension YHJsApi {
@objc func saveLocalPictureSyn(_ picUrl: String) {
DispatchQueue.main.async {
let dic: [AnyHashable : Any] = [
"function" : "saveLocalPictureSyn",
"picUrl" : picUrl
]
YHAliYunLogManager.shared.addModuleName(.h5InteractionType, remark: dic)
if let delegate = self.delegate as? YHH5WebViewVC {
delegate.saveLocalPictureSyn(picUrl)
}
......
......@@ -211,8 +211,8 @@ extension YHLoginViewModel {
func getUserInfo(callBackBlock: @escaping (_ success: Bool,_ error:YHErrorModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.User.verifyCode
let _ = YHNetRequest.postRequest(url: strUrl) {[weak self] json, code in
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.User.userInfo
let _ = YHNetRequest.getRequest(url: strUrl) {[weak self] json, code in
guard self != nil else { return }
//1. json字符串 转 对象
......
......@@ -268,6 +268,7 @@ class YHAllApiName {
//获取验证
struct User {
static let verifyCode = "cuser/user/verify-code"
static let userInfo = "super-app/user/current-info"
}
//预览相关接口
......
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