| | |
| | | import CoreLocation |
| | | |
| | | #if DEBUG |
| | | let All_Url = "https://xq.xqzhihui.com/api" |
| | | //let All_Url = "http://192.168.110.64:9000" |
| | | //let All_Url = "https://xq.xqzhihui.com/api" |
| | | let All_Url = "http://192.168.110.64:9000" |
| | | //let All_Url = "https://mock.apipost.net/mock/31b303c60464000" |
| | | #else |
| | | let All_Url = "https://xq.xqzhihui.com/api" |
| | |
| | | extension Services{ |
| | | |
| | | /// 密码登录 |
| | | class func loginBy(phone:String,content:String,type:LoginType)->Observable<BaseResponse<LoginUserInfoModel>>{ |
| | | class func loginBy(phone:String,content:String,type:LoginType,device:String)->Observable<BaseResponse<LoginUserInfoModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | |
| | | switch type { |
| | |
| | | params.interface(url: "/auth/app/login") |
| | | .append(key: "cellPhone", value: phone) |
| | | .append(key: "password", value: content.jq_md5String()) |
| | | .append(key: "device",value:device) |
| | | .append(key: "apipost_id", value: "246d780670e267") |
| | | case .code: |
| | | params.interface(url: "/auth/app/captchaLogin") |
| | | .append(key: "cellPhone", value: phone) |
| | | .append(key: "captcha",value:content) |
| | | .append(key: "device",value:device) |
| | | .append(key: "apipost_id", value: "246d780670e265") |
| | | } |
| | | return NetworkRequest.request(params: params, method: .post,encoding: JSONEncoding(), progress: true) |
| | | } |
| | | |
| | | |
| | | class func loginByApple(appleId:String)->Observable<BaseResponse<LoginUserInfoModel>>{ |
| | | class func loginByApple(appleId:String,device:String)->Observable<BaseResponse<LoginUserInfoModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | params.interface(url: "/auth/app/appleLogin") |
| | | .append(key: "appleId", value: appleId) |
| | | .append(key: "device", value: device) |
| | | .append(key: "apipost_id", value: "246d780670e264") |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | class func loginByWechat(headImgUrl:String,nickname:String,sex:Int,wxOpenId:String)->Observable<BaseResponse<LoginUserInfoModel>>{ |
| | | class func loginByWechat(headImgUrl:String,nickname:String,sex:Int,wxOpenId:String,device:String)->Observable<BaseResponse<LoginUserInfoModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | params.interface(url: "/auth/app/wxLogin") |
| | | .append(key: "headImgUrl", value: headImgUrl) |
| | | .append(key: "nickname", value: nickname) |
| | | .append(key: "sex", value: sex) |
| | | .append(key: "wxOpenId", value: wxOpenId) |
| | | .append(key: "device", value: device) |
| | | .append(key: "apipost_id", value: "246d7806b0e26c") |
| | | return NetworkRequest.request(params: params, method: .post,encoding: JSONEncoding(), progress: true) |
| | | } |