Commit 4fee2922 authored by 邓超's avatar 邓超

fix: 数据库连接保存传入desc

parent 3c79a291
Pipeline #69190 passed with stages
...@@ -86,6 +86,7 @@ const InitDataBase = props => { ...@@ -86,6 +86,7 @@ const InitDataBase = props => {
const [keep, setKeep] = useState([]); const [keep, setKeep] = useState([]);
const [flag, setFlag] = useState(0); const [flag, setFlag] = useState(0);
const [keepData, setKeepData] = useState({}); const [keepData, setKeepData] = useState({});
const chooseDb = useRef({});
const key = CryptoJS.enc.Utf8.parse('1p2a3n4d5a6o7m8s9a10n1e2t3c4o5re'); //十六位十六进制数作为密钥 const key = CryptoJS.enc.Utf8.parse('1p2a3n4d5a6o7m8s9a10n1e2t3c4o5re'); //十六位十六进制数作为密钥
const iv = CryptoJS.enc.Utf8.parse('1234567890000000'); const iv = CryptoJS.enc.Utf8.parse('1234567890000000');
...@@ -254,12 +255,13 @@ const InitDataBase = props => { ...@@ -254,12 +255,13 @@ const InitDataBase = props => {
const onFinish = values => { const onFinish = values => {
setCardLoading(true); setCardLoading(true);
const obj = values; const obj = values;
console.log(chooseDb.current, 'obj');
saveConnectionNew({ saveConnectionNew({
ip: obj.ip, ip: obj.ip,
dbName: obj.dbName, dbName: obj.dbName,
userName: obj.userName, userName: obj.userName,
password: Encrypt(obj.password), password: Encrypt(obj.password),
desc: chooseDb.current.desc,
}) })
.then(resnew => { .then(resnew => {
setCardLoading(false); setCardLoading(false);
...@@ -361,6 +363,7 @@ const InitDataBase = props => { ...@@ -361,6 +363,7 @@ const InitDataBase = props => {
Object.keys(obj).forEach(k => { Object.keys(obj).forEach(k => {
obj[k] = item[k]; obj[k] = item[k];
}); });
chooseDb.current = item;
form.setFieldsValue({ ...obj, password: Decrypt(obj.password) }); form.setFieldsValue({ ...obj, password: Decrypt(obj.password) });
}; };
// 产品方案选择框回调 // 产品方案选择框回调
......
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