From 58c4710b562f5328d42ad4e5398a09bfa1e1886f Mon Sep 17 00:00:00 2001 From: fuxiaochun Date: Mon, 21 Aug 2023 09:59:04 +0800 Subject: [PATCH] debug --- src/components/ArticleDetail/index.vue | 18 +++++++-- src/layouts/Header.vue | 2 +- src/router/index.js | 38 +++++++++++-------- .../business/components/CategoryCardList.vue | 19 ++++++++-- src/views/business/insight/list.vue | 7 +--- src/views/business/legal/policy.vue | 11 ++---- src/views/business/legal/searchResult.vue | 2 +- src/views/business/macroeconomics/list.vue | 7 +--- src/views/training/index.vue | 23 +++++++++++ 9 files changed, 83 insertions(+), 44 deletions(-) create mode 100644 src/views/training/index.vue diff --git a/src/components/ArticleDetail/index.vue b/src/components/ArticleDetail/index.vue index b2c93e5..8a2cd97 100644 --- a/src/components/ArticleDetail/index.vue +++ b/src/components/ArticleDetail/index.vue @@ -90,7 +90,7 @@ const getRecommendList = () => { http('/api/article', params, 'get').then(res => { recommend.value = res.data.data || []; }).catch(err => { - message.error(err.message); + showToast(err.message); }); }; @@ -100,9 +100,21 @@ const goDetail = (id) => { policy: `/business/legal/policy/detail/${id}`, insight: '', }; - if(urlOptions[props.type]){ - router.push(urlOptions[props.type]); + if (urlOptions[props.type]) { + http(`/api/article/${id}`, {}, 'get').then(res => { + router.push(urlOptions[props.type]); + }).catch(err => { + if (err.status == 1001) { + showToast('无权限阅读,或会员已过期,请先订阅会员'); + // placeholder.value = '无权限阅读,或会员已过期,请先订阅会员'; + } + }); + + // router.push(path[props.type]); + } else { + console.log('无此类型详情页路由跳转配置:' + props.type); } + }; diff --git a/src/layouts/Header.vue b/src/layouts/Header.vue index 168a260..424b9d5 100644 --- a/src/layouts/Header.vue +++ b/src/layouts/Header.vue @@ -20,7 +20,7 @@
  • AI助理
  • AI商情
  • AI传播
  • -
  • AI献策
  • +
  • AI培训
  • 会员服务
  • 个人中心
  • 退出登录
  • diff --git a/src/router/index.js b/src/router/index.js index a5f0939..9294b63 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -23,7 +23,7 @@ const router = createRouter({ path: "chat-layout", name: "ChatLayout", meta: { - title: "AI助理布局", + title: "AI助理", }, redirect :'/chat', component:ChatLayout, @@ -59,7 +59,7 @@ const router = createRouter({ path: "/business/macroeconomics", name: "Macroeconomics", meta: { - title: "AI商情-宏观政经", + title: "宏观政经", group: 'business' }, component: () => import("@/views/business/macroeconomics/index.vue"), @@ -68,7 +68,7 @@ const router = createRouter({ path: "/business/macroeconomics/list/:pid", name: "MacroeconomicsList", meta: { - title: "AI商情-宏观政经内容分类列表", + title: "宏观政经", group: 'business' }, component: () => import("@/views/business/macroeconomics/list.vue"), @@ -77,7 +77,7 @@ const router = createRouter({ path: "/business/macroeconomics/detail/:id", name: "MacroeconomicsDetail", meta: { - title: "AI商情-宏观政经内容详情", + title: "宏观政经", group: 'business' }, component: () => import("@/views/business/macroeconomics/detail.vue"), @@ -86,7 +86,7 @@ const router = createRouter({ path: "/business/macroeconomics/trend/:id", name: "Trend", meta: { - title: "AI商情-洞见趋势详情", + title: "洞见趋势", group: 'business' }, component: () => import("@/views/business/macroeconomics/trend.vue"), @@ -95,7 +95,7 @@ const router = createRouter({ path: 'business/insight', name: 'insight', meta: { - title: 'AI商情-行业洞察', + title: '行业洞察', group: 'business' }, component: () => import("@/views/business/insight/index.vue"), @@ -104,7 +104,7 @@ const router = createRouter({ path: 'business/insight/category/:cid', name: 'insightCategory', meta: { - title: 'AI商情-行业洞察', + title: '行业洞察', group: 'business' }, component: () => import("@/views/business/insight/list.vue"), @@ -113,7 +113,7 @@ const router = createRouter({ path: 'business/insight/detail/:id', name: 'insightDetail', meta: { - title: 'AI商情-行业洞察', + title: '行业洞察', group: 'business' }, component: () => import("@/views/business/insight/detail.vue"), @@ -122,7 +122,7 @@ const router = createRouter({ path: 'business/legal', name: 'legal', meta: { - title: 'AI商情-法律法规', + title: '法律法规', group: 'business' }, component: () => import("@/views/business/legal/index.vue"), @@ -131,7 +131,7 @@ const router = createRouter({ path: 'business/legal/policy', name: 'policy', meta: { - title: 'AI商情-法律法规-政策解读', + title: '政策解读', group: 'business' }, component: () => import("@/views/business/legal/policy.vue"), @@ -140,7 +140,7 @@ const router = createRouter({ path: 'business/legal/policy/detail/:id', name: 'policyDetail', meta: { - title: 'AI商情-法律法规-政策解读', + title: '政策解读', group: 'business' }, component: () => import("@/views/business/legal/policyDetail.vue"), @@ -149,7 +149,7 @@ const router = createRouter({ path: 'business/legal/country', name: 'country', meta: { - title: 'AI商情-法律法规-国别地区指南', + title: '国别地区指南', group: 'business' }, component: () => import("@/views/business/legal/country.vue"), @@ -158,7 +158,7 @@ const router = createRouter({ path: 'business/legal/country/detail/:id', name: 'countryDetail', meta: { - title: 'AI商情-法律法规-国别地区指南', + title: '国别地区指南', group: 'business' }, component: () => import("@/views/business/legal/countryInfo.vue"), @@ -167,7 +167,7 @@ const router = createRouter({ path: 'business/legal/search', name: 'search', meta: { - title: 'AI商情-法律法规-境外法规检索', + title: '境外法规检索', group: 'business' }, component: () => import("@/views/business/legal/search.vue"), @@ -176,11 +176,19 @@ const router = createRouter({ path: 'business/legal/searchResult', name: 'searchResult', meta: { - title: 'AI商情-法律法规-境外法规检索', + title: '境外法规检索结果', group: 'business' }, component: () => import("@/views/business/legal/searchResult.vue"), }, + { + path: "training", + name: "Training", + meta: { + title: "AI培训", + }, + component: () => import("@/views/training/index.vue"), + }, { path: "vip", name: "Vip", diff --git a/src/views/business/components/CategoryCardList.vue b/src/views/business/components/CategoryCardList.vue index 96bb608..9aaf0b0 100644 --- a/src/views/business/components/CategoryCardList.vue +++ b/src/views/business/components/CategoryCardList.vue @@ -89,11 +89,22 @@ const goDetail = (id) => { business: `/business/insight/detail/${id}`, // 行业洞察详情页 policy: `/business/legal/policy/detail/${id}`, // 法律法规-政策解读详情页 }; - if(path[props.type]){ - router.push(path[props.type]); - }else{ - console.log('无此类型详情页路由跳转配置:'+props.type); + + if (path[props.type]) { + http(`/api/article/${id}`, {}, 'get').then(res => { + router.push(path[props.type]); + }).catch(err => { + if (err.status == 1001) { + showToast('无权限阅读,或会员已过期,请先订阅会员'); + // placeholder.value = '无权限阅读,或会员已过期,请先订阅会员'; + } + }); + + // router.push(path[props.type]); + } else { + console.log('无此类型详情页路由跳转配置:' + props.type); } + }; diff --git a/src/views/business/insight/list.vue b/src/views/business/insight/list.vue index 767b956..8517ecd 100644 --- a/src/views/business/insight/list.vue +++ b/src/views/business/insight/list.vue @@ -1,11 +1,6 @@