weixin_52219567 пре 1 месец
родитељ
комит
66b7891f01
9 измењених фајлова са 250 додато и 201 уклоњено
  1. 3 0
      .env.development
  2. 3 0
      .env.production
  3. 1 18
      package.json
  4. 48 18
      src/permission.ts
  5. 1 0
      src/types/env.d.ts
  6. 19 13
      src/utils/request.ts
  7. 88 140
      src/utils/siteConfig.ts
  8. 63 10
      src/views/home/index.vue
  9. 24 2
      vite.config.ts

+ 3 - 0
.env.development

@@ -34,3 +34,6 @@ VITE_APP_WEBSOCKET = false
 
 
 # sse 开关
 # sse 开关
 VITE_APP_SSE = true
 VITE_APP_SSE = true
+
+# 是否开启多域名
+VITE_DOMAIN_NAME = false

+ 3 - 0
.env.production

@@ -37,3 +37,6 @@ VITE_APP_WEBSOCKET = false
 
 
 # sse 开关
 # sse 开关
 VITE_APP_SSE = true
 VITE_APP_SSE = true
+
+# 是否开启多域名
+VITE_DOMAIN_NAME = false

+ 1 - 18
package.json

@@ -7,24 +7,7 @@
   "license": "MIT",
   "license": "MIT",
   "type": "module",
   "type": "module",
   "scripts": {
   "scripts": {
-    "dev:www": "vite --port 5101",
-    "dev:b": "vite --port 5102",
-    "dev:mro": "vite --port 5103",
-    "dev:fuli": "vite --port 5104",
-    "dev:reg": "vite --port 5105",
-    "dev:breg": "vite --port 5106",
-    "dev:greg": "vite --port 5107",
-    "dev:passport": "vite --port 5108",
-    "dev:search": "vite --port 5109",
-    "dev:item": "vite --port 5110",
-    "dev:cart": "vite --port 5111",
-    "dev:trad": "vite --port 5112",
-    "dev:payc": "vite --port 5113",
-    "dev:order": "vite --port 5114",
-    "dev:plan": "vite --port 5115",
-    "dev:plan_info": "vite --port 5116",
-    "dev:i": "vite --port 5117",
-    "dev:easybuv": "vite --port 5118",
+    "dev": "vite serve --mode development",
     "build:prod": "vite build --mode production",
     "build:prod": "vite build --mode production",
     "build:dev": "vite build --mode development",
     "build:dev": "vite build --mode development",
     "preview": "vite preview",
     "preview": "vite preview",

+ 48 - 18
src/permission.ts

@@ -7,20 +7,38 @@ import { isPathMatch } from '@/utils/validate';
 import { useUserStore } from '@/store/modules/user';
 import { useUserStore } from '@/store/modules/user';
 import { ElMessage } from 'element-plus/es';
 import { ElMessage } from 'element-plus/es';
 import { getCurrentSite, SITE_ROUTES } from '@/utils/siteConfig';
 import { getCurrentSite, SITE_ROUTES } from '@/utils/siteConfig';
+import { cartStore } from '@/store/modules/cart';
 
 
 NProgress.configure({ showSpinner: false });
 NProgress.configure({ showSpinner: false });
-const whiteList = ['/login', '/register', '/social-callback', '/register*', '/register/*', '/index', '/'];
+const whiteList = [
+  '/login',
+  '/register',
+  '/social-callback',
+  '/register*',
+  '/register/*',
+  '/index',
+  '/',
+  '/indexB',
+  '/indexMro',
+  '/indexFuli',
+  '/reg',
+  '/search',
+  '/item'
+];
 
 
 const isWhiteList = (path: string) => {
 const isWhiteList = (path: string) => {
   return whiteList.some((pattern) => isPathMatch(pattern, path));
   return whiteList.some((pattern) => isPathMatch(pattern, path));
 };
 };
 
 
 // 获取主站完整 URL(用于跨域跳转)
 // 获取主站完整 URL(用于跨域跳转)
-function getMainSiteUrl(path: any) {
+function getMainSiteUrl(path: string) {
   if (import.meta.env.PROD) {
   if (import.meta.env.PROD) {
-    return `https://www.yoe365.com${path}`;
+    return `https://www.yingpai365.com${path}`;
   } else {
   } else {
-    return `http://localhost:5101${path}`;
+    // 本地开发:指向 www.yingpai365.com 加上当前运行的端口
+    // 假设你启动 vite 后访问的是 http://www.yingpai365.com
+    const devPort = window.location.port || import.meta.env.VITE_APP_PORT;
+    return `http://www.yingpai365.com:${devPort}${path}`;
   }
   }
 }
 }
 
 
@@ -28,36 +46,48 @@ router.beforeEach(async (to, from, next) => {
   NProgress.start();
   NProgress.start();
   const site = getCurrentSite();
   const site = getCurrentSite();
   const allowedPaths = SITE_ROUTES[site];
   const allowedPaths = SITE_ROUTES[site];
-  const host = window.location.hostname;
-  const port = window.location.port;
+
   if (getToken()) {
   if (getToken()) {
     const [err] = await tos(useUserStore().getInfo());
     const [err] = await tos(useUserStore().getInfo());
     if (err) {
     if (err) {
       await useUserStore().logout();
       await useUserStore().logout();
       ElMessage.error(err);
       ElMessage.error(err);
-      window.location.href = getMainSiteUrl('/index');
+      if (import.meta.env.VITE_DOMAIN_NAME == 'true') {
+        window.location.href = getMainSiteUrl('/login');
+      } else {
+        next('/login');
+      }
       NProgress.done();
       NProgress.done();
     } else {
     } else {
-      if (!allowedPaths.includes(to.path)) {
-        console.warn(`[${site}] 禁止访问 ${to.path}`);
-        window.location.href = getMainSiteUrl('/index');
-        NProgress.done();
+      cartStore().onCartCount();
+      // 是否开启多域名
+      if (import.meta.env.VITE_DOMAIN_NAME == 'true') {
+        if (!allowedPaths.includes(to.path)) {
+          console.warn(`[${site}] 禁止访问 ${to.path}`);
+          window.location.href = getMainSiteUrl('/index');
+          NProgress.done();
+        } else {
+          next();
+          NProgress.done();
+        }
       } else {
       } else {
         next();
         next();
         NProgress.done();
         NProgress.done();
       }
       }
     }
     }
   } else {
   } else {
-    // 没有token
+    // 没有 token
     if (isWhiteList(to.path)) {
     if (isWhiteList(to.path)) {
-      if (host == 'www.yoe365.com' || port == '5101') {
-        next();
-      } else {
-        window.location.href = getMainSiteUrl(to.path);
-      }
+      next();
       NProgress.done();
       NProgress.done();
     } else {
     } else {
-      window.location.href = getMainSiteUrl('/index');
+      // 非白名单且无 token,强制去登录
+      if (import.meta.env.VITE_DOMAIN_NAME == 'true') {
+        window.location.href = getMainSiteUrl('/login');
+      } else {
+        next('/login');
+      }
+      // 或者 '/login' 根据你的白名单设置
       NProgress.done();
       NProgress.done();
     }
     }
   }
   }

+ 1 - 0
src/types/env.d.ts

@@ -30,6 +30,7 @@ interface ImportMetaEnv {
   VITE_APP_CLIENT_ID: string;
   VITE_APP_CLIENT_ID: string;
   VITE_APP_WEBSOCKET: string;
   VITE_APP_WEBSOCKET: string;
   VITE_APP_SSE: string;
   VITE_APP_SSE: string;
+  VITE_DOMAIN_NAME: string;
 }
 }
 interface ImportMeta {
 interface ImportMeta {
   readonly env: ImportMetaEnv;
   readonly env: ImportMetaEnv;

+ 19 - 13
src/utils/request.ts

@@ -9,8 +9,20 @@ import { LoadingInstance } from 'element-plus/es/components/loading/src/loading'
 import FileSaver from 'file-saver';
 import FileSaver from 'file-saver';
 import { encryptBase64, encryptWithAes, generateAesKey, decryptWithAes, decryptBase64 } from '@/utils/crypto';
 import { encryptBase64, encryptWithAes, generateAesKey, decryptWithAes, decryptBase64 } from '@/utils/crypto';
 import { encrypt, decrypt } from '@/utils/jsencrypt';
 import { encrypt, decrypt } from '@/utils/jsencrypt';
+import { onPath } from '@/utils/siteConfig';
 import router from '@/router';
 import router from '@/router';
-import { getApiBase } from '@/utils/siteConfig';
+
+// 获取主站完整 URL(用于跨域跳转)
+function getMainSiteUrl(path: string) {
+  if (import.meta.env.PROD) {
+    return `https://www.yingpai365.com${path}`;
+  } else {
+    // 本地开发:指向 www.yingpai365.com 加上当前运行的端口
+    // 假设你启动 vite 后访问的是 http://www.yingpai365.com
+    const devPort = window.location.port || import.meta.env.VITE_APP_PORT;
+    return `http://www.yingpai365.com:${devPort}${path}`;
+  }
+}
 
 
 const encryptHeader = 'encrypt-key';
 const encryptHeader = 'encrypt-key';
 let downloadLoadingInstance: LoadingInstance;
 let downloadLoadingInstance: LoadingInstance;
@@ -27,8 +39,7 @@ axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8';
 axios.defaults.headers['clientid'] = import.meta.env.VITE_APP_CLIENT_ID;
 axios.defaults.headers['clientid'] = import.meta.env.VITE_APP_CLIENT_ID;
 // 创建 axios 实例
 // 创建 axios 实例
 const service = axios.create({
 const service = axios.create({
-  // baseURL: import.meta.env.VITE_APP_BASE_API,
-  baseURL: getApiBase(),
+  baseURL: import.meta.env.VITE_APP_BASE_API,
   // withCredentials: true,
   // withCredentials: true,
   timeout: 50000,
   timeout: 50000,
   transitional: {
   transitional: {
@@ -37,15 +48,6 @@ const service = axios.create({
   }
   }
 });
 });
 
 
-// 获取主站完整 URL(用于跨域跳转)
-function getMainSiteUrl(path: any) {
-  if (import.meta.env.PROD) {
-    return `https://www.yoe365.com${path}`;
-  } else {
-    return `http://localhost:5101${path}`;
-  }
-}
-
 // 请求拦截器
 // 请求拦截器
 service.interceptors.request.use(
 service.interceptors.request.use(
   (config: InternalAxiosRequestConfig) => {
   (config: InternalAxiosRequestConfig) => {
@@ -163,7 +165,11 @@ service.interceptors.response.use(
       // });
       // });
       // }
       // }
       useUserStore().logout().then(() => {
       useUserStore().logout().then(() => {
-        window.location.href = getMainSiteUrl('/index');
+        if (import.meta.env.VITE_DOMAIN_NAME == 'true') {
+          window.location.href = getMainSiteUrl('/login');
+        }else{
+          router.push('/login');
+        }
       });
       });
       return Promise.reject('无效的会话,或者会话已过期,请重新登录。');
       return Promise.reject('无效的会话,或者会话已过期,请重新登录。');
     } else if (code === HttpStatus.SERVER_ERROR) {
     } else if (code === HttpStatus.SERVER_ERROR) {

+ 88 - 140
src/utils/siteConfig.ts

@@ -1,28 +1,4 @@
-// src/utils/site.ts
-
-// 开发环境:端口 → 站点
-const DEV_PORT_MAP: Record<string, any> = {
-  '5101': 'www',
-  '5102': 'b',
-  '5103': 'mro',
-  '5104': 'fuli',
-  '5105': 'reg',
-  '5106': 'breg',
-  '5107': 'greg',
-  '5108': 'passport',
-  '5109': 'search',
-  '5110': 'item',
-  '5111': 'cart',
-  '5112': 'trad',
-  '5113': 'payc',
-  '5114': 'order',
-  '5115': 'plan',
-  '5116': 'plan_info',
-  '5117': 'i',
-  '5118': 'easybuv'
-};
-
-// 每个站点允许的路由
+// 每个站点允许的路由 (保持不变)
 export const SITE_ROUTES: Record<any, string[]> = {
 export const SITE_ROUTES: Record<any, string[]> = {
   www: ['/', '/index'], //优易365主站
   www: ['/', '/index'], //优易365主站
   b: ['/indexB'], //企业购商城
   b: ['/indexB'], //企业购商城
@@ -75,148 +51,120 @@ export const SITE_ROUTES: Record<any, string[]> = {
     '/organization/approvalFlow/create',
     '/organization/approvalFlow/create',
     '/order/orderManage/detail/:orderNo',
     '/order/orderManage/detail/:orderNo',
     '/order/orderManage/applyAfter',
     '/order/orderManage/applyAfter',
-    '/valueAdded/maintenanceApply',
-    '/enterprise/messageNotice',
-    '/enterprise/securitySetting',
-    '/enterprise/securitySetting/resetPassword',
-    '/enterprise/securitySetting/changePhone'
+    '/valueAdded/maintenanceApply'
   ], //订单列表
   ], //订单列表
 
 
   i: ['/i'], //个人信息
   i: ['/i'], //个人信息
   easybuv: ['/easybuv'] //地址管理
   easybuv: ['/easybuv'] //地址管理
 };
 };
 
 
-// 获取当前站点(开发用端口,线上用域名)
+// 获取当前站点
 export function getCurrentSite(): any {
 export function getCurrentSite(): any {
-  if (import.meta.env.PROD) {
-    // 线上:根据域名判断
-    const host = window.location.hostname;
-    if (host === 'b.yoe365.com') return 'b';
-    if (host === 'mro.yoe365.com') return 'mro';
-    if (host === 'mro.yoe365.com') return 'fuli';
-    if (host === 'mro.yoe365.com') return 'reg';
-    if (host === 'mro.yoe365.com') return 'breg';
-    if (host === 'mro.yoe365.com') return 'greg';
-    if (host === 'mro.yoe365.com') return 'passport';
-    if (host === 'mro.yoe365.com') return 'search';
-    if (host === 'mro.yoe365.com') return 'item';
-    if (host === 'mro.yoe365.com') return 'cart';
-    if (host === 'mro.yoe365.com') return 'trad';
-    if (host === 'mro.yoe365.com') return 'payc';
-    if (host === 'mro.yoe365.com') return 'order';
-    if (host === 'mro.yoe365.com') return 'plan';
-    if (host === 'mro.yoe365.com') return 'plan_info';
-    if (host === 'mro.yoe365.com') return 'i';
-    if (host === 'mro.yoe365.com') return 'easybuv';
-    return 'www';
-  }
+  // 无论是生产还是开发,现在都统一通过域名判断
+  const host = window.location.hostname;
 
 
-  // 本地:根据端口判断
-  const port = window.location.port || '80';
-  return DEV_PORT_MAP[port] || 'www';
-}
+  // 定义本地开发环境的域名映射关系
+  // 确保你的 hosts 文件已经配置了这些域名指向 127.0.0.1
+  if (host === 'www.yingpai365.com' || host === 'localhost') return 'www'; // 兼容未配hosts的情况
+  if (host === 'b.yingpai365.com') return 'b';
+  if (host === 'mro.yingpai365.com') return 'mro';
+  if (host === 'fuli.yingpai365.com') return 'fuli';
+  if (host === 'reg.yingpai365.com') return 'reg';
+  if (host === 'breg.yingpai365.com') return 'breg';
+  if (host === 'greg.yingpai365.com') return 'greg';
+  if (host === 'passport.yingpai365.com') return 'passport';
+  if (host === 'search.yingpai365.com') return 'search';
+  if (host === 'item.yingpai365.com') return 'item';
+  if (host === 'cart.yingpai365.com') return 'cart';
+  if (host === 'trad.yingpai365.com') return 'trad';
+  if (host === 'payc.yingpai365.com') return 'payc';
+  if (host === 'order.yingpai365.com') return 'order';
+  if (host === 'plan.yingpai365.com') return 'plan';
+  if (host === 'plan_info.yingpai365.com') return 'plan_info';
+  if (host === 'i.yingpai365.com') return 'i';
+  if (host === 'easybuv.yingpai365.com') return 'easybuv';
 
 
-// 根据站点返回 API 基地址
-
-export function getApiBase() {
-  const site = getCurrentSite();
-  const map: Record<any, string> = {
-    www: 'https://www.yoe365.com',
-    b: 'https://b.yoe365.com',
-    mro: 'https://mro.yoe365.com',
-    fuli: 'https://fuli.yoe365.com',
-    reg: 'https://reg.yoe365.com',
-    breg: 'https://breg.yoe365.com',
-    greg: 'https://greg.yoe365.com',
-    passport: 'https://passport.yoe365.com',
-    search: 'https://search.yoe365.com',
-    item: 'https://item.yoe365.com',
-    cart: 'https://cart.yoe365.com',
-    trad: 'https://trad.yoe365.com',
-    payc: 'https://payc.yoe365.com',
-    order: 'https://order.yoe365.com',
-    plan: 'https://plan.yoe365.com',
-    plan_info: 'https://plan_info.yoe365.com',
-    i: 'https://i.yoe365.com',
-    easybuv: 'https://easybuv.yoe365.com'
-  };
+  // 生产环境逻辑 (保持不变,或者合并到上面的判断中)
   if (import.meta.env.PROD) {
   if (import.meta.env.PROD) {
-    return map[site];
-  } else {
-    // return '/dev-api'
-    // return 'http://192.168.1.52:8080';
-    // return 'https://ceshi.xiaoluwebsite.xyz';
-    return 'http://localhost:8080';
+    // 如果上面没匹配到,且是生产环境,可以尝试原有的逻辑或默认返回 www
+    // 这里建议直接复用上面的 hostname 判断,因为生产环境也是域名
+    return 'www';
   }
   }
+
+  return 'www'; // 默认 fallback
 }
 }
 
 
+// ... PATH_TO_SITE_MAP 和 getSiteByPath 保持不变 ...
 const PATH_TO_SITE_MAP: Record<string, any> = {};
 const PATH_TO_SITE_MAP: Record<string, any> = {};
 for (const [site, paths] of Object.entries(SITE_ROUTES)) {
 for (const [site, paths] of Object.entries(SITE_ROUTES)) {
   for (const path of paths) {
   for (const path of paths) {
     PATH_TO_SITE_MAP[path] = site as any;
     PATH_TO_SITE_MAP[path] = site as any;
   }
   }
 }
 }
-
 export function getSiteByPath(path: string): any | null {
 export function getSiteByPath(path: string): any | null {
-  // 支持带查询参数(如 /login?redirect=xxx)
   const cleanPath = path.split('?')[0];
   const cleanPath = path.split('?')[0];
   return PATH_TO_SITE_MAP[cleanPath] || null;
   return PATH_TO_SITE_MAP[cleanPath] || null;
 }
 }
+
+// 跨站跳转逻辑
+import router from '@/router';
 export function onPath(path: string) {
 export function onPath(path: string) {
-  const targetSite = getSiteByPath(path);
-  if (!targetSite) {
-    // window.open(url, '_blank');
-    console.error(`[跨站跳转失败] 路径 "${path}" 未关联任何站点`);
-    return;
-  }
+  console.log('[跨站跳转]', path);
+  // return
+  if (import.meta.env.VITE_DOMAIN_NAME == 'true') {
+    const targetSite = getSiteByPath(path);
 
 
-  let url = '';
+    if (!targetSite) {
+      console.error(`[跨站跳转失败] 路径 "${path}" 未关联任何站点`);
+      return;
+    }
 
 
-  if (import.meta.env.PROD) {
-    const domainMap: Record<any, string> = {
-      www: 'https://www.yoe365.com',
-      b: 'https://b.yoe365.com',
-      mro: 'https://mro.yoe365.com',
-      fuli: 'https://fuli.yoe365.com',
-      reg: 'https://reg.yoe365.com',
-      breg: 'https://breg.yoe365.com',
-      greg: 'https://greg.yoe365.com',
-      passport: 'https://passport.yoe365.com',
-      search: 'https://search.yoe365.com',
-      item: 'https://item.yoe365.com',
-      cart: 'https://cart.yoe365.com',
-      trad: 'https://trad.yoe365.com',
-      payc: 'https://payc.yoe365.com',
-      order: 'https://order.yoe365.com',
-      plan: 'https://plan.yoe365.com',
-      plan_info: 'https://plan_info.yoe365.com',
-      i: 'https://i.yoe365.com',
-      easybuv: 'https://easybuv.yoe365.com'
+    const currentSite = getCurrentSite();
+
+    // 【新增】判断是否是同域名
+    const isSameSite = currentSite === targetSite;
+
+    let url = '';
+    // 域名映射表 (保持不变)
+    const domainMap: Record<string, string> = {
+      www: 'www.yingpai365.com',
+      b: 'b.yingpai365.com',
+      mro: 'mro.yingpai365.com',
+      fuli: 'fuli.yingpai365.com',
+      reg: 'reg.yingpai365.com',
+      breg: 'breg.yingpai365.com',
+      greg: 'greg.yingpai365.com',
+      passport: 'passport.yingpai365.com',
+      search: 'search.yingpai365.com',
+      item: 'item.yingpai365.com',
+      cart: 'cart.yingpai365.com',
+      trad: 'trad.yingpai365.com',
+      payc: 'payc.yingpai365.com',
+      order: 'order.yingpai365.com',
+      plan: 'plan.yingpai365.com',
+      plan_info: 'plan_info.yingpai365.com',
+      i: 'i.yingpai365.com',
+      easybuv: 'easybuv.yingpai365.com'
     };
     };
-    url = `${domainMap[targetSite]}${path}`;
+
+    const baseDomain = domainMap[targetSite];
+
+    if (import.meta.env.PROD) {
+      url = `https://${baseDomain}${path}`;
+    } else {
+      const devPort = window.location.port || import.meta.env.VITE_APP_PORT;
+      url = `http://${baseDomain}:${devPort}${path}`;
+    }
+
+    // 【修改】根据是否同域名决定跳转方式
+    if (isSameSite) {
+      // 同域名且传入了 router,使用 Vue Router 内部跳转
+      router.push(path);
+    } else {
+      // 跨域名 或 未传入 router,使用 window.open 打开新窗口
+      window.open(url, '_blank');
+    }
   } else {
   } else {
-    const portMap: Record<any, string> = {
-      www: 'http://localhost:5101',
-      b: 'http://localhost:5102',
-      mro: 'http://localhost:5103',
-      fuli: 'http://localhost:5104',
-      reg: 'http://localhost:5105',
-      breg: 'http://localhost:5106',
-      greg: 'http://localhost:5107',
-      passport: 'http://localhost:5108',
-      search: 'http://localhost:5109',
-      item: 'http://localhost:5110',
-      cart: 'http://localhost:5111',
-      trad: 'http://localhost:5112',
-      payc: 'http://localhost:5113',
-      order: 'http://localhost:5114',
-      plan: 'http://localhost:5115',
-      plan_info: 'http://localhost:5116',
-      i: 'http://localhost:5117',
-      easybuv: 'http://localhost:5118'
-    };
-    url = `${portMap[targetSite]}${path}`;
+    router.push(path);
   }
   }
-
-  window.open(url, '_blank');
 }
 }

+ 63 - 10
src/views/home/index.vue

@@ -63,8 +63,9 @@
           </div>
           </div>
           <div class="login-btn">
           <div class="login-btn">
             <el-button v-if="!userInfo.nickName" type="primary" round size="small" style="width: 64px" @click="onPath('/login')">登录</el-button>
             <el-button v-if="!userInfo.nickName" type="primary" round size="small" style="width: 64px" @click="onPath('/login')">登录</el-button>
-            <el-button v-if="!userInfo.nickName" type="primary" plain round size="small" style="width: 64px" @click="onPath('/reg')">注册</el-button>
-            <el-button v-if="userInfo.nickName" type="primary" plain round size="small" style="width: 64px" @click="onPath('/reg')">退出</el-button>
+            <!-- @click="onPath('/reg')" -->
+            <el-button v-if="!userInfo.nickName" type="primary" plain round size="small" style="width: 64px">注册</el-button>
+            <el-button v-if="userInfo.nickName" type="primary" plain round size="small" style="width: 64px" @click="onlogout()">退出</el-button>
           </div>
           </div>
         </div>
         </div>
         <div class="real-time">
         <div class="real-time">
@@ -98,7 +99,7 @@
         <span class="title1">{{ hotTitle.title }}</span>
         <span class="title1">{{ hotTitle.title }}</span>
         <span class="title2">{{ hotTitle.subtitle }}</span>
         <span class="title2">{{ hotTitle.subtitle }}</span>
       </div>
       </div>
-      <div class="title-more flex-row-start" @click="onPath(hotTitle.linkUrl ? hotTitle.linkUrl : '/plan', 2)">
+      <div class="title-more flex-row-start" @click="onPath(hotTitle.linkUrl ? hotTitle.linkUrl : '/plan')">
         <div style="margin-right: 5px">{{ hotTitle.linkWord }}</div>
         <div style="margin-right: 5px">{{ hotTitle.linkWord }}</div>
         <el-icon :size="13" color="#83899F">
         <el-icon :size="13" color="#83899F">
           <ArrowRight />
           <ArrowRight />
@@ -120,7 +121,7 @@
         <span class="title1">{{ sceneTitle.title }}</span>
         <span class="title1">{{ sceneTitle.title }}</span>
         <span class="title2">{{ sceneTitle.subtitle }}</span>
         <span class="title2">{{ sceneTitle.subtitle }}</span>
       </div>
       </div>
-      <div class="title-more flex-row-start" @click="onPath(sceneTitle.linkUrl ? sceneTitle.linkUrl : '/plan/procure', 2)">
+      <div class="title-more flex-row-start" @click="onPath(sceneTitle.linkUrl ? sceneTitle.linkUrl : '/plan/procure')">
         <div style="margin-right: 5px">{{ sceneTitle.linkWord }}</div>
         <div style="margin-right: 5px">{{ sceneTitle.linkWord }}</div>
         <el-icon :size="13" color="#83899F">
         <el-icon :size="13" color="#83899F">
           <ArrowRight />
           <ArrowRight />
@@ -171,7 +172,7 @@
         <span class="title1">{{ expertTitle.title }}</span>
         <span class="title1">{{ expertTitle.title }}</span>
         <span class="title2">{{ expertTitle.subtitle }}</span>
         <span class="title2">{{ expertTitle.subtitle }}</span>
       </div>
       </div>
-      <div class="title-more flex-row-start" @click="onPath(hotTitle.linkUrl ? hotTitle.linkUrl : '/search/special', 2)">
+      <div class="title-more flex-row-start" @click="onPath(hotTitle.linkUrl ? hotTitle.linkUrl : '/search/special')">
         <div style="margin-right: 5px">{{ expertTitle.linkWord }}</div>
         <div style="margin-right: 5px">{{ expertTitle.linkWord }}</div>
         <el-icon :size="13" color="#83899F">
         <el-icon :size="13" color="#83899F">
           <ArrowRight />
           <ArrowRight />
@@ -288,7 +289,7 @@
         <span class="title1">{{ projectTitle.title }}</span>
         <span class="title1">{{ projectTitle.title }}</span>
         <span class="title2">{{ projectTitle.subtitle }}</span>
         <span class="title2">{{ projectTitle.subtitle }}</span>
       </div>
       </div>
-      <div class="title-more flex-row-start" @click="onPath(projectTitle.linkUrl ? projectTitle.linkUrl : '/plan/project', 2)">
+      <div class="title-more flex-row-start" @click="onPath(projectTitle.linkUrl ? projectTitle.linkUrl : '/plan/project')">
         <div style="margin-right: 5px">{{ projectTitle.linkWord }}</div>
         <div style="margin-right: 5px">{{ projectTitle.linkWord }}</div>
         <el-icon :size="13" color="#83899F">
         <el-icon :size="13" color="#83899F">
           <ArrowRight />
           <ArrowRight />
@@ -308,7 +309,9 @@
               <div></div>
               <div></div>
               <div class="flex-row-start">
               <div class="flex-row-start">
                 <div style="margin-right: 5px">了解详情</div>
                 <div style="margin-right: 5px">了解详情</div>
-                <el-icon :size="14" color="#E7000B"><ArrowRight /></el-icon>
+                <el-icon :size="14" color="#E7000B">
+                  <ArrowRight />
+                </el-icon>
               </div>
               </div>
             </div>
             </div>
           </div>
           </div>
@@ -567,6 +570,14 @@ getClassificationFloorList({}).then(async (res) => {
 const onInfo = (res: any) => {
 const onInfo = (res: any) => {
   router.push('/shop/info?id=' + res.id);
   router.push('/shop/info?id=' + res.id);
 };
 };
+import { useUserStore } from '@/store/modules/user';
+const onlogout = () => {
+  useUserStore()
+    .logout()
+    .then(() => {
+      onPath('/login');
+    });
+};
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>
@@ -586,6 +597,7 @@ const onInfo = (res: any) => {
       width: 234px;
       width: 234px;
       height: 540px;
       height: 540px;
       background: #ffffff;
       background: #ffffff;
+
       &.classify-show {
       &.classify-show {
         position: absolute;
         position: absolute;
         z-index: 10;
         z-index: 10;
@@ -716,6 +728,7 @@ const onInfo = (res: any) => {
         margin-top: 10px;
         margin-top: 10px;
         display: flex;
         display: flex;
         gap: 0 10px;
         gap: 0 10px;
+
         .head-item {
         .head-item {
           flex: 1;
           flex: 1;
           background-color: #ffffff;
           background-color: #ffffff;
@@ -726,6 +739,7 @@ const onInfo = (res: any) => {
           cursor: pointer;
           cursor: pointer;
           border-radius: 5px;
           border-radius: 5px;
           overflow: hidden;
           overflow: hidden;
+
           img {
           img {
             width: 100%;
             width: 100%;
             height: 100%;
             height: 100%;
@@ -734,12 +748,14 @@ const onInfo = (res: any) => {
             // margin-right: 10px;
             // margin-right: 10px;
             // border-radius: 10px;
             // border-radius: 10px;
           }
           }
+
           .head-title {
           .head-title {
             .head1 {
             .head1 {
               font-weight: 550;
               font-weight: 550;
               font-size: 22px;
               font-size: 22px;
               color: #101828;
               color: #101828;
             }
             }
+
             .head2 {
             .head2 {
               width: 76px;
               width: 76px;
               height: 21px;
               height: 21px;
@@ -1060,7 +1076,8 @@ const onInfo = (res: any) => {
           color: #364153;
           color: #364153;
           display: -webkit-box;
           display: -webkit-box;
           -webkit-line-clamp: 2;
           -webkit-line-clamp: 2;
-          line-clamp: 2; /* 添加标准属性 */
+          line-clamp: 2;
+          /* 添加标准属性 */
           -webkit-box-orient: vertical;
           -webkit-box-orient: vertical;
           overflow: hidden;
           overflow: hidden;
           text-overflow: ellipsis;
           text-overflow: ellipsis;
@@ -1074,6 +1091,7 @@ const onInfo = (res: any) => {
     width: 1200px;
     width: 1200px;
     display: flex;
     display: flex;
     margin-top: 12px;
     margin-top: 12px;
+
     .expert-list {
     .expert-list {
       width: 230px;
       width: 230px;
       height: 306px;
       height: 306px;
@@ -1081,25 +1099,30 @@ const onInfo = (res: any) => {
       margin-left: 12.5px;
       margin-left: 12.5px;
       padding: 20px;
       padding: 20px;
       cursor: pointer;
       cursor: pointer;
+
       &:first-child {
       &:first-child {
         margin-left: 0;
         margin-left: 0;
       }
       }
+
       img {
       img {
         width: 100%;
         width: 100%;
         height: 190px;
         height: 190px;
       }
       }
+
       .itemName {
       .itemName {
         font-weight: 400;
         font-weight: 400;
         font-size: 14px;
         font-size: 14px;
         color: #101828;
         color: #101828;
         margin: 27px 0 2px 0;
         margin: 27px 0 2px 0;
       }
       }
+
       .price {
       .price {
         .memberPrice {
         .memberPrice {
           color: var(--el-color-primary);
           color: var(--el-color-primary);
           font-size: 16px;
           font-size: 16px;
           color: #e7000b;
           color: #e7000b;
         }
         }
+
         .marketPrice {
         .marketPrice {
           font-size: 12px;
           font-size: 12px;
           color: #99a1af;
           color: #99a1af;
@@ -1118,21 +1141,25 @@ const onInfo = (res: any) => {
     width: 1200px;
     width: 1200px;
     margin-top: 12px;
     margin-top: 12px;
     gap: 0 15px;
     gap: 0 15px;
+
     .procure-list {
     .procure-list {
       width: 390px;
       width: 390px;
       height: 268px;
       height: 268px;
       background: #ffffff;
       background: #ffffff;
       cursor: pointer;
       cursor: pointer;
+
       img {
       img {
         width: 390px;
         width: 390px;
         height: 200px;
         height: 200px;
       }
       }
+
       .procure1 {
       .procure1 {
         padding: 12px 0 4px 20px;
         padding: 12px 0 4px 20px;
         font-weight: 600;
         font-weight: 600;
         font-size: 14px;
         font-size: 14px;
         color: #101828;
         color: #101828;
       }
       }
+
       .procure2 {
       .procure2 {
         padding-left: 20px;
         padding-left: 20px;
         font-size: 12px;
         font-size: 12px;
@@ -1228,20 +1255,24 @@ const onInfo = (res: any) => {
           align-items: center;
           align-items: center;
           padding: 0 10px;
           padding: 0 10px;
           cursor: pointer;
           cursor: pointer;
+
           .advertiseName {
           .advertiseName {
             font-weight: 600;
             font-weight: 600;
             font-size: 14px;
             font-size: 14px;
             color: #101828;
             color: #101828;
           }
           }
+
           .advertiseDescribe {
           .advertiseDescribe {
             font-size: 12px;
             font-size: 12px;
             color: #364153;
             color: #364153;
             margin: 4px 0 10px 0;
             margin: 4px 0 10px 0;
           }
           }
+
           .bnt {
           .bnt {
             width: 68px;
             width: 68px;
             height: 24px;
             height: 24px;
           }
           }
+
           img {
           img {
             width: 72px;
             width: 72px;
             height: 72px;
             height: 72px;
@@ -1249,6 +1280,7 @@ const onInfo = (res: any) => {
           }
           }
         }
         }
       }
       }
+
       .home2-two {
       .home2-two {
         width: 177px;
         width: 177px;
         height: 273px;
         height: 273px;
@@ -1263,13 +1295,15 @@ const onInfo = (res: any) => {
           font-size: 14px;
           font-size: 14px;
           color: #101828;
           color: #101828;
         }
         }
+
         .advertiseDescribe {
         .advertiseDescribe {
           font-size: 12px;
           font-size: 12px;
           color: #364153;
           color: #364153;
           margin: 4px 0 30px 0;
           margin: 4px 0 30px 0;
           display: -webkit-box;
           display: -webkit-box;
           -webkit-line-clamp: 2;
           -webkit-line-clamp: 2;
-          line-clamp: 2; /* 添加标准属性 */
+          line-clamp: 2;
+          /* 添加标准属性 */
           -webkit-box-orient: vertical;
           -webkit-box-orient: vertical;
           overflow: hidden;
           overflow: hidden;
           text-overflow: ellipsis;
           text-overflow: ellipsis;
@@ -1283,25 +1317,30 @@ const onInfo = (res: any) => {
       }
       }
     }
     }
   }
   }
+
   .shop-bos {
   .shop-bos {
     display: flex;
     display: flex;
     margin-top: 14px;
     margin-top: 14px;
+
     .shop-nav {
     .shop-nav {
       width: 230px;
       width: 230px;
       height: 306px;
       height: 306px;
       background: #ffffff;
       background: #ffffff;
       padding: 16px;
       padding: 16px;
+
       .nav-title {
       .nav-title {
         font-weight: 600;
         font-weight: 600;
         font-size: 16px;
         font-size: 16px;
         color: #101828;
         color: #101828;
         margin-bottom: 10px;
         margin-bottom: 10px;
       }
       }
+
       .nav-bos {
       .nav-bos {
         width: 100%;
         width: 100%;
         display: flex;
         display: flex;
         flex-wrap: wrap;
         flex-wrap: wrap;
         justify-content: space-between;
         justify-content: space-between;
+
         .nav-list {
         .nav-list {
           width: 94px;
           width: 94px;
           height: 32px;
           height: 32px;
@@ -1311,9 +1350,11 @@ const onInfo = (res: any) => {
           color: #101828;
           color: #101828;
           margin-bottom: 10px;
           margin-bottom: 10px;
           cursor: pointer;
           cursor: pointer;
+
           &:hover {
           &:hover {
             color: var(--el-color-primary);
             color: var(--el-color-primary);
           }
           }
+
           &.hig {
           &.hig {
             background: var(--el-color-primary);
             background: var(--el-color-primary);
             color: #ffffff;
             color: #ffffff;
@@ -1321,6 +1362,7 @@ const onInfo = (res: any) => {
         }
         }
       }
       }
     }
     }
+
     .shop-list {
     .shop-list {
       width: 230px;
       width: 230px;
       height: 306px;
       height: 306px;
@@ -1328,22 +1370,26 @@ const onInfo = (res: any) => {
       margin-left: 12.5px;
       margin-left: 12.5px;
       padding: 20px;
       padding: 20px;
       cursor: pointer;
       cursor: pointer;
+
       img {
       img {
         width: 100%;
         width: 100%;
         height: 190px;
         height: 190px;
       }
       }
+
       .itemName {
       .itemName {
         font-weight: 400;
         font-weight: 400;
         font-size: 14px;
         font-size: 14px;
         color: #101828;
         color: #101828;
         margin: 27px 0 2px 0;
         margin: 27px 0 2px 0;
       }
       }
+
       .price {
       .price {
         .memberPrice {
         .memberPrice {
           color: var(--el-color-primary);
           color: var(--el-color-primary);
           font-size: 16px;
           font-size: 16px;
           color: #e7000b;
           color: #e7000b;
         }
         }
+
         .marketPrice {
         .marketPrice {
           font-size: 12px;
           font-size: 12px;
           color: #99a1af;
           color: #99a1af;
@@ -1362,12 +1408,14 @@ const onInfo = (res: any) => {
     width: 1200px;
     width: 1200px;
     margin-top: 12px;
     margin-top: 12px;
     gap: 0 15px;
     gap: 0 15px;
+
     .project-list {
     .project-list {
       width: 390px;
       width: 390px;
       height: 350px;
       height: 350px;
       cursor: pointer;
       cursor: pointer;
       border-radius: 10px;
       border-radius: 10px;
       overflow: hidden;
       overflow: hidden;
+
       .project-box {
       .project-box {
         width: 390px;
         width: 390px;
         height: 156px;
         height: 156px;
@@ -1378,26 +1426,31 @@ const onInfo = (res: any) => {
         position: absolute;
         position: absolute;
         padding: 20px;
         padding: 20px;
       }
       }
+
       img {
       img {
         width: 390px;
         width: 390px;
         height: 180px;
         height: 180px;
       }
       }
+
       .project1 {
       .project1 {
         font-weight: 600;
         font-weight: 600;
         font-size: 16px;
         font-size: 16px;
         color: #101828;
         color: #101828;
         margin-bottom: 14px;
         margin-bottom: 14px;
       }
       }
+
       .project2 {
       .project2 {
         font-size: 14px;
         font-size: 14px;
         color: #364153;
         color: #364153;
         display: -webkit-box;
         display: -webkit-box;
         -webkit-line-clamp: 2;
         -webkit-line-clamp: 2;
-        line-clamp: 2; /* 添加标准属性 */
+        line-clamp: 2;
+        /* 添加标准属性 */
         -webkit-box-orient: vertical;
         -webkit-box-orient: vertical;
         overflow: hidden;
         overflow: hidden;
         text-overflow: ellipsis;
         text-overflow: ellipsis;
       }
       }
+
       .project-more {
       .project-more {
         text-align: right;
         text-align: right;
         font-size: 14px;
         font-size: 14px;

+ 24 - 2
vite.config.ts

@@ -20,12 +20,34 @@ export default defineConfig(({ mode, command }) => {
     plugins: createPlugins(env, command === 'build'),
     plugins: createPlugins(env, command === 'build'),
     server: {
     server: {
       host: '0.0.0.0',
       host: '0.0.0.0',
+      allowedHosts: [
+        'www.yingpai365.com',
+        'b.yingpai365.com',
+        'mro.yingpai365.com',
+        'fuli.yingpai365.com',
+        'reg.yingpai365.com',
+        'breg.yingpai365.com',
+        'greg.yingpai365.com',
+        'passport.yingpai365.com',
+        'search.yingpai365.com',
+        'item.yingpai365.com',
+        'cart.yingpai365.com',
+        'trad.yingpai365.com',
+        'payc.yingpai365.com',
+        'order.yingpai365.com',
+        'plan.yingpai365.com',
+        'plan_info.yingpai365.com',
+        'i.yingpai365.com',
+        'easybuv.yingpai365.com'
+      ],
       port: Number(env.VITE_APP_PORT),
       port: Number(env.VITE_APP_PORT),
+      // port: Number(env.VITE_APP_PORT),
       open: true,
       open: true,
       proxy: {
       proxy: {
         [env.VITE_APP_BASE_API]: {
         [env.VITE_APP_BASE_API]: {
-          // target: 'http://localhost:8080',
-          target: 'https://ceshi.xiaoluwebsite.xyz',
+          target: 'http://localhost:8080',
+          // target: 'http://yp1.yingpaipay.com:9026',
+          // target: 'https://jingyang.xiaoluwebsite.xyz',
           // target: 'http://192.168.1.52:8080',
           // target: 'http://192.168.1.52:8080',
           changeOrigin: true,
           changeOrigin: true,
           ws: true,
           ws: true,