1. 403是被服务器拒绝了,一般是spring security造成的,springsecurity会开启跨域认证,所以不关闭这个的话会访问api会出现403错误

 

2.解决

@Override
    protected void configure(HttpSecurity http) throws Exception {
        http
            
            .and()
            .csrf()
            .disable()
....

在spring security 的控制类中加入以下代码即可,关闭跨域认证.

相关文章: