Skip to content

Commit 7728bcb

Browse files
committed
Bug Fixed
1 parent 7a89084 commit 7728bcb

File tree

9 files changed

+42
-47
lines changed

9 files changed

+42
-47
lines changed

reactjs/src/App.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ class App extends React.Component {
1818
<Route path="/tenants" component={Layout} />
1919
<Route path="/roles" component={Layout} />
2020
<Route path="/about" component={Layout} />
21-
<Route path="/login" component={Login } />
21+
<Route path="/login" component={Login } />
22+
<Route path="/" component={Login } />
2223
</Switch>
2324
)
2425
}

reactjs/src/scenes/Layout/index.tsx

Lines changed: 19 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -28,58 +28,45 @@ class LayoutComponent extends React.Component<any> {
2828
};
2929

3030
render() {
31-
return (
32-
<Layout style={{ minHeight: '100vh' }}>
31+
const {path} = this.props.match;
32+
33+
return <Layout style={{ minHeight: '100vh' }}>
3334
<Sider trigger={null} className={'sidebar'} width={256} collapsible collapsed={this.state.collapsed} onCollapse={this.onCollapse}>
34-
{this.state.collapsed ? (
35-
<Col style={{ textAlign: 'center', marginTop: 15, marginBottom: 10 }}>
35+
{this.state.collapsed ? <Col style={{ textAlign: 'center', marginTop: 15, marginBottom: 10 }}>
3636
<Avatar shape="square" style={{ height: 27, width: 64 }} src={AbpLogo} />
37-
</Col>
38-
) : (
39-
<Col style={{ textAlign: 'center', marginTop: 15, marginBottom: 10 }}>
37+
</Col> : <Col style={{ textAlign: 'center', marginTop: 15, marginBottom: 10 }}>
4038
<Avatar shape="square" style={{ height: 54, width: 128 }} src={AbpLogo} />
41-
</Col>
42-
)}
39+
</Col>}
4340

44-
<Menu theme="dark" mode="inline" defaultSelectedKeys={['1']}>
45-
<Menu.Item onClick={() => this.props.history.push('/dashboard')} key="1">
41+
<Menu theme="dark" mode="inline" defaultSelectedKeys={path}>
42+
<Menu.Item key={'/dashboard'} onClick={() => this.props.history.push('/dashboard')}>
4643
<Icon type="home" />
4744
<span>Home</span>
4845
</Menu.Item>
49-
<Menu.Item onClick={() => this.props.history.push('/tenants')} key="2">
46+
<Menu.Item key={'/tenants'} onClick={() => this.props.history.push('/tenants')}>
5047
<Icon type="appstore" />
5148
<span>Tenants</span>
5249
</Menu.Item>
53-
<Menu.Item onClick={() => this.props.history.push('/users')} key="3">
50+
<Menu.Item key={'/users'} onClick={() => this.props.history.push('/users')}>
5451
<Icon type="user" />
5552
<span>Users</span>
5653
</Menu.Item>
57-
<Menu.Item onClick={() => this.props.history.push('/roles')} key="4">
54+
<Menu.Item key={'/roles'} onClick={() => this.props.history.push('/roles')}>
5855
<Icon type="tags" />
5956
<span>Rules</span>
6057
</Menu.Item>
61-
<Menu.Item onClick={() => this.props.history.push('/about')} key="5">
58+
<Menu.Item key={'/about'} onClick={() => this.props.history.push('/about')}>
6259
<Icon type="info-circle" />
6360
<span>About</span>
6461
</Menu.Item>
65-
<SubMenu
66-
key="6"
67-
title={
68-
<span>
62+
<SubMenu key="6" title={<span>
6963
<Icon type="bars" />
7064
<span>Multi Level Menu</span>
71-
</span>
72-
}
73-
>
74-
<SubMenu
75-
key="7"
76-
title={
77-
<span>
65+
</span>}>
66+
<SubMenu key="7" title={<span>
7867
<Icon type="bars" />
7968
<span>ASP.NET Boilerplate</span>
80-
</span>
81-
}
82-
>
69+
</span>}>
8370
<Menu.Item key="8">
8471
<span>Home</span>
8572
</Menu.Item>
@@ -93,15 +80,10 @@ class LayoutComponent extends React.Component<any> {
9380
<span>Documents</span>
9481
</Menu.Item>
9582
</SubMenu>
96-
<SubMenu
97-
key="12"
98-
title={
99-
<span>
83+
<SubMenu key="12" title={<span>
10084
<Icon type="bars" />
10185
<span>ASP.NET Zero</span>
102-
</span>
103-
}
104-
>
86+
</span>}>
10587
<Menu.Item key="13">
10688
<span>Home</span>
10789
</Menu.Item>
@@ -139,8 +121,7 @@ class LayoutComponent extends React.Component<any> {
139121
Asp.Net Boilerplate - React ©2018 <a href="https://github.com/ryoldash/module-zero-core-template">Github Page</a>
140122
</Layout.Footer>
141123
</Layout>
142-
</Layout>
143-
);
124+
</Layout>;
144125
}
145126
}
146127

reactjs/src/scenes/Roles/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@ class Role extends React.Component<any> {
1919
};
2020

2121
async componentWillMount() {
22+
;
2223
await this.getAll();
2324
}
2425

2526
async getAll() {
27+
;
2628
await this.props.RoleStores.getAll({ maxResultCount: this.state.maxResultCount, skipCount: this.state.skipCount });
2729
}
2830
handleTableChange = (pagination: any) => {
@@ -45,7 +47,7 @@ class Role extends React.Component<any> {
4547
}
4648

4749
delete(input: EntityDto) {
48-
debugger;
50+
;
4951
this.props.RoleStores.delete(input);
5052
}
5153
public render() {

reactjs/src/scenes/Tenants/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class Tenant extends React.Component<any> {
4848
}
4949

5050
delete(input: EntityDto) {
51-
debugger;
51+
;
5252
this.props.TenantStores.delete(input);
5353
}
5454

reactjs/src/scenes/Users/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class Team extends React.Component<any> {
5656
}
5757

5858
delete(input: EntityDto) {
59-
debugger;
59+
;
6060
this.props.UserStores.delete(input);
6161
}
6262

reactjs/src/services/httpService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ const http = axios.create({
66
timeout: 30000,
77
headers: {
88
Authorization:
9-
'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1laWRlbnRpZmllciI6IjEiLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiYWRtaW4iLCJBc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Vps4nErOzEYscjofdQit0u1TGS38oqxtCU_8Dl5Hc',
1010
},
1111
});
1212

1313
http.interceptors.request.use(
1414
function(config) {
1515
if (!!abp.auth.getToken()) {
16-
config.headers.common['Authorization'] = 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1laWRlbnRpZmllciI6IjEiLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiYWRtaW4iLCJBc3BOZXQuSWRlbnRpdHkuU2VjdXJpdHlTdGFtcCI6IjExZjc0NjVkLTc1MmUtNGY0MS1jNzBkLTM5ZWExMTdiYTY0YyIsImh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vd3MvMjAwOC8wNi9pZGVudGl0eS9jbGFpbXMvcm9sZSI6IkFkbWluIiwic3ViIjoiMSIsImp0aSI6IjlhZWNjMzU3LWVjZTItNDBlYi05YzE4LWEzMDkxZjQyNGU2ZCIsImlhdCI6MTU0MjIyNjg5OCwibmJmIjoxNTQyMjI2ODk4LCJleHAiOjE1NDIzMTMyOTgsImlzcyI6IkFicFByb2plY3ROYW1lIiwiYXVkIjoiQWJwUHJvamVjdE5hbWUifQ.Ab6TGnDgiuNorkDhCON7YbMGr09dhA6WLYn1Xiyibx8';
16+
config.headers.common['Authorization'] = 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1laWRlbnRpZmllciI6IjEiLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiYWRtaW4iLCJBc3BOZXQuSWRlbnRpdHkuU2VjdXJpdHlTdGFtcCI6IjExZjc0NjVkLTc1MmUtNGY0MS1jNzBkLTM5ZWExMTdiYTY0YyIsImh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vd3MvMjAwOC8wNi9pZGVudGl0eS9jbGFpbXMvcm9sZSI6IkFkbWluIiwic3ViIjoiMSIsImp0aSI6ImRiM2E0Y2QwLTYxMDUtNDU2My05NmNiLTU4NDdkMzRlOWVjNiIsImlhdCI6MTU0MjM5MTYxNCwibmJmIjoxNTQyMzkxNjE0LCJleHAiOjE1NDI0NzgwMTQsImlzcyI6IkFicFByb2plY3ROYW1lIiwiYXVkIjoiQWJwUHJvamVjdE5hbWUifQ.knVps4nErOzEYscjofdQit0u1TGS38oqxtCU_8Dl5Hc';
1717
}
1818

1919
config.headers.common['.AspNetCore.Culture'] = abp.utils.getCookieValue('Abp.Localization.CultureName');

reactjs/src/services/role/roleService.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ class RoleService {
5252
return result.data;
5353
}
5454

55-
public async getAll(pagedFilterAndSortedRequest: PagedFilterAndSortedRequest): Promise<PagedResultDto<GetAllRoleOutput>> {
56-
57-
55+
public async getAll(pagedFilterAndSortedRequest: PagedFilterAndSortedRequest):
56+
Promise<PagedResultDto<GetAllRoleOutput>> {
57+
;
5858
var result = await http.get('services/app/Role/GetAll', { params: pagedFilterAndSortedRequest });
5959
console.log(result);
6060

reactjs/src/stores/BaseStores.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { EntityDto } from "src/services/dto/entityDto";
2+
3+
4+
5+
export default interface BaseStore<T> {
6+
7+
get: (entityDto:EntityDto) => T;
8+
}

reactjs/src/stores/roleStore.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,14 @@ this.roleForEdit=result;
5656
@action async get(entityDto:EntityDto) {
5757
var result = await roleService.get(entityDto);
5858
console.log(result);
59+
;
60+
this.roles=result.data.result;
5961

6062
}
6163

6264
@action async getAll(pagedFilterAndSortedRequest:PagedFilterAndSortedRequest){
6365

66+
;
6467
var result = await roleService.getAll(pagedFilterAndSortedRequest);
6568
console.log(result);
6669
this.roles=result;

0 commit comments

Comments
 (0)