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
7a48cc3d
Commit
7a48cc3d
authored
Nov 17, 2023
by
皮倩雯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: '修复数据库链接失败bug‘
parent
e3a5d5a9
Pipeline
#81866
passed with stages
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
16 deletions
+60
-16
InitDataBase.jsx
src/pages/database/InitDataBase/InitDataBase.jsx
+12
-4
AppendModal.jsx
src/pages/database/databaseInitialization/AppendModal.jsx
+4
-1
DatabaseInitialization.jsx
...atabase/databaseInitialization/DatabaseInitialization.jsx
+44
-11
No files found.
src/pages/database/InitDataBase/InitDataBase.jsx
View file @
7a48cc3d
...
...
@@ -253,8 +253,10 @@ const InitDataBase = props => {
const
onFinish
=
values
=>
{
setCardLoading
(
true
);
const
obj
=
values
;
console
.
log
(
chooseDb
.
current
,
'obj'
);
let
pwd
=
Decrypt
(
obj
.
password
)
===
''
?
Encrypt
(
obj
.
password
)
:
obj
.
password
;
let
pwd
=
Decrypt
(
obj
.
password
)
===
''
||
Decrypt
(
obj
.
password
).
indexOf
(
'
\
u0004'
)
!==
-
1
?
Encrypt
(
obj
.
password
)
:
obj
.
password
;
saveConnectionNew
({
ip
:
obj
.
ip
,
dbName
:
obj
.
dbName
,
...
...
@@ -296,7 +298,10 @@ const InitDataBase = props => {
const
onCheck
=
e
=>
{
setCardLoading
(
true
);
const
obj
=
form
.
getFieldsValue
();
let
pwd
=
Decrypt
(
obj
.
password
)
===
''
?
Encrypt
(
obj
.
password
)
:
obj
.
password
;
let
pwd
=
Decrypt
(
obj
.
password
)
===
''
||
Decrypt
(
obj
.
password
).
indexOf
(
'
\
u0004'
)
!==
-
1
?
Encrypt
(
obj
.
password
)
:
obj
.
password
;
connectionTest
({
ip
:
obj
.
ip
,
dbName
:
obj
.
dbName
,
...
...
@@ -327,7 +332,10 @@ const InitDataBase = props => {
// 获取数据库列表
const
selectFocus
=
e
=>
{
let
params
=
form
.
getFieldsValue
();
let
pwd
=
Decrypt
(
params
.
password
)
===
''
?
Encrypt
(
params
.
password
)
:
params
.
password
;
let
pwd
=
Decrypt
(
params
.
password
)
===
''
||
Decrypt
(
params
.
password
).
indexOf
(
'
\
u0004'
)
!==
-
1
?
Encrypt
(
params
.
password
)
:
params
.
password
;
getDataBaseList
({
userName
:
params
.
userName
||
''
,
password
:
pwd
||
''
,
...
...
src/pages/database/databaseInitialization/AppendModal.jsx
View file @
7a48cc3d
...
...
@@ -96,7 +96,10 @@ const AppendModal = props => {
const
getProduct
=
()
=>
{
setLoading
(
true
);
let
pwd
=
Decrypt
(
value
.
password
)
===
''
?
Encrypt
(
value
.
password
)
:
value
.
password
;
let
pwd
=
Decrypt
(
value
.
password
)
===
''
||
Decrypt
(
value
.
password
).
indexOf
(
'
\
u0004'
)
!==
-
1
?
Encrypt
(
value
.
password
)
:
value
.
password
;
GetLicenseDifference
({
...
value
,
password
:
pwd
}).
then
(
res
=>
{
setLoading
(
false
);
if
(
res
.
code
===
0
)
{
...
...
src/pages/database/databaseInitialization/DatabaseInitialization.jsx
View file @
7a48cc3d
...
...
@@ -452,7 +452,10 @@ const DatabaseInitialization = props => {
const
GetDbChangeFirst
=
kk
=>
{
let
obj
=
form
.
getFieldsValue
();
let
pwd
=
Decrypt
(
obj
.
password
)
===
''
?
Encrypt
(
obj
.
password
)
:
obj
.
password
;
let
pwd
=
Decrypt
(
obj
.
password
)
===
''
||
Decrypt
(
obj
.
password
).
indexOf
(
'
\
u0004'
)
!==
-
1
?
Encrypt
(
obj
.
password
)
:
obj
.
password
;
GetDbProduct
({
...
obj
,
password
:
pwd
}).
then
(
res
=>
{
setCardLoading
(
false
);
if
(
res
.
code
===
0
)
{
...
...
@@ -503,7 +506,10 @@ const DatabaseInitialization = props => {
const
GetDbChange
=
e
=>
{
let
obj
=
form
.
getFieldsValue
();
let
pwd
=
Decrypt
(
obj
.
password
)
===
''
?
Encrypt
(
obj
.
password
)
:
obj
.
password
;
let
pwd
=
Decrypt
(
obj
.
password
)
===
''
||
Decrypt
(
obj
.
password
).
indexOf
(
'
\
u0004'
)
!==
-
1
?
Encrypt
(
obj
.
password
)
:
obj
.
password
;
GetDbProduct
({
...
obj
,
password
:
pwd
}).
then
(
res
=>
{
setCardLoading
(
false
);
if
(
res
.
code
===
0
)
{
...
...
@@ -619,7 +625,10 @@ const DatabaseInitialization = props => {
const
GetDbChangeAppend
=
()
=>
{
let
obj
=
form
.
getFieldsValue
();
let
pwd
=
Decrypt
(
obj
.
password
)
===
''
?
Encrypt
(
obj
.
password
)
:
obj
.
password
;
let
pwd
=
Decrypt
(
obj
.
password
)
===
''
||
Decrypt
(
obj
.
password
).
indexOf
(
'
\
u0004'
)
!==
-
1
?
Encrypt
(
obj
.
password
)
:
obj
.
password
;
GetDbProduct
({
...
obj
,
password
:
pwd
}).
then
(
res
=>
{
setCardLoading
(
false
);
if
(
res
.
code
===
0
)
{
...
...
@@ -704,7 +713,10 @@ const DatabaseInitialization = props => {
handleShowModal
(
'initVisible'
,
false
);
setInitVisible
(
true
);
doInitLog
();
let
pwd
=
Decrypt
(
obj
.
password
)
===
''
?
Encrypt
(
obj
.
password
)
:
obj
.
password
;
let
pwd
=
Decrypt
(
obj
.
password
)
===
''
||
Decrypt
(
obj
.
password
).
indexOf
(
'
\
u0004'
)
!==
-
1
?
Encrypt
(
obj
.
password
)
:
obj
.
password
;
NewInitAddDataBase
({
...
obj
,
productSetting
,
password
:
pwd
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
GetDbChangeAppend
();
// 刷星已初始化的产品勾选
...
...
@@ -760,7 +772,10 @@ const DatabaseInitialization = props => {
setInitVisible
(
true
);
doInitLog
();
let
obj
=
form
.
getFieldsValue
();
let
pwd
=
Decrypt
(
obj
.
password
)
===
''
?
Encrypt
(
obj
.
password
)
:
obj
.
password
;
let
pwd
=
Decrypt
(
obj
.
password
)
===
''
||
Decrypt
(
obj
.
password
).
indexOf
(
'
\
u0004'
)
!==
-
1
?
Encrypt
(
obj
.
password
)
:
obj
.
password
;
InitEditDataBase
({
...
obj
,
password
:
pwd
,
...
...
@@ -857,7 +872,10 @@ const DatabaseInitialization = props => {
// setKeepValue([]);
setProduct
([]);
setCardLoading
(
true
);
let
pwd
=
Decrypt
(
obj
.
password
)
===
''
?
Encrypt
(
obj
.
password
)
:
obj
.
password
;
let
pwd
=
Decrypt
(
obj
.
password
)
===
''
||
Decrypt
(
obj
.
password
).
indexOf
(
'
\
u0004'
)
!==
-
1
?
Encrypt
(
obj
.
password
)
:
obj
.
password
;
GetProductList
({
...
obj
,
password
:
pwd
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
console
.
log
(
res
.
data
);
...
...
@@ -890,7 +908,10 @@ const DatabaseInitialization = props => {
// 非授权模式下环境检查
const
checkUnLicense
=
()
=>
{
let
obj
=
form
.
getFieldsValue
();
let
pwd
=
Decrypt
(
obj
.
password
)
===
''
?
Encrypt
(
obj
.
password
)
:
obj
.
password
;
let
pwd
=
Decrypt
(
obj
.
password
)
===
''
||
Decrypt
(
obj
.
password
).
indexOf
(
'
\
u0004'
)
!==
-
1
?
Encrypt
(
obj
.
password
)
:
obj
.
password
;
CheckDatabaseIsExist
({
...
obj
,
password
:
pwd
}).
then
(
res
=>
{
setCardLoading
(
false
);
if
(
res
.
code
!==
0
)
{
...
...
@@ -904,7 +925,10 @@ const DatabaseInitialization = props => {
const
onCheckLaster
=
aa
=>
{
// 此时有授权码才能进入
let
obj
=
form
.
getFieldsValue
();
let
pwd
=
Decrypt
(
obj
.
password
)
===
''
?
Encrypt
(
obj
.
password
)
:
obj
.
password
;
let
pwd
=
Decrypt
(
obj
.
password
)
===
''
||
Decrypt
(
obj
.
password
).
indexOf
(
'
\
u0004'
)
!==
-
1
?
Encrypt
(
obj
.
password
)
:
obj
.
password
;
CheckDatabaseIsExist
({
...
obj
,
password
:
pwd
}).
then
(
res
=>
{
setCardLoading
(
false
);
if
(
res
.
code
==
0
)
{
...
...
@@ -953,7 +977,10 @@ const DatabaseInitialization = props => {
setAppendType
(
'no'
);
let
obj
=
form
.
getFieldsValue
();
if
(
obj
.
ip
&&
obj
.
userName
&&
obj
.
password
&&
obj
.
dbName
)
{
let
pwd
=
Decrypt
(
obj
.
password
)
===
''
?
Encrypt
(
obj
.
password
)
:
obj
.
password
;
let
pwd
=
Decrypt
(
obj
.
password
)
===
''
||
Decrypt
(
obj
.
password
).
indexOf
(
'
\
u0004'
)
!==
-
1
?
Encrypt
(
obj
.
password
)
:
obj
.
password
;
GetProductList
({
...
obj
,
password
:
pwd
}).
then
(
res
=>
{
setCardLoading
(
false
);
if
(
res
.
code
===
0
)
{
...
...
@@ -983,7 +1010,10 @@ const DatabaseInitialization = props => {
const
findCheck
=
aa
=>
{
let
obj
=
form
.
getFieldsValue
();
let
pwd
=
Decrypt
(
obj
.
password
)
===
''
?
Encrypt
(
obj
.
password
)
:
obj
.
password
;
let
pwd
=
Decrypt
(
obj
.
password
)
===
''
||
Decrypt
(
obj
.
password
).
indexOf
(
'
\
u0004'
)
!==
-
1
?
Encrypt
(
obj
.
password
)
:
obj
.
password
;
CheckDatabaseIsExist
({
...
obj
,
password
:
pwd
}).
then
(
res
=>
{
setCardLoading
(
false
);
if
(
res
.
code
===
0
)
{
...
...
@@ -1039,7 +1069,10 @@ const DatabaseInitialization = props => {
const
findCheck1
=
aa
=>
{
let
obj
=
form
.
getFieldsValue
();
let
pwd
=
Decrypt
(
obj
.
password
)
===
''
?
Encrypt
(
obj
.
password
)
:
obj
.
password
;
let
pwd
=
Decrypt
(
obj
.
password
)
===
''
||
Decrypt
(
obj
.
password
).
indexOf
(
'
\
u0004'
)
!==
-
1
?
Encrypt
(
obj
.
password
)
:
obj
.
password
;
CheckDatabaseIsExist
({
...
obj
,
password
:
pwd
}).
then
(
res
=>
{
setCardLoading
(
false
);
if
(
res
.
code
===
0
)
{
...
...
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