webview的数据为空时,可能引发的崩溃
This commit is contained in:
Binary file not shown.
@@ -4797,5 +4797,21 @@
|
|||||||
landmarkType = "7">
|
landmarkType = "7">
|
||||||
</BreakpointContent>
|
</BreakpointContent>
|
||||||
</BreakpointProxy>
|
</BreakpointProxy>
|
||||||
|
<BreakpointProxy
|
||||||
|
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||||
|
<BreakpointContent
|
||||||
|
uuid = "2E8B1F92-DA50-4028-824C-3F24E51EEA0C"
|
||||||
|
shouldBeEnabled = "No"
|
||||||
|
ignoreCount = "0"
|
||||||
|
continueAfterRunningActions = "No"
|
||||||
|
filePath = "OrderScheduling/Common/WebView/WebViewTool.swift"
|
||||||
|
startingColumnNumber = "9223372036854775807"
|
||||||
|
endingColumnNumber = "9223372036854775807"
|
||||||
|
startingLineNumber = "59"
|
||||||
|
endingLineNumber = "59"
|
||||||
|
landmarkName = "init()"
|
||||||
|
landmarkType = "7">
|
||||||
|
</BreakpointContent>
|
||||||
|
</BreakpointProxy>
|
||||||
</Breakpoints>
|
</Breakpoints>
|
||||||
</Bucket>
|
</Bucket>
|
||||||
|
|||||||
@@ -61,9 +61,13 @@ open class WebViewTool : NSObject {
|
|||||||
let tabBarVc = UIApplication.shared.dd_keyWindow.rootViewController as? UITabBarController
|
let tabBarVc = UIApplication.shared.dd_keyWindow.rootViewController as? UITabBarController
|
||||||
let nav = tabBarVc?.selectedViewController as? UINavigationController
|
let nav = tabBarVc?.selectedViewController as? UINavigationController
|
||||||
nav?.topViewController?.view.dd_hideHUD()
|
nav?.topViewController?.view.dd_hideHUD()
|
||||||
|
// 仅当有数据才会打开webview,不然提示加载失败
|
||||||
self?.h5Models = response?.data
|
if response?.success == true, let data = response?.data {
|
||||||
|
self?.h5Models = data
|
||||||
self?.openWebView(name: name,appending: appending)
|
self?.openWebView(name: name,appending: appending)
|
||||||
|
}else{
|
||||||
|
nav?.topViewController?.view.dd_makeToast(webViewLoadFailed)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.disposed(by: disposeBag)
|
.disposed(by: disposeBag)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user