Browse Source

最终合并

milestone0718-2025周年庆后台
lihuilin 3 weeks ago
parent
commit
cac155edd6
  1. 9
      activitylink/.env.development
  2. 2
      activitylink/.env.production
  3. 9
      activitylink/.env.test
  4. 3
      activitylink/package.json
  5. 2
      activitylink/src/router/index.js
  6. 3
      activitylink/src/utils/request.js
  7. 5
      activitylink/vite.config.js

9
activitylink/.env.development

@ -0,0 +1,9 @@
VITE_ENV = 'test'
VITE_OUTPUT_DIR = 'dist'
VITE_PUBLIC_PATH = '/testBack/'
VITE_APP_BASE_API = https://dbqb.nfdxy.net/devLotApi/
# VITE_APP_BASE_API = http://192.168.40.12:12699/
VITE_USE_MOCK = true
# VITE_UPLOAD_URL='http://39.101.133.168:8828/hljw/api/aws/upload'
VITE_UPLOAD_URL='https://api.homilychart.com/hljw/api/aws/upload'

2
activitylink/.env.production

@ -1,6 +1,6 @@
VITE_ENV = 'production' VITE_ENV = 'production'
VITE_PUBLIC_PATH = '/prodBack/' VITE_PUBLIC_PATH = '/prodBack/'
VITE_USE_MOCK = true VITE_USE_MOCK = true
# VITE_APP_BASE_API = 'https://hwjb.homilychart.com/devLotApi/'
# VITE_APP_BASE_API = https://hwjb.homilychart.com/prodApi/
VITE_APP_BASE_API = 'http://localhost:12699/devLotApi' VITE_APP_BASE_API = 'http://localhost:12699/devLotApi'
# VITE_UPLOAD_URL='https://api.homilychart.com/hljw/api/aws/upload' # VITE_UPLOAD_URL='https://api.homilychart.com/hljw/api/aws/upload'

9
activitylink/.env.test

@ -0,0 +1,9 @@
VITE_ENV = 'test'
VITE_OUTPUT_DIR = 'dist'
VITE_PUBLIC_PATH = '/testBack/'
VITE_APP_BASE_API = https://dbqb.nfdxy.net/devLotApi/
# VITE_APP_BASE_API = http://localhost:12699/devLotApi/
VITE_USE_MOCK = true
# VITE_UPLOAD_URL='http://39.101.133.168:8828/hljw/api/aws/upload'
VITE_UPLOAD_URL='https://api.homilychart.com/hljw/api/aws/upload'

3
activitylink/package.json

@ -5,7 +5,8 @@
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite --host", "dev": "vite --host",
"build": "vite build",
"build:test": "vite build --mode test",
"build:prod": "vite build --mode prod",
"preview": "vite preview" "preview": "vite preview"
}, },
"dependencies": { "dependencies": {

2
activitylink/src/router/index.js

@ -73,7 +73,7 @@ const routes = [
] ]
// 创建路由实例 // 创建路由实例
const router = createRouter({ const router = createRouter({
history: createWebHistory('/testBack/'),
history: createWebHistory('/prodBack/'),
routes routes
}) })
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {

3
activitylink/src/utils/request.js

@ -7,10 +7,9 @@ import router from '@/router'
// 创建基础实例 // 创建基础实例
// const router = useRouter() // const router = useRouter()
const service = axios.create({ const service = axios.create({
baseURL: 'http://localhost:12699',
baseURL: import.meta.env.VITE_APP_BASE_API,
timeout: 10000 timeout: 10000
}) })
// import.meta.env.VITE_APP_BASE_API
// 请求拦截器 // 请求拦截器
service.interceptors.request.use( service.interceptors.request.use(
(config) => { (config) => {

5
activitylink/vite.config.js

@ -4,6 +4,7 @@ import path from 'path';
export default defineConfig({ export default defineConfig({
base: '/testBack/', base: '/testBack/',
// prodBack
plugins: [vue()], plugins: [vue()],
resolve: { resolve: {
alias: { alias: {
@ -13,7 +14,9 @@ export default defineConfig({
server: { server: {
proxy: { proxy: {
'/api': { '/api': {
target: 'https://hwjb.homilychart.com/devLotApi/',
target: 'https://hwjb.homilychart.com/prodApi/',
// https://dbqb.nfdxy.net/devLotApi/
// http://localhost:12699/
changeOrigin: true, changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '') rewrite: (path) => path.replace(/^\/api/, '')
}, },

Loading…
Cancel
Save