1、IOS登录接口涉及的三个接口:
2、三个接口传入的参,第三个是判断用户是否登录成功的
http://118.178.247.67:8449/service/userLogin/phoneQuickLogin
请求参数: { "machineModel" : "iPhone8,2", "imei" : "F40246DC-8086-427B-821F-08EAEF0D69A5", "platform" : "IOS", "version" : "", "token" : "4301cc19-d43f-4bae-a3ed-ad200f26b84b-412824787", "body" : { "phoneNum" : "18200717410" }, "appSource" : "appStore" } 返回参数: { "success": true, "token": "4301cc19-d43f-4bae-a3ed-ad200f26b84b-412824787", "failCode": 0, "msg": "操作成功", "body": { "isRegister": "1" } }
http://118.178.247.67:8449/service/userLogin/loginByPhone
请求参数: { "machineModel" : "iPhone8,2", "imei" : "F40246DC-8086-427B-821F-08EAEF0D69A5", "platform" : "IOS", "version" : "", "token" : "4301cc19-d43f-4bae-a3ed-ad200f26b84b-412824787", "body" : { "passWord" : "123456Aa", "loginString" : "18200717410", "pushClientid" : "0150f4a9a4da334a027c14785a55312a" }, "appSource" : "appStore" } 返回参数: { "success": true, "token": "4301cc19-d43f-4bae-a3ed-ad200f26b84b-412824787", "failCode": 0, "msg": "操作成功", "body": { "id": "11856997368431616", "accountId": null, "payPass": null, "userName": "首金会员_717410", "pwd": "c55a6593372646037588b48838f319b49948e06455e4bf3f", "userType": "0", "phoneTel": "18200717410", "phoneState": null, "custFullName": null, "custCode": "P002033101005113", "fundAcc": "9595100109802003", "picUtl": null, "raleName": "王虹影", "identityNo": "630000198404279700", "sex": 1, "inviteCode": "QXF563", "inviteStr": "首金网,一个脚踏实地的互联网金融平台,同类出借产品收益先锋。2016年,首金网诚愿接管您的出借计划,新人注册返利活动开启,注册即享百元红包。", "isTrusteeship": 1, "errorCode": null } }
http://118.178.247.67:8449/service/switch/status
传入的参数: { "machineModel" : "iPhone8,2", "imei" : "F40246DC-8086-427B-821F-08EAEF0D69A5", "platform" : "IOS", "version" : "", "token" : "4301cc19-d43f-4bae-a3ed-ad200f26b84b-412824787", "body" : { "id" : "3" }, "appSource" : "appStore" } 返回参数: { "success": true, "token": "4301cc19-d43f-4bae-a3ed-ad200f26b84b-412824787", "failCode": 0, "msg": "操作成功", "body": { "data": [{ "descrip": "福利开关", "isinuse": "0" }] } }
3、遇到的问题
在接口调用中一直是登录状态为未登录
观察三个接口可以发现imei、token三个接口是一致的,因此需要从第一个接口中取出imei和token参数到第二、三个接口中
取值为
容易出错的是写成:JSON["token1"]
要记得借助Debug Sampler查看取值是否正确