Browse Source

no message

MS-CIAZDCOIXVRW\Administrator 3 years ago
parent
commit
b91255911d
4 changed files with 12 additions and 14 deletions
  1. 1 1
      .env.development
  2. 1 1
      .env.production
  3. 7 10
      src/router/index.js
  4. 3 2
      vue.config.js

+ 1 - 1
.env.development

@@ -2,4 +2,4 @@
 ENV = 'development'
 ENV = 'development'
 
 
 # base api
 # base api
-VUE_APP_BASE_API = '/reporting'
+VUE_APP_BASE_API = '/gradiate-school/reporting/'

+ 1 - 1
.env.production

@@ -2,4 +2,4 @@
 ENV = 'production'
 ENV = 'production'
 
 
 # base api
 # base api
-VUE_APP_BASE_API = '/prod-api'
+VUE_APP_BASE_API = '/gradiate-school/reporting/'

+ 7 - 10
src/router/index.js

@@ -1,8 +1,5 @@
-import {
-  createRouter,
-  createWebHistory,
-  createWebHashHistory
-} from 'vue-router'
+import { createRouter, createWebHashHistory } from 'vue-router'
+// createWebHistory,
 import layout from '@/layout'
 import layout from '@/layout'
 
 
 // 公开路由表
 // 公开路由表
@@ -48,11 +45,11 @@ const publicRoutes = [
 ]
 ]
 
 
 const router = createRouter({
 const router = createRouter({
-  // history: createWebHashHistory(),
-  history:
-    process.env.NODE_ENV === 'production'
-      ? createWebHistory()
-      : createWebHashHistory(),
+  history: createWebHashHistory(),
+  // history:
+  //   process.env.NODE_ENV === 'production'
+  //     ? createWebHistory()
+  //     : createWebHashHistory(),
   routes: [...publicRoutes]
   routes: [...publicRoutes]
 })
 })
 
 

+ 3 - 2
vue.config.js

@@ -3,14 +3,15 @@ const { defineConfig } = require('@vue/cli-service')
 const NodePolyfillPlugin = require('node-polyfill-webpack-plugin')
 const NodePolyfillPlugin = require('node-polyfill-webpack-plugin')
 
 
 module.exports = defineConfig({
 module.exports = defineConfig({
+  publicPath: '/gradiate-school/manage/',
   transpileDependencies: true,
   transpileDependencies: true,
   devServer: {
   devServer: {
     // 配置反向代理
     // 配置反向代理
     proxy: {
     proxy: {
       // 当地址中有/api的时候会触发代理机制
       // 当地址中有/api的时候会触发代理机制
-      '/reporting': {
+      '/gradiate-school/reporting/': {
         // 要代理的服务器地址  这里不用写 api
         // 要代理的服务器地址  这里不用写 api
-        target: 'https://chtech.ncjti.edu.cn/gradiate-school',
+        target: 'https://chtech.ncjti.edu.cn/',
         changeOrigin: true // 是否跨域
         changeOrigin: true // 是否跨域
       }
       }
     }
     }