|
@@ -5,11 +5,14 @@ import { create, test } from '../service'
|
|
|
|
|
|
import 'ace-builds/src-noconflict/mode-java'
|
|
|
import 'ace-builds/src-noconflict/theme-monokai'
|
|
|
+import { connect } from 'dva'
|
|
|
|
|
|
const formItemLayout = {
|
|
|
layout: 'vertical'
|
|
|
}
|
|
|
-
|
|
|
+@connect(({ user }) => ({
|
|
|
+ currentUser: user.currentUser
|
|
|
+}))
|
|
|
@Form.create()
|
|
|
class Add extends React.PureComponent {
|
|
|
state = {
|
|
@@ -24,8 +27,8 @@ class Add extends React.PureComponent {
|
|
|
if (!err) {
|
|
|
create({
|
|
|
...values,
|
|
|
- createUser: '马喆诚', // 创建人
|
|
|
- updateUser: '马喆诚' // 最后修改人
|
|
|
+ createUser: this.props.currentUser.name, // 创建人
|
|
|
+ updateUser: this.props.currentUser.name // 最后修改人
|
|
|
}).then(res => {
|
|
|
if (res.code === 0) {
|
|
|
this.setState({ ...values })
|