物料PLM附件下载-token请求增加passwd字段
This commit is contained in:
parent
5f7e450cc1
commit
10c7f008fb
|
|
@ -44,6 +44,7 @@ public class MaterialPlmDownloadAction implements ICommonAction {
|
||||||
private String plmBaseUrl = "";
|
private String plmBaseUrl = "";
|
||||||
private String plmUser = "";
|
private String plmUser = "";
|
||||||
private String token = "";
|
private String token = "";
|
||||||
|
private String passwd = "";
|
||||||
private static final String tokenUrl = "/sipmweb/api/oauth";
|
private static final String tokenUrl = "/sipmweb/api/oauth";
|
||||||
// 根据物料编码获取零部件ID
|
// 根据物料编码获取零部件ID
|
||||||
private String materialIdUrl = "/sipmweb/api/{rid}/search/{t}";
|
private String materialIdUrl = "/sipmweb/api/{rid}/search/{t}";
|
||||||
|
|
@ -94,6 +95,7 @@ public class MaterialPlmDownloadAction implements ICommonAction {
|
||||||
}
|
}
|
||||||
plmBaseUrl = configParams.get("plmBaseUrl");
|
plmBaseUrl = configParams.get("plmBaseUrl");
|
||||||
plmUser = configParams.get("plmUser");
|
plmUser = configParams.get("plmUser");
|
||||||
|
passwd = configParams.getOrDefault("passwd", "");
|
||||||
token = getToken();
|
token = getToken();
|
||||||
|
|
||||||
// 无论单个还是多个物料,均打包为ZIP(原单个物料返回单文件,无法同时返回两类文件)
|
// 无论单个还是多个物料,均打包为ZIP(原单个物料返回单文件,无法同时返回两类文件)
|
||||||
|
|
@ -198,6 +200,9 @@ public class MaterialPlmDownloadAction implements ICommonAction {
|
||||||
private String getToken() throws IOException, BusinessException {
|
private String getToken() throws IOException, BusinessException {
|
||||||
Map<String, String> tokenMap = new HashMap<>();
|
Map<String, String> tokenMap = new HashMap<>();
|
||||||
tokenMap.put("uname", plmUser);
|
tokenMap.put("uname", plmUser);
|
||||||
|
if (!"passwd".equals(passwd) && !"null".equals(passwd) && !"~".equals(passwd)) {
|
||||||
|
tokenMap.put("passwd", passwd);
|
||||||
|
}
|
||||||
tokenMap.put("f", "true");
|
tokenMap.put("f", "true");
|
||||||
String tokenStr = doGet(plmBaseUrl + tokenUrl, tokenMap);
|
String tokenStr = doGet(plmBaseUrl + tokenUrl, tokenMap);
|
||||||
JSONObject jsonObject = JSONObject.parseObject(tokenStr);
|
JSONObject jsonObject = JSONObject.parseObject(tokenStr);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue