mirror of
https://github.com/zclzone/vue-naive-admin.git
synced 2025-05-01 14:49:00 +08:00
Compare commits
5 Commits
6cdf905cd4
...
5766510ad9
Author | SHA1 | Date | |
---|---|---|---|
|
5766510ad9 | ||
|
905476abf7 | ||
|
160910bb85 | ||
|
d3d002770b | ||
|
98f3648f9f |
@ -4,6 +4,9 @@ VITE_USE_HASH = 'true'
|
||||
# 资源公共路径,需要以 /开头和结尾
|
||||
VITE_PUBLIC_PATH = '/'
|
||||
|
||||
# 代理配置-target 本地服务 | Apifox云端mock
|
||||
# VITE_PROXY_TARGET = 'http://localhost:8085'
|
||||
VITE_PROXY_TARGET = 'https://mock.apifox.com/m1/3776410-0-default/'
|
||||
# Axios 基础路径
|
||||
# VITE_AXIOS_BASE_URL = '/api' # 用于代理
|
||||
VITE_AXIOS_BASE_URL = 'https://mock.apifox.com/m1/3776410-0-default' # apifox云端mock
|
||||
|
||||
# 代理配置-target
|
||||
VITE_PROXY_TARGET = 'http://localhost:8085'
|
||||
|
@ -4,5 +4,7 @@ VITE_USE_HASH = 'false'
|
||||
# 资源公共路径,需要以 /开头和结尾
|
||||
VITE_PUBLIC_PATH = '/'
|
||||
|
||||
VITE_AXIOS_BASE_URL = '/api' # 用于代理
|
||||
|
||||
# 代理配置-target
|
||||
VITE_PROXY_TARGET = 'http://localhost:8085'
|
||||
|
@ -51,7 +51,7 @@ const props = defineProps({
|
||||
default: true,
|
||||
},
|
||||
/**
|
||||
* @remote 是否分页
|
||||
* @isPagination 是否分页
|
||||
*/
|
||||
isPagination: {
|
||||
type: Boolean,
|
||||
|
@ -12,7 +12,7 @@ import { setupInterceptors } from './interceptors'
|
||||
|
||||
export function createAxios(options = {}) {
|
||||
const defaultOptions = {
|
||||
baseURL: '/api',
|
||||
baseURL: import.meta.env.VITE_AXIOS_BASE_URL,
|
||||
timeout: 12000,
|
||||
}
|
||||
const service = axios.create({
|
||||
|
@ -118,7 +118,7 @@ const loginInfo = ref({
|
||||
|
||||
const captchaUrl = ref('')
|
||||
const initCaptcha = throttle(() => {
|
||||
captchaUrl.value = '/api/auth/captcha?' + Date.now()
|
||||
captchaUrl.value = import.meta.env.VITE_AXIOS_BASE_URL + '/auth/captcha?' + Date.now()
|
||||
}, 500)
|
||||
|
||||
const localLoginInfo = lStorage.get('loginInfo')
|
||||
|
@ -17,10 +17,9 @@ import { NaiveUiResolver } from 'unplugin-vue-components/resolvers'
|
||||
import removeNoMatch from 'vite-plugin-router-warn'
|
||||
import { pluginPagePathes, pluginIcons } from './build/plugin-isme'
|
||||
|
||||
export default defineConfig(({ command, mode }) => {
|
||||
const isBuild = command === 'build'
|
||||
export default defineConfig(({ mode }) => {
|
||||
const viteEnv = loadEnv(mode, process.cwd())
|
||||
const { VITE_TITLE, VITE_PUBLIC_PATH, VITE_PROXY_TARGET } = viteEnv
|
||||
const { VITE_PUBLIC_PATH, VITE_PROXY_TARGET } = viteEnv
|
||||
|
||||
return {
|
||||
base: VITE_PUBLIC_PATH || '/',
|
||||
|
Loading…
x
Reference in New Issue
Block a user