Pārlūkot izejas kodu

二级目录配置

zhangle 8 mēneši atpakaļ
vecāks
revīzija
e16777e6b0

+ 1 - 0
crmeb_src/mer_mer_admin/.env.development

@@ -4,6 +4,7 @@ ENV = 'development'
 # base api
 # VUE_APP_BASE_API = '/dev-api'
 VUE_APP_BASE_API = 'http://127.0.0.1:20800'
+VUE_BASE_URL = '/mer/'
 
 # vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
 # to control whether the babel-plugin-dynamic-import-node plugin is enabled.

+ 1 - 1
crmeb_src/mer_mer_admin/src/layout/upgrade/index.vue

@@ -15,7 +15,7 @@
 <script>
 import { Local, Session } from '@/utils/storage';
 import config from '../../../package.json';
-import setting from '../../setting';
+import setting from '../../settings';
 export default {
   data() {
     return {

+ 1 - 0
crmeb_src/mer_mer_admin/src/router/index.js

@@ -153,6 +153,7 @@ const createRouter = () =>
   new Router({
     // mode: 'history', // require service support
     mode: 'history',
+    base: process.env.BASE_URL || '/',
     scrollBehavior: () => ({ y: 0 }),
     routes: constantRoutes,
   });

+ 5 - 0
crmeb_src/mer_mer_admin/src/settings.js

@@ -47,4 +47,9 @@ module.exports = {
    * If you want to also use it in dev, you can pass ['production', 'development']
    */
   errorLog: 'production',
+
+  /**
+   * 二级目录
+   */
+  routePre: process.env.BASE_URL || '/',
 };

+ 3 - 1
crmeb_src/mer_mer_admin/vue.config.js

@@ -15,6 +15,8 @@ const name = defaultSettings.title || 'CRMEB'; // page title
 // port = 9527 npm run dev OR npm run dev --port = 9527
 const port = process.env.port || process.env.npm_config_port || 9527; // dev port
 
+const baseURL =process.env.VUE_BASE_URL || '/'
+
 // All configuration item explanations can be find in https://cli.vuejs.org/config/
 module.exports = {
   /**
@@ -25,7 +27,7 @@ module.exports = {
    * Detail: https://cli.vuejs.org/config/#publicpath
    */
   transpileDependencies: ['element-ui', 'vuex', 'js-cookie', '@babel', 'resize-detector'],
-  publicPath: '/',
+  publicPath: baseURL,
   outputDir: 'dist',
   assetsDir: 'static',
   lintOnSave: process.env.NODE_ENV === 'development',

+ 1 - 0
crmeb_src/mer_plat_admin/.env.development

@@ -4,6 +4,7 @@ ENV = 'development'
 # base api
 # VUE_APP_BASE_API = '/dev-api'
 VUE_APP_BASE_API = 'http://127.0.0.1:20800'
+VUE_BASE_URL = '/admin/'
 
 # vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
 # to control whether the babel-plugin-dynamic-import-node plugin is enabled.

+ 1 - 1
crmeb_src/mer_plat_admin/src/layout/upgrade/index.vue

@@ -15,7 +15,7 @@
 <script>
 import { Local, Session } from '@/utils/storage';
 import config from '../../../package.json';
-import setting from '../../setting';
+import setting from '../../settings';
 export default {
   data() {
     return {

+ 1 - 0
crmeb_src/mer_plat_admin/src/router/index.js

@@ -226,6 +226,7 @@ const createRouter = () =>
   new Router({
     // mode: 'history', // require service support
     mode: 'history',
+    base: process.env.BASE_URL || '/',
     scrollBehavior: () => ({ y: 0 }),
     routes: constantRoutes,
   });

+ 5 - 0
crmeb_src/mer_plat_admin/src/settings.js

@@ -65,4 +65,9 @@ module.exports = {
    * If you want to also use it in dev, you can pass ['production', 'development']
    */
   errorLog: 'production',
+
+  /**
+   * 二级目录
+   */
+  routePre: process.env.BASE_URL || '/',
 };

+ 2 - 1
crmeb_src/mer_plat_admin/vue.config.js

@@ -14,6 +14,7 @@ const name = defaultSettings.title; // page title
 // You can change the port by the following method:
 // port = 9527 npm run dev OR npm run dev --port = 9527
 const port = process.env.port || process.env.npm_config_port || 9527; // dev port
+const baseURL =process.env.VUE_BASE_URL || '/'
 
 // All configuration item explanations can be find in https://cli.vuejs.org/config/
 module.exports = {
@@ -25,7 +26,7 @@ module.exports = {
    * Detail: https://cli.vuejs.org/config/#publicpath
    */
   transpileDependencies: ['element-ui', 'vuex', 'js-cookie', '@babel', 'resize-detector'],
-  publicPath: '/',
+  publicPath: baseURL,
   outputDir: 'dist',
   assetsDir: 'static',
   lintOnSave: process.env.NODE_ENV === 'development',

+ 1 - 1
crmeb_src/mer_uniapp/manifest.json

@@ -234,7 +234,7 @@
         },
         "router" : {
             "mode" : "history",
-            "base" : ""
+            "base" : "/h5/"
         },
         "domain" : "",
         "sdkConfigs" : {

+ 1 - 1
crmeb_src/mer_uniapp/static/html/pc.html

@@ -49,7 +49,7 @@
     </head>
     <body>
        <!--若你的项目未设置根目录(默认为 / 时),则使用下方代码-->
-		<iframe src="/" id="iframe"></iframe>
+		<iframe src="/h5/" id="iframe"></iframe>
 		<!-- <script src="https://pv.sohu.com/cityjson?ie=utf-8"></script> -->
 		<script type="text/javascript">
 		      // var Ip=returnCitySN['cip']