Browse Source

提交代码

xgwangman 4 năm trước cách đây
mục cha
commit
86636be847
7 tập tin đã thay đổi với 61 bổ sung10 xóa
  1. 1 0
      package.json
  2. 4 2
      src/App.vue
  3. 2 5
      src/main.js
  4. 15 0
      src/qiankun.js
  5. 28 0
      src/router-market.js
  6. 10 1
      src/router.js
  7. 1 2
      src/store/admin.js

+ 1 - 0
package.json

@@ -16,6 +16,7 @@
     "lodash": "^4.17.15",
     "marked": "^0.7.0",
     "node-sass": "^4.14.1",
+    "qiankun": "^2.4.0",
     "qs": "^6.9.0",
     "sass-loader": "^9.0.2",
     "view-design": "^4.4.0",

+ 4 - 2
src/App.vue

@@ -37,13 +37,14 @@
                             </Row>
                         </Header>
                         <Content style="margin:15px">
-                            <router-view/>
+                            <router-view />
+                            <div id="marketing"></div>
                         </Content>
                     </Layout>
                 </Layout>
             </div>
             <userSetting ref="userSetting"></userSetting>
-            <div class="foot">©2015-2019 <a href="https://www.jianyu360.com/" target="_blank">jianyu360.com</a> 版权所有 | <a style="cursor:auto">京ICP备14030217号-3</a></div>
+            <div class="foot">©2015-2021 <a href="https://www.jianyu360.com/" target="_blank">jianyu360.com</a> 版权所有 | <a href="https://beian.miit.gov.cn/" target="_blank">京ICP备14030217号-3</a></div>
         </div>
     </div>
 </template>
@@ -82,6 +83,7 @@
                 return menus
             },
             user() {
+                sessionStorage.setItem('userName', this.$store.getters.getAdminUser.username)
                 return this.$store.getters.getAdminUser;
             },
             rotateIcon() {

+ 2 - 5
src/main.js

@@ -1,6 +1,4 @@
 import Vue from 'vue'
-// import iView from 'iview'
-// import 'iview/dist/styles/iview.css'
 import ViewUI from 'view-design';
 import 'view-design/dist/styles/iview.css';
 import {vueRequest} from './plugins/request'
@@ -14,11 +12,10 @@ import uploadFile from './components/uploadFile'
 import fieldMap from './components/fieldMap'
 import App from './App.vue'
 import './assets/css/common.css'
+import './qiankun.js'
 
 Vue.config.productionTip = false;
-// Vue.use(iView, {
-//     transfer: true
-// });
+
 Vue.use(ViewUI, {
     transfer: true
 });

+ 15 - 0
src/qiankun.js

@@ -0,0 +1,15 @@
+import { registerMicroApps, start } from 'qiankun';
+const name = sessionStorage.getItem('userName');
+registerMicroApps([
+  {
+    name: 'marketing',
+    entry: '/page_marketing/',
+    container: '#marketing',
+    activeRule: '/page_marketing',
+    props:{
+      userName: name
+    }
+  }
+]);
+
+start();

+ 28 - 0
src/router-market.js

@@ -0,0 +1,28 @@
+const marketRouter = [
+  {
+    path: '/page_marketing/activity-list', // 活动-列表
+    name: 'activity-list'
+  },
+  {
+    path: '/page_marketing/activity-add', // 活动-新增
+    name: 'activity-add'
+  },
+  {
+    path: '/page_marketing/activity-edit', // 活动-编辑
+    name: 'activity-edit'
+  },
+  {
+    path:'/page_marketing/addTicket',
+    name:'addTicket'
+  },
+  {
+    path:'/page_marketing/ticketDetail',
+    name:'ticketDetail'
+  },
+  {
+    path:'/page_marketing/ticketEdit',
+    name:'ticketEdit'
+  }
+]
+
+export default marketRouter

+ 10 - 1
src/router.js

@@ -2,6 +2,7 @@ import Vue from 'vue'
 import Router from 'vue-router'
 import {config, trim} from './helper'
 import _ from "lodash";
+import marketRouter from './router-market.js'
 
 // 默认title
 document.title = config('SITE_NAME');
@@ -19,6 +20,14 @@ const routes = [
         path: '*',
         component: () => import('./views/error.vue')
     },
+    {
+        path: '/page_marketing',
+        name: 'page_marketing'
+    },
+    {
+        path:'/page_marketing/ticketList',
+        name:'ticketList'
+    },
     {
         path: '/sales/partnerList/partnerDetail',
         name: 'partnerDetail',
@@ -66,7 +75,7 @@ Vue.use(Router);
 
 const router = new Router({
     mode: 'history',
-    routes
+    routes: [...routes, ...marketRouter]
 });
 
 const originalPush = Router.prototype.push

+ 1 - 2
src/store/admin.js

@@ -88,8 +88,7 @@ export default {
             localStorage.removeItem(config('ADMIN_TOKEN_NAME'))
             commit('setAdminUser', {})
             commit('setAdminMenu', [])
-            const htp = window.location.href.split('/')[0]
-            window.location.href = htp + '//' + window.location.host
+            window.location.href = '/'
         },
         login (context, { token }) {
             localStorage.setItem(config('ADMIN_TOKEN_NAME'), token)