wjx 18 hours ago
parent
commit
3b3676f89d

+ 12 - 0
config/routes.ts

@@ -162,6 +162,18 @@ export default [
     ],
     ],
   },
   },
   dataStatisticsNovel,
   dataStatisticsNovel,
+  {
+    path: '/mp',
+    name: '运营系统'
+  },
+  {
+    path: '/corpChat',
+    name: '企微系统'
+  },
+  {
+    path: '/adLaunch',
+    name: '投放系统'
+  },
   {
   {
     path: '*',
     path: '*',
     layout: false,
     layout: false,

+ 36 - 6
src/app.tsx

@@ -25,6 +25,9 @@ import { ReactComponent as BookDataSvg } from '@/assets/icons/bookData.svg'
 import { ReactComponent as ImageDataSvg } from '@/assets/icons/imageData.svg'
 import { ReactComponent as ImageDataSvg } from '@/assets/icons/imageData.svg'
 import { ReactComponent as RechargeDataSvg } from '@/assets/icons/rechargeData.svg'
 import { ReactComponent as RechargeDataSvg } from '@/assets/icons/rechargeData.svg'
 import { ReactComponent as NovelDataSystemSvg } from '@/assets/icons/novelDataSystem.svg'
 import { ReactComponent as NovelDataSystemSvg } from '@/assets/icons/novelDataSystem.svg'
+import { ReactComponent as CorpChatSvg } from '@/assets/icons/corpChat.svg'
+import { ReactComponent as WeChatSvg } from '@/assets/icons/weChat.svg'
+import { ReactComponent as AdLaunchsSvg } from '@/assets/icons/adLaunchs.svg'
 import { ConfigProvider, Watermark } from 'antd';
 import { ConfigProvider, Watermark } from 'antd';
 const isDev = process.env.NODE_ENV === 'development';
 const isDev = process.env.NODE_ENV === 'development';
 const loginPath = '/user/login';
 const loginPath = '/user/login';
@@ -189,6 +192,21 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) =
               ...menuSync.map(({ routes, ...item }) => {
               ...menuSync.map(({ routes, ...item }) => {
                 return { ...item, routes: [{ path: item.path, redirect: routes[0].path }, ...routes] }
                 return { ...item, routes: [{ path: item.path, redirect: routes[0].path }, ...routes] }
               }),
               }),
+              {
+                path: '/mp',
+                name: '运营系统',
+                icon: <WeChatSvg />
+              },
+              {
+                path: '/corpChat',
+                name: '企微系统',
+                icon: <CorpChatSvg />
+              },
+              {
+                path: '/adLaunch',
+                name: '投放系统',
+                icon: <AdLaunchsSvg />
+              },
             ]
             ]
             setInitialState(s => ({ ...s, menu: menuData?.data }))
             setInitialState(s => ({ ...s, menu: menuData?.data }))
             return menu;
             return menu;
@@ -206,13 +224,25 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) =
       },
       },
     },
     },
     footerRender: () => <Footer />,
     footerRender: () => <Footer />,
