Commit d3d9ce92 by zhanghou

提交剩余参数的处理

parent 056521d9
......@@ -25,5 +25,9 @@ public class LoginConstants {
public static final String __terminalType= "__terminalType";
public static final String algorithm= "algorithm";
public static final String CERT= "CERT";
}
......@@ -14,6 +14,16 @@ public class LoginData {
return MdaEnv.getAuthInfo().getErrorText();
else if(LoginConstants.ncid.equals(param))
return MdaEnv.getAuthInfo().getPtyInr();
else if(LoginConstants.CN.equals(param))
return MdaEnv.getAuthInfo().getCn();
else if(LoginConstants.__terminalType.equals(param))
return MdaEnv.getAuthInfo().getTerminalType();
else if(LoginConstants.algorithm.equals(param))
return MdaEnv.getAuthInfo().getAlgorithm();
else if(LoginConstants.CERT.equals(param))
return MdaEnv.getAuthInfo().getCert();
else if(LoginConstants.needSign.equals(param))
return MdaEnv.getAuthInfo().getNeedSign();
return null;
}
}
......@@ -50,7 +50,7 @@ public class AuthInterceptor implements HandlerInterceptor {
if (authInfo == null) {
String cid=headMap.get(LoginConstants.cid).toString();
String ncid=headMap.get(LoginConstants.ncid).toString();
BDAuthInfo tdAuthInfo = new BDAuthInfo(cid,ncid,"");
BDAuthInfo tdAuthInfo = new BDAuthInfo(cid,ncid,"",null,null,null,null,null);
authInfo = tdAuthInfo;
authInfoICache.store(tokenKey, authInfo);
//构造authInfo,本该在登录里面做
......
......@@ -65,6 +65,11 @@ public class AuthorizationRequestFilter implements ContainerRequestFilter {
String userId=usrList.get(0).getInr();
//网银编号
String ncid = request.getHeaderString(LoginConstants.ncid);
String CN = request.getHeaderString(LoginConstants.CN);
String needSign = request.getHeaderString(LoginConstants.needSign);
String __terminalType = request.getHeaderString(LoginConstants.__terminalType);
String algorithm = request.getHeaderString(LoginConstants.algorithm);
String CERT = request.getHeaderString(LoginConstants.CERT);
//errorText
String errorText=request.getHeaderString(LoginConstants.errorText);
......@@ -72,6 +77,11 @@ public class AuthorizationRequestFilter implements ContainerRequestFilter {
headMap.put(LoginConstants.usrinr,userId);
headMap.put(LoginConstants.ncid,ncid);
headMap.put(LoginConstants.errorText,errorText);
headMap.put(LoginConstants.CN,CN);
headMap.put(LoginConstants.needSign,needSign);
headMap.put(LoginConstants.__terminalType,__terminalType);
headMap.put(LoginConstants.algorithm,algorithm);
headMap.put(LoginConstants.CERT,CERT);
String token = getTokenKey(request);
//目前采用自动登录模式认证
......@@ -98,10 +108,15 @@ public class AuthorizationRequestFilter implements ContainerRequestFilter {
synchronized (authInfoICache) {
authInfo = authInfoICache.get(tokenKey);
if (authInfo == null) {
String usrinr=headMap.get(LoginConstants.usrinr).toString();
String ptyinr=headMap.get(LoginConstants.ncid).toString();
String usrinr=headMap.get(LoginConstants.usrinr)==null?"":headMap.get(LoginConstants.usrinr).toString();
String ptyinr=headMap.get(LoginConstants.ptyinr)==null?"":headMap.get(LoginConstants.ncid).toString();
String errorText=headMap.get(LoginConstants.errorText)==null?"":headMap.get(LoginConstants.errorText).toString();
BDAuthInfo tdAuthInfo = new BDAuthInfo(usrinr,ptyinr,errorText);
String CN=headMap.get(LoginConstants.CN)==null?"":headMap.get(LoginConstants.CN).toString();
String needSign=headMap.get(LoginConstants.needSign)==null?"":headMap.get(LoginConstants.needSign).toString();
String __terminalType=headMap.get(LoginConstants.__terminalType)==null?"":headMap.get(LoginConstants.__terminalType).toString();
String algorithm=headMap.get(LoginConstants.algorithm)==null?"":headMap.get(LoginConstants.algorithm).toString();
String CERT=headMap.get(LoginConstants.CERT)==null?"":headMap.get(LoginConstants.CERT).toString();
BDAuthInfo tdAuthInfo = new BDAuthInfo(usrinr,ptyinr,errorText,__terminalType,needSign,CN,algorithm,CERT);
authInfo = tdAuthInfo;
authInfoICache.store(tokenKey, authInfo);
//构造authInfo,本该在登录里面做
......
......@@ -7,6 +7,16 @@ public interface IAuthInfo {
//获取当前用户的机构ID
String getPtyInr();
String getTerminalType();
String getNeedSign();
String getCn();
String getAlgorithm();
String getCert();
//获取errorText
String getErrorText();
......
......@@ -4,22 +4,33 @@ import com.brilliance.mda.runtime.mda.IAuthInfo;
import com.brilliance.mda.runtime.mda.IStream;
import com.brilliance.mda.runtime.mda.impl.StreamImpl;
import java.security.cert.X509Certificate;
import java.util.List;
public class BDAuthInfo implements IAuthInfo {
private String usrInr;
private String ptyInr;
private String errorText;
private String terminalType;
private String needSign;
private String cn;
private String algorithm;
private String cert;
private IStream sysStream;
private IStream ddsStream;
private IStream keepAuthInfo;
public BDAuthInfo(){}
public BDAuthInfo(String usrInr, String ptyInr,String errorText) {
public BDAuthInfo(String usrInr, String ptyInr,String errorText,String terminalType,String needSign,String cn,String algorithm,String cert) {
this.usrInr = usrInr;
this.ptyInr=ptyInr;
this.errorText=errorText;
this.terminalType = terminalType;
this.needSign = needSign;
this.cn = cn;
this.algorithm = algorithm;
this.cert = cert;
sysStream = new StreamImpl();
ddsStream = new StreamImpl();
keepAuthInfo = new StreamImpl();
......@@ -36,6 +47,31 @@ public class BDAuthInfo implements IAuthInfo {
}
@Override
public String getTerminalType() {
return terminalType;
}
@Override
public String getNeedSign() {
return needSign;
}
@Override
public String getCn() {
return cn;
}
@Override
public String getAlgorithm() {
return algorithm;
}
@Override
public String getCert() {
return cert;
}
@Override
public String getErrorText() {
return null;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment