if(event.getVerifyAction()==ImageVerifyEvent.SSI_VERIFY) {
this.loginWork.setVerifyImage(event.getVerifyImage());
}else if(event.getVerifyAction()==ImageVerifyEvent.SIPC_VERIFY) {
SipcRequest request = event.getTargetRequest();
VerifyImage image = event.getVerifyImage();
//移除之前的A字段
Iterator<SipcHeader> it = request.getHeaders().iterator();
while(it.hasNext()) {
SipcHeader h = it.next();
if(h.getName().equals(SipcHeader.AUTHORIZATION) && h.getValue().indexOf("Verify response=")!=-1) {
it.remove();
}
}
request.addHeader(SipcHeader.AUTHORIZATION, "Verify response=\""+image.getVerifyCode()+"\",algorithm=\""+image.getAlgorithm()+"\"," +
"type=\""+image.getVerifyType()+"\",chid=\""+image.getImageId()+"\"");
request.resetReplyTimes();
event.getTargetDialog().process(request);
}else {
throw new IllegalArgumentException("Invalid verify action:"+event.getVerifyAction());
}