Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivManage
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
CivManage
Commits
00afbc1a
Commit
00afbc1a
authored
May 17, 2023
by
皮倩雯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: '数据库初始化支持未使用过授权码的老数据库'
parent
8c77b278
Pipeline
#72485
passed with stages
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
74 additions
and
19 deletions
+74
-19
AppendModal.jsx
src/pages/database/databaseInitialization/AppendModal.jsx
+12
-2
DatabaseInitialization.jsx
...atabase/databaseInitialization/DatabaseInitialization.jsx
+59
-17
api.js
src/services/database/api.js
+3
-0
No files found.
src/pages/database/databaseInitialization/AppendModal.jsx
View file @
00afbc1a
...
...
@@ -16,7 +16,7 @@ import { GetLicenseDifference, InitEditDataBase, GetProductList } from '@/servic
import
New
from
'../../../assets/images/icons/new.png'
;
const
AppendModal
=
props
=>
{
const
{
callBackSubmit
=
()
=>
{},
visible
,
onCancel
,
value
,
keepHistroy
}
=
props
;
const
{
callBackSubmit
=
()
=>
{},
visible
,
onCancel
,
value
,
keepHistroy
,
appendType
}
=
props
;
const
[
data
,
setData
]
=
useState
([]);
const
[
allLength
,
setAllLength
]
=
useState
(
''
);
const
[
flag
,
setFlag
]
=
useState
();
...
...
@@ -191,7 +191,17 @@ const AppendModal = props => {
if
(
allValue
.
length
==
0
)
{
return
<
span
style=
{
{
color
:
'red'
}
}
>
license下产品已全被初始化,无需再次追加!!!
</
span
>;
}
return
<
span
style=
{
{
color
:
'rgb(24 144 255)'
}
}
>
是否确认追加!
</
span
>;
return
(
<
span
style=
{
{
color
:
'rgb(24 144 255)'
}
}
>
{
appendType
===
'yes'
?
(
<
div
style=
{
{
width
:
'150px'
}
}
>
当前数据库为非授权初始化数据库,是否使用授权码升级到授权码模式?
</
div
>
)
:
(
'是否确认追加!'
)
}
</
span
>
);
};
return
(
...
...
src/pages/database/databaseInitialization/DatabaseInitialization.jsx
View file @
00afbc1a
...
...
@@ -35,6 +35,7 @@ import {
NewInitAddDataBase
,
InitEditDataBase
,
getDataBaseConfigNew
,
UpgradeDataBase
,
}
from
'@/services/database/api'
;
import
{
CloseCircleOutlined
,
...
...
@@ -122,6 +123,7 @@ const DatabaseInitialization = props => {
const
[
keepHistroy
,
setKeepHistroy
]
=
useState
([]);
const
[
historyVisible
,
setHistoryVisible
]
=
useState
(
false
);
const
[
keepInitDetailVisible
,
setKeepInitDetailVisible
]
=
useState
(
false
);
const
[
appendType
,
setAppendType
]
=
useState
(
'no'
);
const
key
=
CryptoJS
.
enc
.
Utf8
.
parse
(
'1p2a3n4d5a6o7m8s9a10n1e2t3c4o5re'
);
//十六位十六进制数作为密钥
const
iv
=
CryptoJS
.
enc
.
Utf8
.
parse
(
'1234567890000000'
);
...
...
@@ -754,7 +756,11 @@ const DatabaseInitialization = props => {
setInitVisible
(
true
);
doInitLog
();
let
obj
=
form
.
getFieldsValue
();
InitEditDataBase
({
...
obj
,
password
:
Encrypt
(
obj
.
password
)
}).
then
(
res
=>
{
InitEditDataBase
({
...
obj
,
password
:
Encrypt
(
obj
.
password
),
isOldDbToNewDb
:
appendType
===
'yes'
?
true
:
false
,
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
GetDbChangeAppend
();
setMsg
(
'未检测到可用License'
);
...
...
@@ -910,14 +916,21 @@ const DatabaseInitialization = props => {
setResult
(
'检测到License,当前环境需要追加产品'
);
setMsg
(
'检测到License,当前环境需要追加产品'
);
setAppend
(
''
);
setAppendType
(
'no'
);
setAppendVisible
(
true
);
console
.
log
(
form
.
getFieldsValue
());
setDataValue
(
form
.
getFieldsValue
());
}
else
{
setbeforeColor
(
'red'
);
setResult
(
'无法追加,该数据库为非授权初始化数据库,请直接升级数据库!'
);
setMsg
(
'无法追加,该数据库为非授权初始化数据库,请直接升级数据库!'
);
setAppend
(
'无需追加'
);
setbeforeColor
(
'green'
);
setAppendType
(
'yes'
);
setResult
(
'当前数据库为非授权初始化数据库,可使用授权码升级到授权码模式'
);
setMsg
(
'当前数据库为非授权初始化数据库,可使用授权码升级到授权码模式'
);
setAppend
(
''
);
setAppendVisible
(
true
);
setDataValue
(
form
.
getFieldsValue
());
// setbeforeColor('red');
// setResult('无法追加,该数据库为非授权初始化数据库,请直接升级数据库!');
// setMsg('无法追加,该数据库为非授权初始化数据库,请直接升级数据库!');
// setAppend('无需追加');
}
}
}
else
{
...
...
@@ -929,6 +942,7 @@ const DatabaseInitialization = props => {
};
const
Submit
=
()
=>
{
setAppendType
(
'no'
);
let
obj
=
form
.
getFieldsValue
();
if
(
obj
.
ip
&&
obj
.
userName
&&
obj
.
password
&&
obj
.
dbName
)
{
GetProductList
({
...
obj
,
password
:
Encrypt
(
obj
.
password
)
}).
then
(
res
=>
{
...
...
@@ -950,7 +964,6 @@ const DatabaseInitialization = props => {
setData
(
arr
);
}
});
setCardLoading
(
true
);
}
else
{
setbeforeColor
(
'red'
);
...
...
@@ -971,14 +984,22 @@ const DatabaseInitialization = props => {
setResult
(
'检测到License,当前环境需要追加产品'
);
setMsg
(
'检测到License,当前环境需要追加产品'
);
setAppend
(
''
);
setAppendType
(
'no'
);
setAppendVisible
(
true
);
setDataValue
(
form
.
getFieldsValue
());
}
else
{
setbeforeColor
(
'red'
);
setPassword
(
false
);
setResult
(
'无法追加,该数据库为非授权初始化数据库,请直接升级数据库! '
);
setMsg
(
'无法追加,该数据库为非授权初始化数据库,请直接升级数据库!'
);
setAppend
(
'无需追加'
);
setbeforeColor
(
'green'
);
setAppendType
(
'yes'
);
setResult
(
'当前数据库为非授权初始化数据库,可使用授权码升级到授权码模式'
);
setMsg
(
'当前数据库为非授权初始化数据库,可使用授权码升级到授权码模式'
);
setAppend
(
''
);
setAppendVisible
(
true
);
setDataValue
(
form
.
getFieldsValue
());
// setbeforeColor('red');
// setPassword(false);
// setResult('无法追加,该数据库为非授权初始化数据库,请直接升级数据库! ');
// setMsg('无法追加,该数据库为非授权初始化数据库,请直接升级数据库!');
// setAppend('无需追加');
// deleteInitDBLogNew();
}
}
else
{
...
...
@@ -1020,12 +1041,20 @@ const DatabaseInitialization = props => {
setAppend
(
''
);
setAppendVisible
(
true
);
setDataValue
(
form
.
getFieldsValue
());
setAppendType
(
'no'
);
}
else
{
setbeforeColor
(
'red'
);
setPassword
(
false
);
setResult
(
'无法追加,该数据库为非授权初始化数据库,请直接升级数据库! '
);
setMsg
(
'无法追加,该数据库为非授权初始化数据库,请直接升级数据库!'
);
setAppend
(
'无需追加'
);
setbeforeColor
(
'green'
);
setResult
(
'当前数据库为非授权初始化数据库,可使用授权码升级到授权码模式'
);
setMsg
(
'当前数据库为非授权初始化数据库,可使用授权码升级到授权码模式'
);
setAppendType
(
'yes'
);
setAppend
(
''
);
setAppendVisible
(
true
);
setDataValue
(
form
.
getFieldsValue
());
// setbeforeColor('red');
// setPassword(false);
// setResult('无法追加,该数据库为非授权初始化数据库,请直接升级数据库! ');
// setMsg('无法追加,该数据库为非授权初始化数据库,请直接升级数据库!');
// setAppend('无需追加');
// deleteInitDBLogNew();
}
}
else
{
...
...
@@ -1052,6 +1081,7 @@ const DatabaseInitialization = props => {
};
const
save
=
()
=>
{
setAppendType
(
'no'
);
flagChange
();
};
...
...
@@ -1286,6 +1316,17 @@ const DatabaseInitialization = props => {
</
span
>
</>
);
case
'当前数据库为非授权初始化数据库,可使用授权码升级到授权码模式'
:
return
(
<>
<
CheckCircleOutlined
style=
{
{
color
:
'green'
,
marginLeft
:
'10px'
}
}
/>
<
span
style=
{
{
color
:
'rgb(24 144 255)'
,
marginLeft
:
'5px'
}
}
>
{
result
}
</
span
>
</>
);
default
:
return
(
<>
...
...
@@ -1718,6 +1759,7 @@ const DatabaseInitialization = props => {
onCancel=
{
()
=>
{
setAppendVisible
(
false
);
}
}
appendType=
{
appendType
}
value=
{
dataValue
}
callBackSubmit=
{
onOk
}
keepHistroy=
{
keepHistroy
}
...
...
src/services/database/api.js
View file @
00afbc1a
...
...
@@ -238,3 +238,6 @@ export const NewInitAddDataBase = params =>
// 获取追加产品
export
const
GetLicenseDifference
=
params
=>
post
(
`
${
PUBLISH_SERVICE
}
/DBManager/GetLicenseDifference`
,
params
);
export
const
UpgradeDataBase
=
params
=>
post
(
`
${
PUBLISH_SERVICE
}
/DBManager/UpgradeDataBase`
,
params
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment