mirror of
https://github.com/YMFE/yapi.git
synced 2025-02-23 13:59:28 +08:00
fix: ldap登陆用户信息可修改
This commit is contained in:
parent
4c10a4ea78
commit
35c2e0200b
@ -9,7 +9,7 @@ import { connect } from 'react-redux'
|
|||||||
@connect(state => {
|
@connect(state => {
|
||||||
return {
|
return {
|
||||||
curUid: state.user.uid,
|
curUid: state.user.uid,
|
||||||
userType: state.user.type,
|
userType: state.user.type,
|
||||||
curRole: state.user.role
|
curRole: state.user.role
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
@ -67,6 +67,7 @@ class Profile extends Component {
|
|||||||
getUserInfo = (id) => {
|
getUserInfo = (id) => {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
const { curUid } = this.props;
|
const { curUid } = this.props;
|
||||||
|
|
||||||
axios.get('/api/user/find?id=' + id).then((res) => {
|
axios.get('/api/user/find?id=' + id).then((res) => {
|
||||||
_this.setState({
|
_this.setState({
|
||||||
userinfo: res.data.data,
|
userinfo: res.data.data,
|
||||||
@ -168,6 +169,7 @@ class Profile extends Component {
|
|||||||
let _userinfo = this.state._userinfo;
|
let _userinfo = this.state._userinfo;
|
||||||
let roles = { admin: '管理员', member: '会员' };
|
let roles = { admin: '管理员', member: '会员' };
|
||||||
let userType = "";
|
let userType = "";
|
||||||
|
console.log("userinfo", userinfo)
|
||||||
if (this.props.userType === "third") {
|
if (this.props.userType === "third") {
|
||||||
userType = false;
|
userType = false;
|
||||||
} else if (this.props.userType === "site") {
|
} else if (this.props.userType === "site") {
|
||||||
|
@ -144,7 +144,7 @@ class userController extends baseController {
|
|||||||
email: result.email,
|
email: result.email,
|
||||||
add_time: result.add_time,
|
add_time: result.add_time,
|
||||||
up_time: result.up_time,
|
up_time: result.up_time,
|
||||||
type: 'site',
|
type: 'third',
|
||||||
study: result.study
|
study: result.study
|
||||||
}, 0, 'logout success...');
|
}, 0, 'logout success...');
|
||||||
}
|
}
|
||||||
|
@ -62,6 +62,7 @@ exports.ldapQuery = (username, password) => {
|
|||||||
});
|
});
|
||||||
// 查询结束
|
// 查询结束
|
||||||
search.on('end', () => {
|
search.on('end', () => {
|
||||||
|
|
||||||
if (users.length > 0) {
|
if (users.length > 0) {
|
||||||
client.bind(users[0], password, (e) => {
|
client.bind(users[0], password, (e) => {
|
||||||
if (e) {
|
if (e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user