1
0
mirror of https://github.com/zclzone/vue-naive-admin.git synced 2025-05-01 14:49:00 +08:00

Compare commits

...

5 Commits

Author SHA1 Message Date
zclzone
5766510ad9 feat: 补充production环境变量 2024-05-29 21:54:41 +08:00
zclzone
905476abf7 feat: 本地环境改用直调apifox云端mock接口 2024-05-29 21:48:05 +08:00
zclzone
160910bb85 style: 删除无用代码 2024-05-29 18:22:56 +08:00
zclzone
d3d002770b Merge branch '2.x' of https://gitee.com/isme-admin/vue-naive-admin into 2.x 2024-05-29 16:50:43 +08:00
zclzone
98f3648f9f docs: 注释 2024-05-29 16:50:29 +08:00
6 changed files with 13 additions and 9 deletions

View File

@ -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'

View File

@ -4,5 +4,7 @@ VITE_USE_HASH = 'false'
# 资源公共路径,需要以 /开头和结尾 # 资源公共路径,需要以 /开头和结尾
VITE_PUBLIC_PATH = '/' VITE_PUBLIC_PATH = '/'
VITE_AXIOS_BASE_URL = '/api' # 用于代理
# 代理配置-target # 代理配置-target
VITE_PROXY_TARGET = 'http://localhost:8085' VITE_PROXY_TARGET = 'http://localhost:8085'

View File

@ -51,7 +51,7 @@ const props = defineProps({
default: true, default: true,
}, },
/** /**
* @remote 是否分页 * @isPagination 是否分页
*/ */
isPagination: { isPagination: {
type: Boolean, type: Boolean,

View File

@ -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({

View File

@ -118,7 +118,7 @@ const loginInfo = ref({
const captchaUrl = ref('') const captchaUrl = ref('')
const initCaptcha = throttle(() => { const initCaptcha = throttle(() => {
captchaUrl.value = '/api/auth/captcha?' + Date.now() captchaUrl.value = import.meta.env.VITE_AXIOS_BASE_URL + '/auth/captcha?' + Date.now()
}, 500) }, 500)
const localLoginInfo = lStorage.get('loginInfo') const localLoginInfo = lStorage.get('loginInfo')

View File

@ -17,10 +17,9 @@ import { NaiveUiResolver } from 'unplugin-vue-components/resolvers'
import removeNoMatch from 'vite-plugin-router-warn' import removeNoMatch from 'vite-plugin-router-warn'
import { pluginPagePathes, pluginIcons } from './build/plugin-isme' import { pluginPagePathes, pluginIcons } from './build/plugin-isme'
export default defineConfig(({ command, mode }) => { export default defineConfig(({ mode }) => {
const isBuild = command === 'build'
const viteEnv = loadEnv(mode, process.cwd()) 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 { return {
base: VITE_PUBLIC_PATH || '/', base: VITE_PUBLIC_PATH || '/',