| | |
| | | return Alamofire.Session(configuration: configuration) |
| | | }() |
| | | enum NetRequestError: Error { |
| | | case Other(String) |
| | | case Other(Int,String) |
| | | case URLNotFound |
| | | case DownloadFailed |
| | | case InvaildSession |
| | |
| | | ob.onError(NetRequestError.InvaildSession) |
| | | case 600:alertError(msg: "登录失效,请重新登录");ob.onError(NetRequestError.InvaildSession) |
| | | app.needLogin() |
| | | default:alertError(msg: "\(next.msg)");ob.onError(NetRequestError.Other(next.msg)) |
| | | default: |
| | | alertError(msg: "\(next.msg)") |
| | | ob.onError(NetRequestError.Other(next.code,next.msg)) |
| | | } |
| | | } |
| | | } |