Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

前台可以访问,后台访问不了 #108

Open
ZhengPP1 opened this issue Apr 10, 2023 · 3 comments
Open

前台可以访问,后台访问不了 #108

ZhengPP1 opened this issue Apr 10, 2023 · 3 comments

Comments

@ZhengPP1
Copy link

`server {
listen 80;
server_name 119.91.51.77;

    location / {
        # 指向前台1的静态文件目录
        root /home/zpp/nblog/blog-view/dist;

        # 允许前台跨域请求后台
        add_header 'Access-Control-Allow-Origin' '*';

        # 所有非文件请求都重定向到前台1的index.html文件
        try_files $uri $uri/ /index.html;
    }

    location /admin/ {
        # 指向前台2的静态文件目录
        root /home/zpp/nblog/blog-cms/dist;

        # 允许前台跨域请求后台
        add_header 'Access-Control-Allow-Origin' '*';

        # 所有非文件请求都重定向到前台2的index.html文件
        try_files $uri $uri/ /index.html;
    }

    location /api/ {
        # 指向后台的API地址
        proxy_pass http://localhost:8090/;
    }
}`这是我的nginx配置,请问为什么访问http://119.91.51.77/admin/会underfined呢
@WildBoyHJ
Copy link

老哥,解决了吗,我这边也跟你一样的问题

@Luomore
Copy link

Luomore commented May 12, 2023

同样的问题,后台登录不了,【Request failed with status code 500】
我这个问题好像是因为java版本太高,换成java8后就可以了

@muiyu
Copy link

muiyu commented Apr 3, 2024

同样的问题,后台登录不了,【Request failed with status code 500】 我这个问题好像是因为java版本太高,换成java8后就可以了

我使用的Java11,这个报错我是通过添加依赖包解决的。我的后台也是提示这个,查看后端的报错发现错误是java.lang.ClassNotFoundException: javax.xml.bind.DatatypeConverter,因为JWT库在生成token时使用了DatatypeConverter进行Base64编码和解码操作,但由于该类无法加载,导致了这个异常。

我查资料发现大概这是Java 9及更高版本中的一个已知问题,因为一些模块化的更改导致某些原有的Java EE模块被移出了类路径。

我通过在pom.xml中引入javax.xml.bind依赖后成功登录后台。

<dependency>
    <groupId>javax.xml.bind</groupId>
    <artifactId>jaxb-api</artifactId>
    <version>2.3.1</version>
</dependency>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants