登录失败,token为空--已解决
本帖最后由 lycplayer 于 2019-10-10 15:06 编辑部署上线后,浏览器看到登录页,输入帐号密码,页面提示token无效。奇怪的是log里只看到这点信息
2019-10-10 11:59:37.500 INFOorg.jeecg.modules.shiro.authc.ShiroRealm:90 - ————————身份认证失败——————————IP地址:183.220.113.170
2019-10-10 11:59:37.502 ERROR o.s.boot.web.servlet.support.ErrorPageFilter:190 - Forwarding to error page from request due to exception
javax.servlet.ServletException: org.apache.shiro.authc.AuthenticationException: Token失效,请重新登录
前端配置也是外网可访问的IP地址
window._CONFIG = {};
window._CONFIG['domianURL'] = 'http://外网ip:8060/jeecg-boot/jeecg-boot-module-system-2.1.0';
window._CONFIG['casPrefixUrl'] = 'http://cas.example.org:8443/cas';
window._CONFIG['imgDomainURL'] = window._CONFIG['domianURL'] + '/sys/common/view';
window._CONFIG['pdfDomainURL'] =window._CONFIG['domianURL'] + '/sys/common/pdf/pdfPreviewIframe'; 看代码,是这里
protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken auth) throws AuthenticationException {
String token = (String) auth.getCredentials();
if (token == null) {
log.info("————————身份认证失败——————————IP地址:"+ oConvertUtils.getIpAddrByRequest(SpringContextUtils.getHttpServletRequest()));
throw new AuthenticationException("token为空!");
} server {
listen 80;
server_name域名;
#后台服务配置,配置了这个location便可以通过http://域名/jeecg-boot/xxxx 访问
location ^~ /jeecg-boot {
proxy_pass http://127.0.0.1:8060/jeecg-boot/jeecg-boot-module-system-2.1.0;
proxy_set_header Host 127.0.0.1;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
#解决Router(mode: 'history')模式下,刷新路由地址不能找到页面的问题
location / {
root html;
indexindex.html index.htm;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.html?s=$1 last;
break;
}
}
}
搞定了!proxy_pass http://127.0.0.1:8060/jeecg-boot/
页:
[1]