无故事王国
2023-11-02 cff96b5ae124efe4379cb4dc1695d668f3190a49
WanPai/Network/NetworkRequest.swift
@@ -181,7 +181,7 @@
        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 {
@@ -236,10 +236,15 @@
                        }
                        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))
                        }
                    }