我写的过滤器如下 如果页面传参带附件上传形式的 在POSTMAN 测试只有用form-data 然而 就获取不到ID Token
如何解决好呢?
package nuoshang.bluejay.common.filter;
import nuoshang.bluejay.common.base.BaseModule;
import nuoshang.bluejay.common.base.ResultApp;
import nuoshang.bluejay.modules.back.sys.services.ApiService;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.nutz.integration.shiro.SimpleShiroToken;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.log.Log;
import org.nutz.log.Logs;
import org.nutz.mvc.ActionContext;
import org.nutz.mvc.ActionFilter;
import org.nutz.mvc.View;
import org.nutz.mvc.impl.processor.AbstractProcessor;
import javax.servlet.http.HttpServletRequest;
/**
* Created by yuhaiming on 2016/10/12 0012.
*/
public class AccessTokenFilter implements ActionFilter {
private static final Log log = Logs.get();
protected ApiService apiService;
public View match(ActionContext ac) {
if (apiService == null)
apiService = ac.getIoc().get(ApiService.class);
HttpServletRequest req = ac.getRequest();
String id = req.getParameter("id");
String token = req.getParameter("token");
if (!apiService.verifyToken(id,token)) {
return BaseModule.HTTP_403;
}
SecurityUtils.getSubject().getSession().setAttribute("me", id);
log.debug("api access token check ok");
return null;
}
}