Skip to content

Commit fd3f5f8

Browse files
authored
Merge pull request #138 from dotnetcore/develop
release v2.4.1
2 parents 23c9b97 + 827b305 commit fd3f5f8

45 files changed

Lines changed: 305 additions & 128 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,23 @@
11
# 更新日志
22

3+
## v3.0.x
4+
### v3.0.0 (2019-11-15)
5+
3.0版本正式发布,支持.netcore 3.0,包括2.x最新版本的所有功能
6+
37
## v2.4.x
48

9+
### v2.4.1 (2019-11-15)
10+
11+
* **修改:** 修复同时使用Cookie和jwt登陆时报错的bug(不建议混合两种模式)
12+
13+
#### 前后端不分离模式
14+
* **修改:** 修复Combobox联动由于没有图表而报错的bug
15+
16+
#### React前后端分离模式
17+
* **新增:** 多语言支持
18+
* **修改:** 修复菜单地址bug
19+
* **修改:** 修复菜单管理,数去权限管理页面问题
20+
521
### v2.4.0 (2019-11-5)
622
本次更新为大版本更新,废弃了之前Session的模式,使用Jwt和cookie两种方式进行登陆认证。
723
框架目前支持Cookie和Jwt两种模式,继承BaseController和BaseApiController的控制器将默认支持Cookie模式。

demo/WalkingTec.Mvvm.Demo/Program.cs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using Microsoft.AspNetCore;
44
using Microsoft.AspNetCore.Builder;
55
using Microsoft.AspNetCore.Hosting;
6+
using Microsoft.AspNetCore.Mvc.Filters;
67
using Microsoft.Extensions.Configuration;
78
using Microsoft.Extensions.DependencyInjection;
89
using Microsoft.Extensions.Localization;
@@ -47,7 +48,7 @@ public static IWebHostBuilder CreateWebHostBuilder(string[] args)
4748
new DataPrivilegeInfo<School>("学校", y => y.SchoolName),
4849
new DataPrivilegeInfo<Major>("专业", y => y.MajorName)
4950
};
50-
x.AddFrameworkService(dataPrivilegeSettings: pris, webHostBuilderContext: hostingCtx);
51+
x.AddFrameworkService(dataPrivilegeSettings: pris, webHostBuilderContext: hostingCtx,CsSector:CSSelector);
5152
x.AddLayui();
5253
x.AddSwaggerGen(c =>
5354
{
@@ -80,5 +81,25 @@ public static IWebHostBuilder CreateWebHostBuilder(string[] args)
8081
})
8182
.UseUrls(globalConfig.ApplicationUrl);
8283
}
84+
85+
public static string CSSelector(ActionExecutingContext context)
86+
{
87+
var userinfo = (context.Controller as IBaseController)?.LoginUserInfo;
88+
if (userinfo == null)
89+
{
90+
return "default";
91+
}
92+
else
93+
{
94+
if (userinfo.ITCode.StartsWith("a"))
95+
{
96+
return "default";
97+
}
98+
else
99+
{
100+
return "default";
101+
}
102+
}
103+
}
83104
}
84105
}

