Giter Club home page Giter Club logo

Comments (3)

MYvLiang avatar MYvLiang commented on July 4, 2024

暂时没有打算做后台管理页面哈。跨域问题我没有使用@crossorigin注解,我在WebMvcConfig类配置的,实现了WebMvcConfigurer接口,重写了public void addCorsMappings(CorsRegistry registry) 方法,核心在于.allowedOrigins("http://localhost:8081") ,可以看看我的写法。前端axios也有一些封装配置。还有一点,有一个版本我将所有url“http://localhost:8080”改成了我部署的域名,不过最新的版本已经改回来了,如果你看的是旧版,可用idea的全局替换功能,替换所有的https://shinytengxvnyun.cn为http://localhost:8080。

from second-hand-trading.

MYvLiang avatar MYvLiang commented on July 4, 2024

如果addCorsMappings方法中配置的域名和端口与前端运行的域名和端口一样,还是有跨域报错的话,可以试试用vue cli的代理转发请求。我的朋友做前后端分离的项目时使用我的配置方式依然报错,可能跟一些拦截器有关吧,我也不明白为什么,后来他只能使用代理转发请求暂时解决测试时的跨域问题。

from second-hand-trading.

Ethan1i avatar Ethan1i commented on July 4, 2024

from second-hand-trading.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.