File tree Expand file tree Collapse file tree 2 files changed +7
-40
lines changed
Expand file tree Collapse file tree 2 files changed +7
-40
lines changed Original file line number Diff line number Diff line change @@ -39,9 +39,13 @@ const Layout: React.FC<React.PropsWithChildren<Props>> = (props) => {
3939 } ;
4040
4141 const topicDetailRegx = / \/ t o p i c \/ ( [ a - f 0 - 9 ] ) { 24 } / g;
42+ const userDetailRegx = / \/ u s e r \/ ( .* ) / g;
4243
43- if ( location . pathname . match ( topicDetailRegx ) ) {
44- const topicBreadcrumbName = location . pathname . split ( '/' ) . pop ( ) ;
44+ if (
45+ location . pathname . match ( topicDetailRegx ) ||
46+ location . pathname . match ( userDetailRegx )
47+ ) {
48+ const currentBreadcrumbName = location . pathname . split ( '/' ) . pop ( ) ;
4549
4650 headerConfig = {
4751 title : null ,
@@ -56,30 +60,7 @@ const Layout: React.FC<React.PropsWithChildren<Props>> = (props) => {
5660 } ,
5761 {
5862 path : location . pathname ,
59- breadcrumbName : topicBreadcrumbName ,
60- } ,
61- ] ,
62- } ,
63- } ;
64- }
65-
66- if ( location . pathname . match ( / \/ u s e r \/ ( .* ) / g) ) {
67- const loginname = location . pathname . split ( '/' ) . pop ( ) ;
68-
69- headerConfig = {
70- title : null ,
71- breadcrumb : {
72- itemRender : ( route : { path : string ; breadcrumbName : string } ) => {
73- return < Link to = { route . path } > { route . breadcrumbName } </ Link > ;
74- } ,
75- routes : [
76- {
77- path : '/' ,
78- breadcrumbName : '主页' ,
79- } ,
80- {
81- path : location . pathname ,
82- breadcrumbName : loginname ,
63+ breadcrumbName : currentBreadcrumbName ,
8364 } ,
8465 ] ,
8566 } ,
Original file line number Diff line number Diff line change @@ -37,20 +37,6 @@ export const postTopic = async (data: {
3737 return request ( `${ BASE_URL } /api/v1/topics` , options ) ;
3838} ;
3939
40- export const postTopic = async ( data : {
41- title : string ;
42- tab : string ;
43- content : string ;
44- accesstoken : string ;
45- } ) => {
46- const options : any = {
47- method : 'POST' ,
48- data,
49- } ;
50-
51- return request ( `${ BASE_URL } /api/v1/topics` , options ) ;
52- } ;
53-
5440export const queryTopicDetail = async ( params : {
5541 id : string ;
5642 mdrender ?: boolean ;
You can’t perform that action at this time.
0 commit comments