mirror of
https://github.com/zclzone/vue-naive-admin.git
synced 2025-04-30 22:29:01 +08:00
feat: 本地环境改用直调apifox云端mock接口
This commit is contained in:
parent
160910bb85
commit
905476abf7
@ -4,6 +4,9 @@ VITE_USE_HASH = 'true'
|
|||||||
# 资源公共路径,需要以 /开头和结尾
|
# 资源公共路径,需要以 /开头和结尾
|
||||||
VITE_PUBLIC_PATH = '/'
|
VITE_PUBLIC_PATH = '/'
|
||||||
|
|
||||||
# 代理配置-target 本地服务 | Apifox云端mock
|
# Axios 基础路径
|
||||||
# VITE_PROXY_TARGET = 'http://localhost:8085'
|
# VITE_AXIOS_BASE_URL = '/api' # 用于代理
|
||||||
VITE_PROXY_TARGET = 'https://mock.apifox.com/m1/3776410-0-default/'
|
VITE_AXIOS_BASE_URL = 'https://mock.apifox.com/m1/3776410-0-default' # apifox云端mock
|
||||||
|
|
||||||
|
# 代理配置-target
|
||||||
|
VITE_PROXY_TARGET = 'http://localhost:8085'
|
||||||
|
@ -12,7 +12,7 @@ import { setupInterceptors } from './interceptors'
|
|||||||
|
|
||||||
export function createAxios(options = {}) {
|
export function createAxios(options = {}) {
|
||||||
const defaultOptions = {
|
const defaultOptions = {
|
||||||
baseURL: '/api',
|
baseURL: import.meta.env.VITE_AXIOS_BASE_URL,
|
||||||
timeout: 12000,
|
timeout: 12000,
|
||||||
}
|
}
|
||||||
const service = axios.create({
|
const service = axios.create({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user