Kaynağa Gözat

提交代码

Lijy 1 yıl önce
ebeveyn
işleme
6c4657ee38

+ 9 - 3
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/analysis/index.vue

@@ -1,6 +1,6 @@
 <template>
-  <div>
-    analysis
+  <div class="w-full h-full flex items-center justify-center analysis">
+    数据分析页面
   </div>
 </template>
 
@@ -8,4 +8,10 @@
 
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+.analysis {
+  font-size: 40px;
+  color: #999;
+  font-weight: bold;
+}
+</style>

+ 9 - 3
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/login.vue

@@ -73,9 +73,7 @@ const login = (formEl: FormInstance | undefined) => {
       return false as any;
     }
     loginLoading.value = true;
-    //console.log(ruleForm.value);
     post(LOGIN, { ...ruleForm.value }).then(res => {
-      //console.log(res);
       if(res.code == 'error') {
         globalPopup?.showError(res.msg)
         loginLoading.value = false;
@@ -84,10 +82,18 @@ const login = (formEl: FormInstance | undefined) => {
       globalPopup?.showSuccess('登录成功')
       sessionStorage.setItem('token', res.data.id)
       setValue(res.data, 'userInfo')
+      // 将数据分析放到第一位
+      const index = res.data?.moduleList.findIndex((obj: any) => obj.path === '/analysis');
+      if (index !== -1) {
+        const item = res.data?.moduleList.splice(index, 1)[0];
+        res.data?.moduleList.unshift(item);
+      }
+      console.log(res.data?.moduleList)
       setValue(res.data?.moduleList, 'routers')
       setTimeout(() => {
         loginLoading.value = false;
-        router.push(res.data?.moduleList[0].path);
+        // router.push(res.data?.moduleList[0].path);
+        router.push('/analysis');
       }, 100)
     }).catch(_err => {
       loginLoading.value = false;

+ 6 - 1
fhKeeper/formulahousekeeper/customerBuler-crm/src/router/index.ts

@@ -26,6 +26,11 @@ export const routes: RouteRecordRaw[] = [
       //     path: '/thread',
       //     component: () => import("../pages/thread/thread.vue")
       // },
+      {
+        name: 'analysis',
+        path: '/analysis',
+        component: () => import("../pages/analysis/index.vue")
+      },
     ],
   },
   {
@@ -46,6 +51,6 @@ const router = createRouter({
   routes,
 });
 const { beforeEach } = createRouterGuards(router);
-
+console.log('添加好后的路由', beforeEach)
 router.beforeEach(beforeEach);
 export default router;

+ 1 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/router/routerGuards.ts

@@ -3,6 +3,7 @@ import { RouteLocationNormalized, NavigationGuardNext, Router } from "vue-router
 import { useStore } from "@/store/index";
 
 export function createRouterGuards(router: Router) {
+  console.log('开始执行添加路由')
   const beforeEach = (to: RouteLocationNormalized, _from: RouteLocationNormalized, next: NavigationGuardNext) => {
     const routerList = useStore().routers;
     const routers = router.getRoutes();

+ 2 - 2
fhKeeper/formulahousekeeper/customerBuler-crm/vite.config.ts

@@ -4,9 +4,9 @@ import vue from "@vitejs/plugin-vue";
 import { resolve } from "path";
 
 // const target = "http://192.168.2.8:10080";
-const target = "http://127.0.0.1:10080";
+// const target = "http://127.0.0.1:10010";
 // const target = "http://192.168.2.178:10010";
-// const target = "http://47.101.180.183:10010";
+const target = "http://47.101.180.183:10010";
 
 export default defineConfig({
   plugins: [vue()],