-    onPageChange: () => {
-      const { location } = history;
+    onPageChange: (location) => {
+      if (location?.pathname === '/mp') {
+        window.open(`https://mp.zanxiangnet.com/#/user/login?token=${localStorage.getItem('Admin-Token')}`, '_blank')
+        history.back() // 返回上一页
+        return
+      } else if (location?.pathname === '/corpChat') { 
+        window.open(`https://corp.zanxiangnet.com/#/login?token=${localStorage.getItem('Admin-Token')}`, '_blank')
+        history.back() // 返回上一页
+        return
+      } else if (location?.pathname === '/adLaunch') {
+        window.open(`https://adq.zanxiangnet.com/#/user/login?token=${localStorage.getItem('Admin-Token')}`, '_blank')
+        history.back() // 返回上一页
+        return
+      }
       // 如果没有登录,重定向到 login
       // 如果没有登录,重定向到 login
-      if (location.pathname !== loginPath && !localStorage.getItem('Admin-Token')) {
+      if (location?.pathname !== loginPath && !localStorage.getItem('Admin-Token')) {
         history.push(loginPath);
         history.push(loginPath);
       }
       }
-      if (initialState?.currentUser && location.pathname !== loginPath) {
+      if (initialState?.currentUser && location?.pathname !== loginPath) {
         let menu = []
         let menu = []
         if (initialState?.menu) {
         if (initialState?.menu) {
           menu = Object.values(initialState?.menu).map((item: unknown) => {
           menu = Object.values(initialState?.menu).map((item: unknown) => {
@@ -223,7 +253,7 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) =
           }).filter(Boolean) as any[]
           }).filter(Boolean) as any[]
         }
         }
         if (menu?.length) {
         if (menu?.length) {
-          switch (location.pathname) {
+          switch (location?.pathname) {
             case '/':
             case '/':
               history.push(menu?.[0]?.children?.[0]?.path)
               history.push(menu?.[0]?.children?.[0]?.path)
               break;
               break;
@@ -311,7 +341,7 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) =
 export const request = {
 export const request = {
   ...errorConfig,
   ...errorConfig,
   timeout: 300000,
   timeout: 300000,
-  headers: { 
+  headers: {
     ['Authorization']: 'Bearer ' + localStorage.getItem('Admin-Token'),
     ['Authorization']: 'Bearer ' + localStorage.getItem('Admin-Token'),
     ['debug']: sessionStorage.getItem('debug') || ''
     ['debug']: sessionStorage.getItem('debug') || ''
   }
   }

+ 1 - 0
src/assets/icons/adLaunchs.svg

@@ -0,0 +1 @@
+<svg viewBox="64 64 896 896" focusable="false" data-icon="fund-view" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M733 64.2H287.1C164 64.2 64.2 164 64.2 287.1V733c0 123.1 99.8 222.9 222.9 222.9H733c123.1 0 222.9-99.8 222.9-222.9V287.1C955.9 164 856.1 64.2 733 64.2z" fill="#73C0DE" p-id="25741"></path><path d="M734.8 733m-222.9 0a222.9 222.9 0 1 0 445.8 0 222.9 222.9 0 1 0-445.8 0Z" fill="#FFFFFF" opacity=".16" p-id="25742"></path><path d="M697.4 242.6H322.7c-45.4 0-82.2 36.9-82.2 82.2v274c0 45.4 36.9 82.2 82.2 82.2h374.7c45.4 0 82.2-36.9 82.2-82.2v-274c0-45.4-36.9-82.2-82.2-82.2z m44.3 356.2c0 24.4-19.9 44.3-44.3 44.3H322.7c-24.4 0-44.3-19.9-44.3-44.3v-274c0-24.4 19.9-44.3 44.3-44.3h374.7c24.4 0 44.3 19.9 44.3 44.3v274zM630 735.8H390.1c-10.5 0-19 8.5-19 19s8.5 19 19 19H630c10.5 0 19-8.5 19-19s-8.5-19-19-19z m0 0" fill="#FFFFFF" p-id="25743"></path><path d="M340.4 579.1c-2.4 0-4.9-0.5-7.2-1.4-4.8-1.9-8.6-5.6-10.6-10.4-2-4.7-2.1-10.1-0.1-14.9l71.9-179.1c2.9-7.3 10-12.1 17.9-12.2h0.1c7.8 0 14.9 4.7 17.9 12l74.4 179.1c2.7 6.4 1.7 13.7-2.5 19.2s-11 8.3-17.9 7.4c-6.9-0.9-12.7-5.4-15.4-11.8l-56.3-135-54.2 135c-2.9 7.3-10 12.1-18 12.1z m0 0" fill="#FFFFFF" p-id="25744"></path><path d="M455.7 524.6h-85.5c-10.7 0-19.4-8.7-19.4-19.4s8.7-19.4 19.4-19.4h85.5c10.7 0 19.4 8.7 19.4 19.4s-8.7 19.4-19.4 19.4z m103.1 57.8h-5.6c-10.7 0-19.4-8.7-19.4-19.4V375.2c0-10 7.6-18.4 17.5-19.3 3-0.3 73.1-6.7 115.9 32.1 21.1 19.2 31.8 45.3 31.8 77.7 0 33.5-10.3 60.6-30.5 80.7-24.1 23.8-61.1 36-109.7 36z m13.9-188.1v148.9c31-1.8 54-10 68.6-24.5 12.8-12.6 19-30 19-53 0-21.2-6.2-37.2-19-48.8-19.4-17.8-49.6-21.9-68.6-22.6z m0 0" fill="#FFFFFF" p-id="25745"></path></svg>

+ 1 - 1
src/assets/icons/bookData.svg

@@ -1 +1 @@
-<svg viewBox="64 64 896 896" focusable="false" data-icon="fund-view" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M889.728 128h63.573333v896H190.976C121.173333 1024 64 966.4 64 896V128c0-70.4 57.173333-128 127.018667-128h635.221333v767.104H222.805333a95.616 95.616 0 0 0-95.274666 96c0 53.034667 42.666667 96 95.274666 96h666.922667V128zM191.018667 866.304c0-18.944 21.674667-34.304 40.533333-34.304h594.346667v68.565333H231.552c-18.773333 0-40.533333-15.36-40.533333-34.261333z" fill="currentColor" p-id="13706"></path></svg>
+<svg viewBox="64 64 896 896" focusable="false" data-icon="fund-view" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M856.60820578 158.89959912c-16.98622753 0-28.30884809 11.32353924-28.30884808 28.3088481v656.7698691c0 28.30884809-28.30884809 56.61769619-56.61769619 56.61769619H273.44042304c-33.97061772 0-73.60392371-28.30884809-73.60392371-56.61769619v-62.28038447c0-28.30884809 33.97245506-45.29415695 67.9421541-45.29415694h475.59232264c16.98622753 0 28.30884809-11.32353924 28.30884809-28.3088481V153.23691084c0-62.2794658-45.29415695-101.91185314-113.23539237-101.91185314H273.44042304c-62.2794658 0-124.55893161 33.97061772-124.5589316 101.91185314V866.6253948c5.66176961 50.95592657 56.61769619 90.58923256 107.57362275 96.25100219H771.68074283c62.28038448 0 113.23631104-50.95684524 113.23631104-107.57454143v-668.09432702c0-11.32262057-11.32353924-28.30884809-28.30884809-28.30884809zM749.03366436 793.02147109h-464.2687834c-16.98530885 0-28.30884809 11.32353924-28.3088481 28.30976676s11.32353924 28.30884809 28.30976677 28.3088481h464.2687834c16.98439019 0 28.30792942-11.32353924 28.30792942-28.3088481S766.01897321 793.02147109 749.03366436 793.02147109z" p-id="45034"></path></svg>

File diff suppressed because it is too large
+ 0 - 0
src/assets/icons/corpChat.svg


+ 1 - 1
src/assets/icons/novelDataSystem.svg

@@ -1 +1 @@
-<svg viewBox="64 64 896 896" focusable="false" data-icon="fund-view" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M653.354667 170.666667a171.690667 171.690667 0 0 0 168.832 203.050666c10.453333-0.042667 20.906667-1.066667 31.146666-2.986666v340.138666C853.333333 854.016 768.896 938.666667 625.578667 938.666667H313.429333C169.813333 938.666667 85.333333 854.016 85.333333 710.869333V399.189333C85.333333 256.085333 169.770667 170.666667 313.429333 170.666667z m5.162666 255.744l-4.992 0.341333a31.146667 31.146667 0 0 0-20.778666 12.544l-102.826667 132.266667-117.034667-92.16a31.573333 31.573333 0 0 0-44.672 5.973333l-126.037333 162.56a30.72 30.72 0 0 0-6.784 19.498667l0.128 4.693333a31.488 31.488 0 0 0 58.026667 13.653333l105.429333-136.362666 117.077333 91.776a31.573333 31.573333 0 0 0 45.013334-5.589334l121.941333-157.354666V477.44a32.170667 32.170667 0 0 0-5.973333-44.586667 31.146667 31.146667 0 0 0-23.509334-6.144z" fill="currentColor" p-id="73000"></path><path d="M832 192m-106.666667 0a106.666667 106.666667 0 1 0 213.333334 0 106.666667 106.666667 0 1 0-213.333334 0Z" fill="currentColor" opacity=".4" p-id="73001"></path></svg>
+<svg viewBox="64 64 896 896" focusable="false" data-icon="fund-view" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M0 0m384 0l256 0q384 0 384 384l0 256q0 384-384 384l-256 0q-384 0-384-384l0-256q0-384 384-384Z" fill="#3E63F1" p-id="42767"></path><path d="M320 256m128 0l128 0q128 0 128 128l0 0q0 128-128 128l-128 0q-128 0-128-128l0 0q0-128 128-128Z" fill="#3E63F1" p-id="42768"></path><path d="M348.16 673.696h323.36a54.08 54.08 0 0 0 53.888-53.888V309.888A54.048 54.048 0 0 0 671.52 256H348.16a54.08 54.08 0 0 0-53.888 53.888v404.224A54.048 54.048 0 0 0 348.16 768h357.088a20.704 20.704 0 0 0 20.192-20.192 20.736 20.736 0 0 0-20.16-20.224H361.6a27.008 27.008 0 0 1-26.944-26.944v-28.288c4.032 0 9.44 1.344 13.44 1.344h0.032z m53.888-390.752h80.832v132.064l-28.288-29.664c-6.72-5.376-16.16-5.376-21.568 0l-30.976 29.664V282.944z" fill="#FFFFFF" p-id="42769"></path></svg>

+ 1 - 0
src/assets/icons/weChat.svg

@@ -0,0 +1 @@
+<svg viewBox="64 64 896 896" focusable="false" data-icon="fund-view" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M0 0m512 0l0 0q512 0 512 512l0 0q0 512-512 512l0 0q-512 0-512-512l0 0q0-512 512-512Z" fill="#149F5A" p-id="10543"></path><path d="M815.889626 471.889416l-60.039974-59.734452V327.713574c0-31.310898-25.512708-56.696026-56.98476-56.696026h-84.881207L553.943711 211.279738c-22.18219-22.068039-58.317639-22.068039-80.630767 0l-60.039974 59.734452H328.391764c-15.114911 0-29.608708 5.976131-40.295239 16.605587a56.548302 56.548302 0 0 0-16.689522 40.087082v84.448105l-60.043331 59.734452c-22.18219 22.071397-22.18219 58.015475 0 80.221168l60.043331 59.734452v84.444748c0 15.037692 6.00299 29.457626 16.689522 40.087082a57.135843 57.135843 0 0 0 40.295239 16.608944h84.881206l60.039974 59.734452c22.18219 22.068039 58.314282 22.068039 80.630767 0l60.039974-59.734452h84.881207c15.114911 0 29.608708-5.976131 40.295239-16.605587a56.548302 56.548302 0 0 0 16.689521-40.087082v-84.448105l60.039974-59.734452A56.484511 56.484511 0 0 0 832.629508 512c0-15.051121-6.023134-29.484485-16.739882-40.110584z m-155.547278-16.253062l-185.035122 155.809154a28.604852 28.604852 0 0 1-18.465574 6.741613c-0.795698 0-1.594754 0-2.524747-0.134295-7.570885-0.658046-14.611305-4.226938-19.39221-10.041915l-71.199895-84.975213a28.208682 28.208682 0 0 1 3.585679-39.912498c12.086557-10.041915 30.021666-8.326295 40.117298 3.568892l52.868616 63.038111 163.252459-137.440944c12.086557-10.045272 30.018308-8.591528 40.113941 3.303659 10.229928 12.026125 8.769469 29.998164-3.320445 40.043436z" fill="#FFFFFF" p-id="10544"></path></svg>

Some files were not shown because too many files changed in this diff