demo/WalkingTec.Mvvm.Demo/appsettings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"PageMode": "Tab", //页面显示模式,Single或者Tab
1616
"TabMode": "Simple", //Tab页显示方式,Default或者Simple
1717
"IsFilePublic": true,
18+
"ErrorHandler": "/_Framework/Error",
1819
"Languages": "zh,en",
1920
"CorsOptions": {
2021
"EnableAll": true, //所有方法是否默认跨域

demo/WalkingTec.Mvvm.ReactDemo/ClientApp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.0.1",
44
"private": true,
55
"dependencies": {
6-
"@ant-design/pro-layout": "^4.5.16",
6+
"@ant-design/pro-layout": "4.6.2",
77
"ag-grid-community": "^21.2.1",
88
"ag-grid-enterprise": "^21.2.1",
99
"ag-grid-react": "^21.2.1",

demo/WalkingTec.Mvvm.ReactDemo/ClientApp/src/app/layout/antdPro/GlobalHeader/index.module.less

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
float: right;
4444
height: 100%;
4545
overflow: hidden;
46-
46+
display: flex;
4747
// color: #fff;
4848
.action {
4949
display: inline-block;
@@ -89,10 +89,12 @@
8989
background-color: #fff;
9090
border-radius: 4px;
9191
box-shadow: @shadow-1-down;
92+
9293
}
9394

9495
.userAvatar {
9596
display: inline-block;
97+
cursor: pointer;
9698
}
9799

98100
.dark {

demo/WalkingTec.Mvvm.ReactDemo/ClientApp/src/app/layout/antdPro/GlobalHeader/userMenu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export default class UserMenu extends React.Component<any, any> {
5454
@DialogFormDes({
5555
onFormSubmit(values) {
5656
return Request.ajax({
57-
url: "/api/_account/ChangePassword",
57+
url: "/api/_login/ChangePassword",
5858
method: "post",
5959
body: values
6060
}).toPromise()

demo/WalkingTec.Mvvm.ReactDemo/ClientApp/src/app/layout/antdPro/SettingDrawer/index.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -382,20 +382,20 @@ class SettingDrawer extends Component<SettingDrawerProps, SettingDrawerState> {
382382
onClose={this.togglerContent}
383383
placement="right"
384384
getContainer={getContainer}
385-
handler={
386-
<div
387-
className="ant-pro-setting-drawer-handle"
388-
onClick={this.togglerContent}
389-
>
390-
<Icon
391-
type={collapse ? 'close' : 'setting'}
392-
style={{
393-
color: '#fff',
394-
fontSize: 20,
395-
}}
396-
/>
397-
</div>
398-
}
385+
// handler={
386+
// <div
387+
// className="ant-pro-setting-drawer-handle"
388+
// onClick={this.togglerContent}
389+
// >
390+
// <Icon
391+
// type={collapse ? 'close' : 'setting'}
392+
// style={{
393+
// color: '#fff',
394+
// fontSize: 20,
395+
// }}
396+
// />
397+
// </div>
398+
// }
399399
style={{
400400
zIndex: 999,
401401
}}

demo/WalkingTec.Mvvm.ReactDemo/ClientApp/src/app/layout/antdPro/index.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { BasicLayout, GridContent } from '@ant-design/pro-layout';
22
import LayoutSpin from "components/other/LayoutSpin";
33
import GlobalConfig from 'global.config';
44
import lodash from 'lodash';
5-
import { action, toJS } from 'mobx';
5+
import { action, toJS, observable } from 'mobx';
66
import { observer } from 'mobx-react';
77
import * as React from 'react';
88
import { renderRoutes } from 'react-router-config';
@@ -13,12 +13,14 @@ import UserMenu from './GlobalHeader/userMenu';
1313
import TabsPages from './TabsPages';
1414
import SettingDrawer, { ContentWidth } from './SettingDrawer';
1515
import './style.less';
16+
import { Icon } from 'antd';
1617
// import { ConfigConsumer } from 'antd/lib/config-provider';
1718
// import { } from 'antd';
1819
// ConfigConsumer
1920
@observer
2021
export default class App extends React.Component<any> {
21-
static con
22+
@observable
23+
collapse = false;
2224
/**
2325
*settings 变更 事件
2426
*
@@ -66,6 +68,11 @@ export default class App extends React.Component<any> {
6668
}
6769
componentDidMount() {
6870
}
71+
@action.bound
72+
togglerContent() {
73+
this.collapse = !this.collapse;
74+
};
75+
6976
public render() {
7077
const settings = toJS(GlobalConfig.settings);
7178
const { language } = GlobalConfig;
@@ -78,6 +85,9 @@ export default class App extends React.Component<any> {
7885
rightContentRender={rightProps => (
7986
<RightContent {...rightProps} selectedLang={language} changeLang={this.changeLang} >
8087
<UserMenu {...rightProps} {...this.props} />
88+
<div className={`ant-pro-setting ${settings.navTheme} ${settings.layout}`} onClick={this.togglerContent}>
89+
<Icon type={ 'setting'} />
90+
</div>
8191
</RightContent>
8292
)}
8393
menuHeaderRender={(logo, title) => <Link to="/">{logo}{title}</Link>}
@@ -100,7 +110,7 @@ export default class App extends React.Component<any> {
100110
>
101111
{settings.tabsPage && settings.contentWidth !== "Fixed" ? <TabsPages {...this.props} /> : <MainContent {...this.props} contentWidth={settings.contentWidth} />}
102112
</BasicLayout>
103-
<SettingDrawer settings={settings} onSettingChange={this.onSettingChange} />
113+
<SettingDrawer collapse={this.collapse} onCollapseChange={this.togglerContent} settings={settings} onSettingChange={this.onSettingChange} />
104114
</>
105115
);
106116
}

demo/WalkingTec.Mvvm.ReactDemo/ClientApp/src/app/layout/antdPro/style.less

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,28 @@
77
font-size: 16px;
88
}
99
}
10+
.ant-pro-top-nav-header-menu{
11+
max-width: initial !important;
12+
}
13+
.ant-pro-setting {
14+
display: flex;
15+
align-items: center;
16+
justify-content: center;
17+
font-size: 16px;
18+
text-align: center;
19+
width: 40px;
20+
cursor: pointer;
21+
22+
&.dark {
23+
24+
&.sidemenu {
25+
color: rgba(0, 0, 0, 0.65);
26+
}
27+
&.topmenu {
28+
color: #fff;
29+
}
30+
}
31+
}
1032

1133
.ant-pro-sider-menu-sider.light .ant-pro-sider-menu-logo {
1234
box-shadow: none;
@@ -39,5 +61,4 @@
3961
font-size: 12px;
4062
}
4163
}
42-
}
43-
64+
}

demo/WalkingTec.Mvvm.ReactDemo/ClientApp/src/locale/en-US/action.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,6 @@ export default {
2222
'action.user.apiDocument':'API document',
2323
'action.user.changePassword':'Change Password',
2424
'action.user.logout':'Logout',
25+
'action.sys.refreshMenu': 'Refresh Menu',
26+
'action.privilege':'Privilege',
2527
};

0 commit comments

Comments
 (0)