Commit d038ac70 authored by 邓超's avatar 邓超

fix: 修改所有密码不用明文传入

parent 3774a9e3
Pipeline #62320 passed with stages
......@@ -225,7 +225,7 @@ const InitDataBase = props => {
ip: obj.ip,
dbName: obj.dbName,
userName: obj.userName,
password: obj.password,
password: btoa(obj.password),
})
.then(resnew => {
setCardLoading(false);
......@@ -268,7 +268,7 @@ const InitDataBase = props => {
ip: obj.ip,
dbName: obj.dbName,
userName: obj.userName,
password: obj.password,
password: btoa(obj.password),
// Type:"SQLServer",
// name:obj.dbName,
})
......@@ -301,7 +301,7 @@ const InitDataBase = props => {
// _version: 9999,
// _dc: Date.now(),
userName: params.userName || '',
password: params.password || '',
password: btoa(params.password) || '',
ip: params.ip || '',
})
.then(res => {
......@@ -384,7 +384,7 @@ const InitDataBase = props => {
ip: obj.ip,
dbName: obj.dbName,
userName: obj.userName,
password: obj.password,
password: btoa(obj.password),
desc,
})
.then(res => {
......@@ -430,7 +430,7 @@ const InitDataBase = props => {
const GetDb = () => {
let obj = form.getFieldsValue();
GetDbProduct({ ...obj }).then(res => {
GetDbProduct({ ...obj, password: btoa(obj.password) }).then(res => {
if (res.code === 0) {
console.log(res.data);
if (res.data.Product) {
......@@ -472,7 +472,7 @@ const InitDataBase = props => {
setInitLoading(true);
let obj = form.getFieldsValue();
let req1 = GetProductList();
let req2 = GetDbProduct({ ...obj });
let req2 = GetDbProduct({ ...obj, password: btoa(obj.password) });
Promise.all([req1, req2])
.then(res => {
if (res[1].code !== 0 || res[0].code !== 0) {
......@@ -619,7 +619,8 @@ const InitDataBase = props => {
setInitVisible(true);
doInitLog();
if (dbExists) {
InitEditDataBase({ ...obj, productSetting, license: j }).then(res => {
InitEditDataBase({ ...obj, productSetting, license: j, password: btoa(obj.password) }).then(
res => {
setInitLoading(false);
if (res.code === 0) {
notification.success({
......@@ -634,7 +635,8 @@ const InitDataBase = props => {
description: res.msg,
});
}
});
},
);
return;
}
InitAddDataBase({ ...obj, productSetting, license: j }).then(res => {
......
......@@ -18,6 +18,7 @@ const AddModal = props => {
AddConnString({
type: 'mysql',
...obj,
password: btoa(obj.password),
})
.then(res => {
setLoading(false);
......@@ -53,6 +54,7 @@ const AddModal = props => {
type: 'mysql',
...obj,
oldName: formObj.name,
password: btoa(obj.password),
})
.then(res => {
setLoading(false);
......
......@@ -18,6 +18,7 @@ const AddModal = props => {
AddConnString({
...obj,
type: 'oracle',
password: btoa(obj.password),
})
.then(res => {
setLoading(false);
......@@ -53,6 +54,7 @@ const AddModal = props => {
type: 'oracle',
...obj,
oldName: formObj.name,
password: btoa(obj.password),
})
.then(res => {
setLoading(false);
......
......@@ -18,6 +18,7 @@ const AddModal = props => {
AddConnString({
...obj,
type: 'sqlserver',
password: btoa(obj.password),
})
.then(res => {
setLoading(false);
......@@ -53,6 +54,7 @@ const AddModal = props => {
...obj,
oldName: formObj.name,
type: 'sqlserver',
password: btoa(obj.password),
})
.then(res => {
setLoading(false);
......
......@@ -67,7 +67,7 @@ const AppendModal = props => {
const getProduct = () => {
setLoading(true);
GetLicenseDifference(value).then(res => {
GetLicenseDifference({ ...value, password: btoa(value.password) }).then(res => {
setLoading(false);
if (res.code === 0) {
let aab = [];
......
......@@ -308,7 +308,7 @@ const DatabaseInitialization = props => {
ip: resdata.data.ip,
dbName: resdata.data.dbName,
userName: resdata.data.userName,
password: resdata.data.password,
password: btoa(resdata.data.password),
}).then(res => {
if (res.code === 0) {
if (res.data.DbInfo.ip == '127.0.0.1' || !res.data.DbInfo.ip) {
......@@ -411,7 +411,7 @@ const DatabaseInitialization = props => {
const GetDbChangeFirst = kk => {
let obj = form.getFieldsValue();
GetDbProduct({ ...obj }).then(res => {
GetDbProduct({ ...obj, password: btoa(obj.password) }).then(res => {
setCardLoading(false);
if (res.code === 0) {
if (res.data.IsAuthorize) {
......@@ -461,7 +461,7 @@ const DatabaseInitialization = props => {
const GetDbChange = e => {
let obj = form.getFieldsValue();
GetDbProduct({ ...obj }).then(res => {
GetDbProduct({ ...obj, password: btoa(obj.password) }).then(res => {
setCardLoading(false);
if (res.code === 0) {
if (res.data.IsAuthorize) {
......@@ -563,7 +563,7 @@ const DatabaseInitialization = props => {
const GetDbChangeAppend = () => {
let obj = form.getFieldsValue();
GetDbProduct({ ...obj }).then(res => {
GetDbProduct({ ...obj, password: btoa(obj.password) }).then(res => {
setCardLoading(false);
if (res.code === 0) {
if (res.data.Product) {
......@@ -643,7 +643,7 @@ const DatabaseInitialization = props => {
handleShowModal('initVisible', false);
setInitVisible(true);
doInitLog();
NewInitAddDataBase({ ...obj, productSetting }).then(res => {
NewInitAddDataBase({ ...obj, productSetting, password: btoa(obj.password) }).then(res => {
if (res.code === 0) {
GetDbChangeAppend();
setMsg('未检测到可用License');
......@@ -697,7 +697,7 @@ const DatabaseInitialization = props => {
setInitVisible(true);
doInitLog();
let obj = form.getFieldsValue();
InitEditDataBase(obj).then(res => {
InitEditDataBase({ ...obj, password: btoa(obj.password) }).then(res => {
if (res.code === 0) {
GetDbChangeAppend();
setMsg('未检测到可用License');
......@@ -798,7 +798,7 @@ const DatabaseInitialization = props => {
// setKeepValue([]);
setProduct([]);
setCardLoading(true);
GetProductList({ ...obj }).then(res => {
GetProductList({ ...obj, password: btoa(obj.password) }).then(res => {
if (res.code === 0) {
console.log(res.data);
GetDbChange();
......@@ -830,7 +830,7 @@ const DatabaseInitialization = props => {
const onCheckLaster = aa => {
// 此时有授权码才能进入
let obj = form.getFieldsValue();
CheckDatabaseIsExist({ ...obj }).then(res => {
CheckDatabaseIsExist({ ...obj, password: btoa(obj.password) }).then(res => {
setCardLoading(false);
if (res.code == 0) {
setDataValue(form.getFieldsValue());
......@@ -870,7 +870,7 @@ const DatabaseInitialization = props => {
const Submit = () => {
let obj = form.getFieldsValue();
if (obj.ip && obj.userName && obj.password && obj.dbName) {
GetProductList({ ...obj }).then(res => {
GetProductList({ ...obj, password: btoa(obj.password) }).then(res => {
setCardLoading(false);
if (res.code === 0) {
GetDbChange(1);
......@@ -900,7 +900,7 @@ const DatabaseInitialization = props => {
const findCheck = aa => {
let obj = form.getFieldsValue();
CheckDatabaseIsExist({ ...obj }).then(res => {
CheckDatabaseIsExist({ ...obj, password: btoa(obj.password) }).then(res => {
setCardLoading(false);
if (res.code === 0) {
setDataValue(form.getFieldsValue());
......@@ -947,7 +947,7 @@ const DatabaseInitialization = props => {
const findCheck1 = aa => {
let obj = form.getFieldsValue();
CheckDatabaseIsExist({ ...obj }).then(res => {
CheckDatabaseIsExist({ ...obj, password: btoa(obj.password) }).then(res => {
setCardLoading(false);
if (res.code === 0) {
setDataValue(form.getFieldsValue());
......
......@@ -74,7 +74,7 @@ const IotConfig = () => {
const [switchStatus, setSwitchStatus] = useState(true);
const [dbStatus, setDbStatus] = useState(''); // 数据库状态
const [buStatus, setBuStatus] = useState(''); // 按钮状态
const [keep, setKeep] = useState('')
const [keep, setKeep] = useState('');
useEffect(() => {
HealthCheck().then(res => {
......@@ -100,11 +100,11 @@ const IotConfig = () => {
const getCurrentConfig = () => {
GetDataBaseConfig().then(res => {
if (res.code === 0) {
GetDbProduct(res.data).then(ress => {
GetDbProduct({ ...res.data, password: btoa(res.data.password) }).then(ress => {
console.log(ress.data.Project);
if (ress.data.Project.length > 0) {
console.log(ress.data.Project[ress.data.Project.length - 1].projectName);
setKeep(ress.data.Project[ress.data.Project.length - 1].projectName)
setKeep(ress.data.Project[ress.data.Project.length - 1].projectName);
}
});
setCurrentDataBase(res.data);
......@@ -285,7 +285,7 @@ const IotConfig = () => {
pwd: currentDataBase.password,
dataBaseName: currentDataBase.dbName,
siteCode: currentSiteInfo,
name:keep,
name: keep,
}).then(res => {
setLoading(false);
if (res.success) {
......@@ -463,8 +463,7 @@ const IotConfig = () => {
<span style={{ marginLeft: '14px' }}>{`${currentDataBase.ip}/${
currentDataBase.dbName
}`}</span>
{show3==='none'?<></>: <span>({dbStatus})</span>}
{show3 === 'none' ? <></> : <span>({dbStatus})</span>}
</Form.Item>
<Form.Item label="加载进度" style={{ marginLeft: '65px' }}>
<div style={{ width: 200, marginBottom: '30px' }}>
......
......@@ -39,7 +39,7 @@ const MessageConfig = () => {
messAddress: values.messageAddress,
sqlServerIP: currentDataBase.ip,
loginName: currentDataBase.userName,
password: currentDataBase.password,
password: btoa(currentDataBase.password),
sqlName: currentDataBase.dbName,
siteCode: currentSiteInfo,
}).then(res => {
......@@ -72,7 +72,7 @@ const MessageConfig = () => {
messAddress: CurrentAddress,
sqlServerIP: CurrentDataBase.ip,
loginName: CurrentDataBase.userName,
password: CurrentDataBase.password,
password: btoa(CurrentDataBase.password),
sqlName: CurrentDataBase.dbName,
siteCode: currentSiteInfo,
}).then(res => {
......
......@@ -34,7 +34,7 @@ const Login = props => {
console.log(values); // eg:{userName: "123", password: "123"}
const { userName: loginName, password } = values;
setLoading(true);
OMSLogin(loginName, password, 'CivManage')
OMSLogin(loginName, sha1(password).toUpperCase(), 'CivManage')
.then(result => {
const { msg } = result;
......
......@@ -2,6 +2,7 @@ import React, { useEffect, useState } from 'react';
import { Modal, Form, Input, notification, message, TreeSelect } from 'antd';
import { addUser, GetUserRelationListNew } from '@/services/userManage/api';
import classNames from 'classnames';
import sha1 from 'sha1';
import { ok } from '../../../assets/images/icons/ok.svg';
import styles from './AddUserModal.less';
const { SHOW_CHILD } = TreeSelect;
......@@ -120,7 +121,14 @@ const AddUserModal = props => {
(phone === '' || isPhone.test(phone)) &&
(email === '' || isEmail.test(email))
) {
addUser({ OUID: orgID.id, loginName, userName, password, phone, email })
addUser({
OUID: orgID.id,
loginName,
userName,
password: sha1(password).toUpperCase(),
phone,
email,
})
.then(res => {
if (res.code === 0) {
addUserForm.resetFields();
......
......@@ -2,6 +2,7 @@
import React, { useEffect, useState } from 'react';
import { Modal, Form, Input, notification, message } from 'antd';
import { updateUserPassword } from '@/services/userManage/api';
import sha1 from 'sha1';
import classNames from 'classnames';
import styles from './AddUserModal.less';
......@@ -40,7 +41,7 @@ const ChangePasswordModal = props => {
updateUserPassword({
UserId: +currentUser.userID,
OldPassWord: oldPassword,
NewPassWord: newPassword,
NewPassWord: sha1(newPassword).toUpperCase(),
})
.then(res => {
if (res.code === 0) {
......
......@@ -29,14 +29,14 @@ export const getConnRecordNew = params => get(`${PUBLISH_SERVICE}/DBManager/GetC
// export const saveConnection = params =>
// get(`${CITY_SERVICE}/OMS.svc/S_SaveConnection`, params);
export const saveConnectionNew = params =>
get(`${PUBLISH_SERVICE}/DBManager/SaveConnection`, params);
post(`${PUBLISH_SERVICE}/DBManager/SaveConnection`, params);
// 获取数据库列表
// export const getDataBaseList = params =>
// get(`${CITY_SERVICE}/OMS.svc/S_GetDataBaseList`, params);
export const getDataBaseList = params =>
get(`${PUBLISH_SERVICE}/DBManager/getDataBaseList`, params);
post(`${PUBLISH_SERVICE}/DBManager/getDataBaseList`, params);
// 数据库初始化
// export const initDBv4 = params =>
......@@ -47,7 +47,7 @@ export const initDBv4new = params => get(`${PUBLISH_SERVICE}/DBManager/InitDB`,
// export const updateConnDesc = params =>
// get(`${CITY_SERVICE}/OMS.svc/S_UpdateConnDesc`, params);
export const updateConnDescNew = params =>
get(`${PUBLISH_SERVICE}/DBManager/UpdateConnDesc`, params);
post(`${PUBLISH_SERVICE}/DBManager/UpdateConnDesc`, params);
// 获取日志
// export const getInitDBLog = params =>
......@@ -178,9 +178,9 @@ export const editMySQLConnString = params =>
// 获取数据库链接字符串
export const GetConnString = params => get(`${PUBLISH_SERVICE}/DBManager/GetConnString`, params);
// 添加数据库链接字符串
export const AddConnString = params => get(`${PUBLISH_SERVICE}/DBManager/AddConnString`, params);
export const AddConnString = params => post(`${PUBLISH_SERVICE}/DBManager/AddConnString`, params);
// 编辑数据库链接字符串
export const EditConnString = params => get(`${PUBLISH_SERVICE}/DBManager/EditConnString`, params);
export const EditConnString = params => post(`${PUBLISH_SERVICE}/DBManager/EditConnString`, params);
// 删除数据库连接
export const DeleteConnString = params =>
get(`${PUBLISH_SERVICE}/DBManager/DeleteConnString`, params);
......
......@@ -2,8 +2,8 @@
* @Description:
* @Author: leizhe
* @Date: 2022-01-13 17:26:14
* @LastEditTime: 2022-07-08 17:45:40
* @LastEditors: leizhe
* @LastEditTime: 2022-10-24 14:41:23
* @LastEditors: dengchao 754083046@qq.com
*/
import { get, post, PUBLISH_SERVICE, CITY_SERVICE, PandaCore } from '@/services/index';
......@@ -36,7 +36,7 @@ export const DepositServiceEnable = param => post(`/api/DB/DepositServiceEnable`
export const GetMessageConfigInfo = param =>
get(`${PUBLISH_SERVICE}/HostManager/GetMessageConfigInfo`, param);
export const ConnectMessPlatform = param =>
get(`${PUBLISH_SERVICE}/HostManager/ConnectMessagePlatform`, param);
post(`${PUBLISH_SERVICE}/HostManager/ConnectMessagePlatform`, param);
export const SaveSystemInfo = param => get(`${PUBLISH_SERVICE}/HostManager/SaveSystemInfo`, param);
// 代理服务器接口
......
......@@ -38,7 +38,7 @@ export const GetUserByKeyNew = params => get(`${PUBLISH_SERVICE}/UserCenter/GetU
* @param {*} param0
*/
export const addUser = ({ OUID, loginName, userName, password, phone, email }) =>
get(`${PUBLISH_SERVICE}/UserCenter/AddUser`, {
post(`${PUBLISH_SERVICE}/UserCenter/AddUser`, {
_version: 9999,
_dc: Date.now(),
OUID,
......@@ -160,7 +160,7 @@ export const GetOUTreeNew = params => get(`${PUBLISH_SERVICE}/UserCenter/GetOUTr
export const GetUserRelationListNew = params =>
get(`${PUBLISH_SERVICE}/UserCenter/GetUserRelationList`, params);
export const AddUserNew = params => get(`${PUBLISH_SERVICE}/UserCenter/AddUser`, params);
export const AddUserNew = params => post(`${PUBLISH_SERVICE}/UserCenter/AddUser`, params);
export const AddOUNew = params => get(`${PUBLISH_SERVICE}/UserCenter/AddOUNew`, 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