更改请求地址

main
Clarence 2025-02-04 00:22:26 +08:00
parent d3a375a9d5
commit 5e2eb0b451
3 changed files with 12 additions and 11 deletions

View File

@ -23,7 +23,8 @@ const handleCode = async (code: number, msg: string) => {
//创建axsio 赋给常量service
const service = axios.create({
baseURL: "/api",
baseURL: "https://sh-ocr-api.bskies.cc/",
// baseURL: "/api",
timeout: 30000,
headers: {
'Content-Type': 'application/json;charset=UTF-8',

View File

@ -64,7 +64,7 @@ const submitForm = async (formEl) => {
ElMessage.success("登录成功")
setTimeout(()=>{
router.push("/");
},200)
},400)
}
} else {

View File

@ -15,13 +15,13 @@ export default defineConfig({
'@': fileURLToPath(new URL('./src', import.meta.url))
},
},
server: {
proxy: {
'/api': {
target: 'https://sh-ocr-api.bskies.cc/',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '')
}
}
}
// server: {
// proxy: {
// '/api': {
// target: 'https://sh-ocr-api.bskies.cc/',
// changeOrigin: true,
// rewrite: (path) => path.replace(/^\/api/, '')
// }
// }
// }
})