更改请求地址

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 //创建axsio 赋给常量service
const service = axios.create({ const service = axios.create({
baseURL: "/api", baseURL: "https://sh-ocr-api.bskies.cc/",
// baseURL: "/api",
timeout: 30000, timeout: 30000,
headers: { headers: {
'Content-Type': 'application/json;charset=UTF-8', 'Content-Type': 'application/json;charset=UTF-8',

View File

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

View File

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