| | |
| | | case DataAnalysis(String) |
| | | } |
| | | |
| | | class func request<T: HandyJSON>(params: ParamsAppender, method: HTTPMethod, encoding: ParameterEncoding? = nil, progress: Bool = true) -> Observable<BaseResponse<T>>{ |
| | | class func request<T: HandyJSON>(params: ParamsAppender, method: HTTPMethod, encoding: ParameterEncoding? = nil, progress: Bool = true,ignoreAlert:Bool = false) -> Observable<BaseResponse<T>>{ |
| | | |
| | | return Observable<BaseResponse<T>>.create{ ob in |
| | | guard NetworkReachabilityManager.init(host: All_Url)!.isReachable else { |
| | |
| | | |
| | | } |
| | | ob.onError(NetRequestError.InvaildSession) |
| | | case 600:alertError(msg: "登录失效,请重新登录");ob.onError(NetRequestError.InvaildSession) |
| | | case 600: |
| | | if !ignoreAlert{ |
| | | alertError(msg: "登录失效,请重新登录");ob.onError(NetRequestError.InvaildSession) |
| | | } |
| | | app.needLogin() |
| | | default: |
| | | alertError(msg: "\(next.msg)") |
| | | if !ignoreAlert{ |
| | | alertError(msg: "\(next.msg)") |
| | | } |
| | | ob.onError(NetRequestError.Other(next.code,next.msg)) |
| | | } |
| | | } |