Commit d14f9c98 authored by 陈前坚's avatar 陈前坚

perf: 修改密码

parent c0901f32
......@@ -59,10 +59,13 @@ const Login = props => {
}
}
if (userMode === USER_MODE.COMMON) {
const authority = [AUTHORITY.LOGIN, AUTHORITY.COMMON];
setAuthority(authority);
setAuth(authority);
history.push(`/userCenter/UserManage`);
// const authority = [AUTHORITY.LOGIN, AUTHORITY.COMMON];
// setAuthority(authority);
// setAuth(authority);
// history.push(`/userCenter/UserManage`);
notification.warning({
message: msg || '没有权限!',
});
}
} else {
notification.warning({
......
......@@ -496,7 +496,7 @@ const UserManage = () => {
const changePassword = record => {
setPasswordVisible(true);
passwordForm.setFieldsValue({
oldpassword: record.password,
oldPassword: record.password,
newPassword: '',
passwordConfirm: '',
});
......@@ -867,7 +867,7 @@ const UserManage = () => {
});
// 提交-修改密码
const submitChangePassword = () => {
const password = passwordForm.getFieldValue('password');
const oldPassword = passwordForm.getFieldValue('oldPassword');
const newPassword = passwordForm.getFieldValue('newPassword');
const passwordConfirm = passwordForm.getFieldValue('passwordConfirm');
if (
......@@ -877,14 +877,13 @@ const UserManage = () => {
newPassword.length >= 6 &&
newPassword === passwordConfirm
) {
updateUserPassword(
currentUser.userID,
password,
newPassword,
passwordConfirm,
)
updateUserPassword({
UserId: +currentUser.userID,
OldPassWord: oldPassword,
NewPassWord: newPassword,
})
.then(res => {
if (res.success) {
if (res.code === 0) {
setPasswordVisible(false);
notification.success({
message: '提交成功',
......@@ -1404,7 +1403,7 @@ const UserManage = () => {
cancelText="取消"
>
<Form form={passwordForm} labelCol={{ span: 4 }}>
<Form.Item name="oldpassword" label="原始密码">
<Form.Item name="oldPassword" label="原始密码">
<Input disabled />
</Form.Item>
<Form.Item
......
......@@ -110,20 +110,8 @@ export const addToOrgs = (userIDs, orgIDs, newOrgID) =>
newGroupId: newOrgID,
});
export const updateUserPassword = (
userID,
oldpassword,
newPassword,
passwordConfirm,
) =>
get(`/Cityinterface/rest/services/OMS.svc/U_UpdatePassword`, {
_version: 9999,
_dc: Date.now(),
userID,
oldpassword,
newPassword,
passwordConfirm,
});
export const updateUserPassword = params =>
post(`${PUBLISH_SERVICE}/UserCenter/UpdateUserPassword`, params);
export const editUser = (userID, loginName, userName, phone, email) =>
get(`/Cityinterface/rest/services/OMS.svc/U_EditUser`, {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment