瀏覽代碼

地址打包相关修改

lrf 1 周之前
父節點
當前提交
8aba626c91

+ 1 - 1
.env.development

@@ -3,4 +3,4 @@ NODE_ENV=production
 # 请求路径
 VITE_REQUEST_BASE='/warter/front/v2/api'
 
-VITE_BASE_URL="shuitou"
+VITE_BASE_URL=""

+ 1 - 1
.env.production

@@ -4,5 +4,5 @@ NODE_ENV=production
 # 请求路径
 VITE_REQUEST_BASE='/warter/front/v2/api'
 
-VITE_BASE_URL="shuitou"
+VITE_BASE_URL=""
 

+ 1 - 1
src/components/windows/menusIndex.vue

@@ -48,7 +48,7 @@ const key = ref('')
 
 const toSearch = () => {
   if (key.value) {
-    window.open(`/${import.meta.env.VITE_BASE_URL}/queryIndex?key=${key.value}`)
+    window.open(`/queryIndex?key=${key.value}`)
   }
 }
 

+ 1 - 1
src/views/win/introduceParts/combriefIndex.vue

@@ -90,7 +90,7 @@ const toOpen = () => {
   const channel_id = get(info, 'value.channel_id', get(info, 'id'))
   if (!channel_id) return
   window.open(
-    `/${import.meta.env.VITE_BASE_URL}/introduceDetail?channel_id=${channel_id}&type=gsjs`,
+    `/introduceDetail?channel_id=${channel_id}&type=gsjs`,
   )
 }
 </script>

+ 1 - 1
src/views/win/introduceParts/fengmaoIndex.vue

@@ -44,7 +44,7 @@ const list = ref([
   },
 ])
 const toOpen = (path: string) => {
-  window.open(`/${import.meta.env.VITE_BASE_URL}${path}`)
+  window.open(`${path}`)
 }
 </script>
 <style scoped lang="scss">

+ 1 - 1
src/views/win/inwaterParts/honorIndex.vue

@@ -95,7 +95,7 @@ const list2 = ref([
 
 const toOpen = (data: any) => {
   const path = get(data, 'path')
-  window.open(`/${import.meta.env.VITE_BASE_URL}${path}`)
+  window.open(`${path}`)
 }
 </script>
 <style scoped lang="scss">

+ 1 - 1
src/views/win/messParts/commessIndex.vue

@@ -71,7 +71,7 @@ const list = ref<any[]>([
   },
 ])
 const toOpen = (path: string) => {
-  window.open(`/${import.meta.env.VITE_BASE_URL}${path}`)
+  window.open(`${path}`)
 }
 </script>
 <style scoped lang="scss">

+ 2 - 2
src/views/win/messParts/detail/khfw.vue

@@ -26,9 +26,9 @@ const toOpen = (data: object) => {
   const content_id = get(data, 'content_id')
   const url = get(data, 'url')
   if(content_id) {
-    window.open(`/${import.meta.env.VITE_BASE_URL}/messDetailSec?content_id=${content_id}`)
+    window.open(`/messDetailSec?content_id=${content_id}`)
   } else {
-    window.open(`/${import.meta.env.VITE_BASE_URL}${url}`)
+    window.open(`${url}`)
   }
 }
 </script>

+ 1 - 1
src/views/win/messParts/detail/list.vue

@@ -77,7 +77,7 @@ onMounted(() => {
 })
 const toDetail = (data: any) => {
   const content_id = get(data, 'content_id')
-  window.open(`/${import.meta.env.VITE_BASE_URL}/messDetailSec?content_id=${content_id}`)
+  window.open(`/messDetailSec?content_id=${content_id}`)
 }
 </script>
 <style scoped lang="scss">

+ 2 - 2
src/views/win/messParts/detail/zhfw.vue

@@ -32,9 +32,9 @@ const toOpen = (data: object) => {
   const content_id = get(data, 'content_id')
   const url = get(data, 'url')
   if(content_id) {
-    window.open(`/${import.meta.env.VITE_BASE_URL}/messDetailSec?content_id=${content_id}`)
+    window.open(`/messDetailSec?content_id=${content_id}`)
   } else {
-    window.open(`/${import.meta.env.VITE_BASE_URL}${url}`)
+    window.open(`${url}`)
   }
 }
 </script>

+ 1 - 1
src/views/win/messParts/serviceIndex.vue

@@ -81,7 +81,7 @@ const list = ref<any[]>([
   },
 ])
 const toOpen = (path: string) => {
-  window.open(`/${import.meta.env.VITE_BASE_URL}${path}`)
+  window.open(`${path}`)
 }
 </script>
 <style scoped lang="scss">

+ 1 - 1
src/views/win/newsParts/listIndex.vue

@@ -141,7 +141,7 @@ const toSearch = async ({ skip = 0, limit = 10, ...info } = {}) => {
 }
 const toDetail = (data: object) => {
   const content_id = get(data, 'content_id')
-  window.open(`/${import.meta.env.VITE_BASE_URL}/newsDetail?content_id=${content_id}`)
+  window.open(`/newsDetail?content_id=${content_id}`)
 }
 import { useRoute } from 'vue-router'
 const route = useRoute()

+ 1 - 1
src/views/win/popularwillParts/respondIndex.vue

@@ -96,7 +96,7 @@ const toSearch = async ({ skip = 0, limit = 10, ...info } = {}) => {
 }
 const toDetail = (data: object) => {
   const content_id = get(data, 'content_id')
-  window.open(`/${import.meta.env.VITE_BASE_URL}/popularwillDetail?content_id=${content_id}`)
+  window.open(`/popularwillDetail?content_id=${content_id}`)
 }
 </script>
 <style scoped lang="scss">

+ 1 - 1
src/views/win/queryParts/listIndex.vue

@@ -61,7 +61,7 @@ onMounted(() => {
 })
 const toDetail = (data: any) => {
   const content_id = get(data, 'content_id')
-  window.open(`/${import.meta.env.VITE_BASE_URL}/queryDetail?content_id=${content_id}`)
+  window.open(`/queryDetail?content_id=${content_id}`)
 }
 </script>
 <style scoped lang="scss">

+ 1 - 1
src/views/win/watersupplyParts/listIndex.vue

@@ -176,7 +176,7 @@ onMounted(() => {
 })
 const toDetail = (data: any) => {
   const content_id = get(data, 'content_id')
-  window.open(`/${import.meta.env.VITE_BASE_URL}/watersupplyDetail?content_id=${content_id}`)
+  window.open(`/watersupplyDetail?content_id=${content_id}`)
 }
 </script>
 <style scoped lang="scss">

+ 1 - 1
src/views/winParts/conductingBusiness.vue

@@ -55,7 +55,7 @@ const list = ref([
 ])
 /**打开对应的页面 */
 const toOpen = (path: string) => {
-  window.open(`/${import.meta.env.VITE_BASE_URL}${path}`)
+  window.open(`${path}`)
 }
 </script>
 <style scoped lang="scss">

+ 1 - 1
src/views/winParts/introduceIndex.vue

@@ -50,7 +50,7 @@ const init = async () => {
   }
 }
 const toOpen = () => {
-  window.open(`/${import.meta.env.VITE_BASE_URL}/introduceIndex`)
+  window.open(`/introduceIndex`)
 }
 </script>
 <style scoped lang="scss">

+ 1 - 1
src/views/winParts/newsIndex.vue

@@ -191,7 +191,7 @@ const getProp = (item: object, path: string) => {
 }
 const toDetail = (data: any) => {
   const content_id = get(data, 'content_id')
-  window.open(`/${import.meta.env.VITE_BASE_URL}/newsDetail?content_id=${content_id}`)
+  window.open(`/newsDetail?content_id=${content_id}`)
 }
 </script>
 <style scoped lang="scss">

+ 1 - 1
src/views/winParts/notesIndex.vue

@@ -107,7 +107,7 @@ const toChange = (event: { id: string }) => {
       })
     } else {
       // 新开页面
-      window.open(`/${import.meta.env.VITE_BASE_URL}${to}`)
+      window.open(`${to}`)
     }
   }
 }

+ 2 - 3
vite.config.ts

@@ -8,9 +8,7 @@ import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
 
 // https://vite.dev/config/
 export default defineConfig(({ command, mode }) => {
-  console.log(command, mode)
   const env = loadEnv(mode, process.cwd(), '')
-  console.log(env.NODE_ENV)
   return {
     /* 共享 */
     // 根目录
@@ -64,7 +62,8 @@ export default defineConfig(({ command, mode }) => {
     },
     /* 构建选项 */
     build: {
-      outDir: env.VITE_BASE_URL
+      outDir: 'shuitou'
+      //env.VITE_BASE_URL
       // 最终捆绑包的浏览器兼容性目标。默认值是 Vite 特殊值
       // target:'',
       // 预加载