Browse Source

feat: 修改根目录配置

zhouyuhao 1 year ago
parent
commit
88ca13eb86
6 changed files with 9 additions and 5 deletions
  1. 1 1
      .env.development
  2. 2 0
      .env.product
  3. 2 2
      .env.test
  4. 1 0
      package.json
  5. 2 1
      src/auto-imports.d.ts
  6. 1 1
      src/router/index.ts

+ 1 - 1
.env.development

@@ -1,2 +1,2 @@
 VITE_API_HOST = 'http://192.168.0.161/Customer_Service_Online'
-VITE_BASE_URL = 'k_new_online'
+VITE_BASE_URL = '/k_new_online/'

+ 2 - 0
.env.product

@@ -0,0 +1,2 @@
+VITE_API_HOST = 'https://online.kln.com/online_backend'
+VITE_BASE_URL = '/'

+ 2 - 2
.env.test

@@ -1,2 +1,2 @@
-VITE_API_HOST = 'https://ra.kerryapex.com/online_backend'
-VITE_BASE_URL = 'new'
+VITE_API_HOST = 'https://ra.kerryapex.com/new/online_backend'
+VITE_BASE_URL = '/new/'

+ 1 - 0
package.json

@@ -11,6 +11,7 @@
     "preview": "vite preview",
     "build-only": "vite build",
     "build:test": "vite build --mode test",
+    "build:pro": "vite build --mode product",
     "build:dev": "vite build --mode development",
     "type-check": "vue-tsc --build --force",
     "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",

+ 2 - 1
src/auto-imports.d.ts

@@ -3,6 +3,7 @@
 // @ts-nocheck
 // noinspection JSUnusedGlobalSymbols
 // Generated by unplugin-auto-import
+// biome-ignore lint: disable
 export {}
 declare global {
   const $api: typeof import('@/api/index')['default']
@@ -68,6 +69,6 @@ declare global {
 // for type re-export
 declare global {
   // @ts-ignore
-  export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue'
+  export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
   import('vue')
 }

+ 1 - 1
src/router/index.ts

@@ -3,7 +3,7 @@ import { useUserStore } from '@/stores/modules/user'
 import { useBreadCrumb } from '@/stores/modules/breadCrumb'
 
 const router = createRouter({
-  history: createWebHistory(`/${import.meta.env.VITE_BASE_URL}/`),
+  history: createWebHistory(`${import.meta.env.VITE_BASE_URL}`),
   routes: [
     {
       path: '/',