跨域问题

用ip可以正常访问,用域名无法访问

Access to XMLHttpRequest at 'http://ip:8019/login/proPageVar' from origin 'http://域名:8019' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

评论区

杜福忠

2020-09-21 09:35

搜索一下就看见很多配置方法了
https://www.baidu.com/s?ie=utf-8&wd=site:jfinal.com%20%E8%B7%A8%E5%9F%9F

小不点JSW

2020-09-21 09:40

谢谢

海哥

2020-09-21 18:13

@小不点JSW 看这个 https://gitee.com/jfinal/jfinal/blob/master/src/main/java/com/jfinal/ext/cors/CORSInterceptor.java

天朝子民

2020-09-22 19:50

jfinal 4.9,14:添加 CORSInterceptor、EnableCORS,支持跨域资源共享(jpress、jboot 作者 @海哥 贡献)