质量接口测试v2

master
yinq 2 years ago
parent de5beb2b10
commit 6157d9c8ce

@ -167,20 +167,24 @@ public class TemporaryFixController {
* @return * @return
*/ */
@PostMapping("/getURL") @PostMapping("/getURL")
@ResponseBody public R getURL(@RequestBody Map paramMap) {
public R getURL(Map paramMap) {
// paramMap.put("materialCode","A10000");
String respBody = null; String respBody = null;
try { try {
String requestUrl = yunBpmConfig.getApiBaseUrl() + "/api/login/Authentication/get_code"; if (paramMap.containsKey("url")){
Map<String, Object> params = new HashMap<>(); String params = JSONUtil.toJsonStr(paramMap);
params.put("username", yunBpmConfig.userName); respBody = HttpUtil.post(String.valueOf(paramMap.get("url")), params, 1000 * 10);
params.put("password", yunBpmConfig.passWord); respBody = respBody.concat("[测试]");
params.put("url", yunBpmConfig.getApiBaseUrl() + "/api/login?redirect_uri=" }else {
+ yunBpmConfig.getApiBaseUrl() + String requestUrl = yunBpmConfig.getApiBaseUrl() + "/api/login/Authentication/get_code";
"/api/oauth/authorize?client_id=api&response_type=code&scope=read&redirect_uri=" Map<String, Object> params = new HashMap<>();
+ yunBpmConfig.getApiBaseUrl() + "/oauth"); params.put("username", yunBpmConfig.userName);
respBody = HttpUtil.post(requestUrl, JSONUtil.toJsonStr(params),1000 * 10); params.put("password", yunBpmConfig.passWord);
params.put("url", yunBpmConfig.getApiBaseUrl() + "/api/login?redirect_uri="
+ yunBpmConfig.getApiBaseUrl() +
"/api/oauth/authorize?client_id=api&response_type=code&scope=read&redirect_uri="
+ yunBpmConfig.getApiBaseUrl() + "/oauth");
respBody = HttpUtil.post(requestUrl, JSONUtil.toJsonStr(params),1000 * 10);
}
} catch (Exception e) { } catch (Exception e) {
return R.failed(e.toString()); return R.failed(e.toString());
} }

Loading…
Cancel
Save