接口测试之tonken
网站:http://shop.duoceshi.com/login?redirect=2Fdashboard
第一个接口:uiid接口
uiid接口url:http://manage.duoceshi.com/auth/code
test中语句:
var jsonData = JSON.parse(responseBody);
postman.setEnvironmentVariable("uuid",jsonData.uuid);
第二个接口:登录接口
验证码:8888
url:http://manage.duoceshi.com/auth/login
入参参数:
code: "8888"
password: "rXYlQ6P5eVLgMiru5jevb+3zwTCJG+HpFwCBvSwCXhwLhxIkvIiN+nmh89G88Dwk7jWnesFKTHFN1i9a3MkfQQ=="
username: "admin"
uuid: "code-key7b6f81e6d5c54a07a0455cc80b9b072f" #
在postman中设置:
得到tonken:
"token":"Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTcxMjYyNzY4N30.IwrgFiCNIpI1979UmEmZno-hUDzDqPje2WomnNLcC5hFS4fahLUVOYAcWed4XzqDQpvk-7zdNBDpnR3Z-00IZg"
鉴权:
提取:token
第三个接口:查询接口接口
get 请求
http://manage.duoceshi.com/api/yxUser?page=0\&size=10\&sort=uid%2Cdesc\&userType=
Authorization :{{token}}