File tree Expand file tree Collapse file tree 12 files changed +48
-29
lines changed Expand file tree Collapse file tree 12 files changed +48
-29
lines changed Original file line number Diff line number Diff line change 52
52
"lodash.foreach" : " ^4.5.0" ,
53
53
"lodash.isundefined" : " ^3.0.1" ,
54
54
"lodash.map" : " ^4.6.0" ,
55
- "moment" : " ^2.24.0" ,
56
- "styled-components" : " ^4.2.1"
55
+ "moment" : " ^2.24.0"
57
56
}
58
57
}
Original file line number Diff line number Diff line change 8
8
withDefaultToPath ,
9
9
} from './utils'
10
10
11
+
12
+ console . log ( require . resolve ( '@alicloud/console-components-console-menu/lib/RoutableMenu' ) ) ;
13
+
11
14
const Menu = ( {
12
15
header,
13
16
title,
Original file line number Diff line number Diff line change @@ -2,9 +2,11 @@ import * as React from 'react';
2
2
import { storiesOf } from '@storybook/react' ;
3
3
import WindProRcAppLayout from '../src/index'
4
4
import "@alicloud/console-components/dist/wind.css" ;
5
- import { Router , Route } from 'dva/router'
5
+ import { Router , Route , matchPath } from 'dva/router'
6
6
import createBrowserHistory from 'history/createBrowserHistory'
7
7
8
+ window . matchPath = matchPath ;
9
+
8
10
const intl = key => key
9
11
10
12
const sidebar = {
@@ -47,7 +49,8 @@ const sidebar = {
47
49
key : '/test' ,
48
50
subNav : [ {
49
51
title : intl ( 'menu.title.profile.basic' ) ,
50
- key : '/basic-profile' ,
52
+ key : '/basic-profile?test=1' ,
53
+ activePathPatterns : [ '/basic-profile' ]
51
54
} , {
52
55
title : intl ( 'menu.title.profile.tab' ) ,
53
56
key : '/tab-profile/auth' ,
@@ -78,7 +81,7 @@ const sidebar = {
78
81
}
79
82
80
83
const App = ( { history} ) => {
81
- return < button onClick = { ( ) => history . push ( '/basic-profile' ) } > test</ button >
84
+ return < button onClick = { ( ) => history . push ( '/basic-profile?test=1 ' ) } > test</ button >
82
85
}
83
86
84
87
storiesOf ( 'WindProRcAppLayout' , module )
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @alicloud/xconsole-rc-description" ,
3
- "version" : " 1.0.0-beta.1 " ,
3
+ "version" : " 1.0.0-beta.2 " ,
4
4
"main" : " lib/index.js" ,
5
5
"module" : " es/index.js" ,
6
6
"license" : " MIT" ,
52
52
"dependencies" : {
53
53
"@alicloud/console-components-data-fields" : " ^1.0.4" ,
54
54
"@alicloud/console-components-info" : " ^1.0.4" ,
55
- "moment" : " ^2.24.0" ,
56
- "styled-components" : " ^5.0.1"
55
+ "moment" : " ^2.24.0"
57
56
}
58
57
}
Original file line number Diff line number Diff line change 48
48
"dependencies" : {
49
49
"@alicloud/console-components-page" : " ^1.0.5" ,
50
50
"lodash.map" : " ^4.6.0" ,
51
- "moment" : " ^2.24.0" ,
52
- "styled-components" : " ^5.0.1"
51
+ "moment" : " ^2.24.0"
53
52
}
54
53
}
Original file line number Diff line number Diff line change 50
50
},
51
51
"dependencies" : {
52
52
"@alicloud/console-components-page" : " ^1.0.5" ,
53
- "dva" : " ^2.4.1" ,
54
- "styled-components" : " ^4.4.0"
53
+ "dva" : " ^2.4.1"
55
54
}
56
55
}
Original file line number Diff line number Diff line change 50
50
},
51
51
"dependencies" : {
52
52
"@alicloud/console-components-page" : " ^1.0.5" ,
53
- "dva" : " ^2.4.1" ,
54
- "styled-components" : " ^4.4.0"
53
+ "dva" : " ^2.4.1"
55
54
}
56
55
}
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @alicloud/xconsole-service" ,
3
- "version" : " 1.0.0-beta.7 " ,
3
+ "version" : " 1.0.0-beta.8 " ,
4
4
"main" : " lib/index.js" ,
5
5
"module" : " es/index.js" ,
6
6
"license" : " MIT" ,
Original file line number Diff line number Diff line change 1
1
// export origin createService
2
- export { default as createService } from './createService'
2
+ export { default as createService } from './createService' ;
3
3
4
4
// export api Client
5
- export { default as createApiClient } from './client'
5
+ export { default as createApiClient } from './client' ;
6
6
7
7
// export consoleConfig utils
8
8
export {
@@ -14,13 +14,14 @@ export {
14
14
getCollina ,
15
15
getRiskInfo ,
16
16
getSecToken ,
17
- } from './utils'
17
+ setGetRegionIdFn ,
18
+ } from './utils' ;
18
19
19
20
// export reqeust
20
- export { default as request } from './request'
21
+ export { default as request } from './request' ;
21
22
22
23
// export interceptors
23
- export { default as consoleRequestInterceptor } from './interceptors/consoleRequestInterceptor'
24
- export { default as searchParamsInterceptor } from './interceptors/searchParamsInterceptor'
25
- export { default as consoleRiskInterceptor } from './interceptors/consoleRiskInterceptor'
26
- export { default as consoleResponseInterceptor } from './interceptors/consoleResponseInterceptor'
24
+ export { default as consoleRequestInterceptor } from './interceptors/consoleRequestInterceptor' ;
25
+ export { default as searchParamsInterceptor } from './interceptors/searchParamsInterceptor' ;
26
+ export { default as consoleRiskInterceptor } from './interceptors/consoleRiskInterceptor' ;
27
+ export { default as consoleResponseInterceptor } from './interceptors/consoleResponseInterceptor' ;
Original file line number Diff line number Diff line change @@ -54,6 +54,13 @@ export const getLocale = function() {
54
54
return getConsoleConfig ( LOCALE ) ;
55
55
} ;
56
56
57
+ let getRegionId = null ;
58
+
59
+ export const setGetRegionIdFn = ( fn ) => {
60
+ getRegionId = fn ;
61
+ }
62
+
57
63
export const getActiveRegionId = function ( ) {
58
- return Cookies . get ( REGION_COOKIE_NAME ) || Cookies . get ( CURRENT_REGION_COOKIE_NAME ) || 'cn-hangzhou' ;
59
- } ;
64
+ const regionIdFromCookie = Cookies . get ( REGION_COOKIE_NAME ) || Cookies . get ( CURRENT_REGION_COOKIE_NAME ) || 'cn-hangzhou' ;
65
+ return getRegionId ? getRegionId ( ) : Cookies . get ( REGION_COOKIE_NAME ) || Cookies . get ( CURRENT_REGION_COOKIE_NAME ) || 'cn-hangzhou' ;
66
+ } ;
You can’t perform that action at this time.
0 commit comments