Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linweijiong
jinfa-platform
Commits
e51684da
Commit
e51684da
authored
Mar 30, 2021
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加移动端资讯详情和app介绍页的路由权限
parent
040ae495
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
11 deletions
+14
-11
router.ts
config/router.ts
+8
-8
app.tsx
src/app.tsx
+3
-0
mobileDetail.tsx
src/pages/lxMall/information/mobileDetail.tsx
+3
-3
No files found.
config/router.ts
View file @
e51684da
...
...
@@ -38,14 +38,6 @@ const router = [
]
},
{
// 移动端资讯详情
path
:
'/information/mobile/detail/:id'
,
name
:
'infomationMobileDetail'
,
key
:
'infomationMobileDetail'
,
hide
:
true
,
component
:
'@/pages/lxMall/information/mobileDetail'
,
},
{
// app介绍页
path
:
'/app/introduce'
,
name
:
'appIntroduce'
,
...
...
@@ -53,6 +45,14 @@ const router = [
hide
:
true
,
component
:
'@/pages/appIntroduce'
,
},
{
// 移动端资讯详情
path
:
'/information/mobile/detail'
,
name
:
'infomationMobileDetail'
,
key
:
'infomationMobileDetail'
,
hide
:
true
,
component
:
'@/pages/lxMall/information/mobileDetail'
,
},
memberCenterRoute
,
...
mallRoute
,
{
...
...
src/app.tsx
View file @
e51684da
...
...
@@ -34,6 +34,7 @@ const ichannelRootRoute = GlobalConfig.ichannelRootRoute // 渠道自有商城
// 商城相关路由
const
mallLists
=
[
'/'
,
'/app/introduce'
,
'/commodity'
,
'/commodity/search'
,
'/commodity/detail'
,
...
...
@@ -42,6 +43,7 @@ const mallLists = [
'/shops'
,
'/infomation'
,
'/infomation/detail'
,
'/information/mobile/detail'
,
'/infomation/search'
,
'/purchaseOrder'
,
'/order'
,
...
...
@@ -131,6 +133,7 @@ export function patchRoutes({ routes }: IRoutes) {
*/
export
function
render
(
oldRender
:
Function
)
{
const
{
pathname
}
=
history
.
location
// 白名单页面不进行权限校验
if
(
whiteLists
.
includes
(
pathname
))
{
oldRender
()
...
...
src/pages/lxMall/information/mobileDetail.tsx
View file @
e51684da
...
...
@@ -2,13 +2,13 @@ import React, { useEffect, useState } from 'react'
import
{
Helmet
}
from
'umi'
import
moment
from
'moment'
import
{
PublicApi
}
from
'@/services/api'
import
{
RouteChildren
Props
}
from
'react-router'
// import { RouteChildrenProps, Route
Props } from 'react-router'
import
{
GetManageContentInformationFindByIdResponse
}
from
'@/services/PassApi'
import
{
numFormat
}
from
'@/utils/numberFomat'
import
styles
from
'./mobileDetail.less'
const
MobileDetail
:
React
.
FC
<
RouteChildrenProps
<
{
id
:
string
}
>>
=
(
props
)
=>
{
const
{
id
}
=
props
.
match
.
params
const
MobileDetail
=
(
props
)
=>
{
const
{
query
:
{
id
}
}
=
props
.
location
const
[
newsDetail
,
setNewsDetail
]
=
useState
<
GetManageContentInformationFindByIdResponse
>
()
const
[
title
,
setTitle
]
=
useState
<
string
>
(
'资讯详情'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment