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

大佬们,跨域请求403报错,后端已经允许跨域了 #4201

Open
bobian29c6e opened this issue Oct 5, 2023 · 6 comments
Open

大佬们,跨域请求403报错,后端已经允许跨域了 #4201

bobian29c6e opened this issue Oct 5, 2023 · 6 comments

Comments

@bobian29c6e
Copy link

bobian29c6e commented Oct 5, 2023

555真的没辙了哎
Uploading 截屏2023-10-05 16.55.06.png…

@bobian29c6e
Copy link
Author

截屏2023-10-05 16 55 32

@bobian29c6e
Copy link
Author

截屏2023-10-05 16 55 54 截屏2023-10-05 16 56 05

@EITSxiaozhai
Copy link

export function adminlist(data) {
  return request({
    url: '/user/adminlist',
    method: 'post',
    data
  })
}

不需要写死地址。可以利用不同的启动命令去启动不同环境。

# just a flag
ENV = 'development'

# base api
VUE_APP_BASE_API = 'http://127.0.0.1:8000/api/'

挂到生产环境上去后。在去用nginx反向代理。可以解决跨域问题。

@liyang-it
Copy link

你的Java跨域不正确,如果有使用第三方鉴权框架例如 Shiro或者Sa-token等需要额外配置 对应的跨域配置

@Zhuaay
Copy link

Zhuaay commented Dec 21, 2023

前端使用代理试试

@songwe2017
Copy link

后端是不是用Spring Security了?用了拦截器这样配置是不生效的

@bobian29c6e bobian29c6e changed the title 大佬们,萌新求助,跨域请求403报错,后端已经允许跨域了哎 大佬们,跨域请求403报错,后端已经允许跨域了 Jan 15, 2024
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

5 participants