首先新建一个项目:

安装vue-cli:

npm i -g @vue/cli
npm i -g @vue/cli-init

安装webpack:

npm install webpack -g

vue新建项目:

vue init webpack

 

 

 

http://localhost:8081

 这里需要注意:

vue的访问路径为http://localhost:8081

要访问的接口路径是

http://localhost:8080/user/login

这里端口跨域

于是配置将所有的访问路径为

http://localhost:8081/

开头的访问转接到

http://localhost:8080/

 

 

-------------------------------------------------------------------------------react分割线-----------------------------------------------------------------------------------------------------------

创建项目:

npx create-react-app my-apps

删除无用的项之后:

初始化并创建git

git init
git add .
git stash

暴露webpack配置:(react)

npm run eject

项目下多了一些文件夹、文件:

 

 找到这个文件:

 

在第103行:

 

 修改后:

 

 posted on 2023-02-03 17:08  laremehpe  阅读(138)  评论(0编辑  收藏  举报