Commit d46b0961 authored by 皮倩雯's avatar 皮倩雯

fix: '加密方式'

parent b366467d
Pipeline #81675 canceled with stages
......@@ -94,6 +94,8 @@
"@wangeditor/editor-for-react": "^1.0.6",
"@wisdom-cesium/cesium": "1.1.12",
"@wisdom-cesium/krpano": "^1.0.29-60",
"@wisdom-utils/components": "0.1.337",
"@wisdom-utils/utils": "0.1.377",
"@wisdom-map/amap": "1.1.0-beta.56",
"@wisdom-map/arcgismap": "1.4.0-198",
"@wisdom-map/basemap": "1.1.0-31",
......
......@@ -290,7 +290,7 @@ const BaseConfig = (props, ref) => {
}
}
}}
options={[1, 2, 3].map(province => ({
options={[1, 2, 3, 6, 12].map(province => ({
label: province,
value: province,
}))}
......
/* eslint-disable no-unneeded-ternary */
import React, { useEffect, useState } from 'react';
import { Modal, Form, Input, notification, message, TreeSelect, Select } from 'antd';
import {
addUser,
GetUserRelationListNew,
GetPasswordRegularization,
SysConfiguration,
} from '@/services/userManage/api';
import { encipher } from '@wisdom-utils/utils/lib/helpers';
import classNames from 'classnames';
import sha1 from 'sha1';
import { ok } from '../../../assets/images/icons/ok.svg';
......@@ -24,13 +27,23 @@ const AddUserModal = props => {
const [treeData, setTreeData] = useState([]);
const [passwordLevel, setPasswordLevel] = useState(''); // 密码等级
const [rules, setRules] = useState();
const [pasType, setPasType] = useState('');
const onChange = newValue => {
console.log('onChange ', value);
setValue(newValue);
};
const passwordType = () => {
SysConfiguration().then(res => {
if (res.code === 0) {
setPasType(res.data);
}
});
};
useEffect(() => {
if (visible) {
passwordType();
getPasswordRule();
addUserForm.resetFields();
getEmptyRoleList();
......@@ -148,7 +161,7 @@ const AddUserModal = props => {
OUID: orgID.id,
loginName,
userName,
password: sha1(password).toUpperCase(),
password: encipher(password, pasType ? pasType : '').toUpperCase(),
phone,
email,
})
......
......@@ -3,8 +3,14 @@ import React, { useEffect, useState } from 'react';
import { Modal, Form, Input, notification, message, Divider } from 'antd';
import voca from 'voca';
import classNames from 'classnames';
import { editUser, updateUserPassword, GetPasswordRegularization } from '@/services/userManage/api';
import {
editUser,
updateUserPassword,
GetPasswordRegularization,
SysConfiguration,
} from '@/services/userManage/api';
import sha1 from 'sha1';
import { encipher } from '@wisdom-utils/utils/lib/helpers';
import styles from './AddUserModal.less';
const ChangePasswordModal = props => {
......@@ -20,10 +26,12 @@ const ChangePasswordModal = props => {
const [newPasswordLevel, setNewPasswordLevel] = useState('');
const [passwordConfirmLevel, setPasswordConfirmLevel] = useState('');
const [rules, setRules] = useState();
const [pasType, setPasType] = useState('');
useEffect(() => {
if (visible) {
getPasswordRule();
passwordType();
editUserForm.setFieldsValue({
loginName: voca.stripTags(currentUser.loginName),
userName: voca.stripTags(currentUser.userName),
......@@ -41,6 +49,14 @@ const ChangePasswordModal = props => {
}
}, [visible]);
const passwordType = () => {
SysConfiguration().then(res => {
if (res.code === 0) {
setPasType(res.data);
}
});
};
const getPasswordRule = () => {
GetPasswordRegularization().then(res => {
if (res.code === 0) {
......@@ -119,7 +135,7 @@ const ChangePasswordModal = props => {
updateUserPassword({
UserId: +currentUser.userId,
OldPassWord: oldPassword,
NewPassWord: sha1(newPassword).toUpperCase(),
NewPassWord: encipher(newPassword, pasType ? pasType : '').toUpperCase(),
})
.then(res => {
if (res.code === 0) {
......
......@@ -194,5 +194,7 @@ export const ChangeSMSState = params => get(`${PUBLISH_SERVICE}/UserCenter/Chang
export const GetPasswordRegularization = params =>
get(`${PUBLISH_SERVICE}/UserCenter/GetPasswordRegularization`, params);
export const SysConfiguration = params =>
get(`/PandaCore/GCK/Common/SysConfiguration?moduleName=登录加密`, params);
// export const DeleteOUNew = params =>
// get(`${PUBLISH_SERVICE}/UserCenter/DeleteOU`, params)
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