推荐 最新
金刚老六

本地环境 Vue 项目地址提示 GET /*** 404 ?

1。这个是在本地环境遇到的!本地环境,Nginx 的配置我懂 2。参数修改 mode: hash -> history 3。localhost:8888 这个地址能看到登录页,localhost:8888/login,被识别为接口 404 4。localhost:8888/#/login 能看到登录页 5。vue-router: 3.1.6 有大佬知道怎么回事吗? 我记得 Vue 的 hash 和 history 模式的转换只需要修改一下 mode webpack 之类的不需要修改的,AI 的回复也是类似

0
1
0
浏览量146
WhatUpDanger

Node项目服务器与本地Vue项目接口联调失败的解决方法?

node项目已经运行到了服务器上面了,且浏览器可以通过公网ip访问,但是在本地vue项目中通过接口不能实现联调, devServer: { proxy: { // 配置多个代理 "/adminapi": { target: "http://xxx.xx.xxx.xxx:3000", changeOrigin: true, }, }, }, 本地vue项目使用的是代理的方式解决跨域问题的 axios.post("/adminapi/user/login", loginParam).then((res) => { console.log(res.data); if (res.data.code === "200") { ElMessage({ message: res.data.message, type: "success", }); store.commit("changeUserInfo", res.data.data); store.commit("changeGetterRouter", false); // 跳转到首页 router.push({ path: "/index", }); } else { ElMessage.error(res.data.message); } }); 本地运行的vue项目可以实现接口联调

0
1
0
浏览量120