Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
front-backend
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
framework
front-backend
Commits
ee3f478d
Commit
ee3f478d
authored
Dec 01, 2019
by
zhy6599@163.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加测试数据库链接方法
parent
bfdb1286
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
14 deletions
+50
-14
src/api/mnt/connect.js
+17
-0
src/api/mnt/database.js
+9
-1
src/api/mnt/serverDeploy.js
+0
-8
src/views/mnt/database/index.vue
+21
-3
src/views/mnt/server/index.vue
+3
-2
No files found.
src/api/mnt/connect.js
0 → 100644
View file @
ee3f478d
import
request
from
'@/utils/request'
export
function
testDbConnect
(
data
)
{
return
request
({
url
:
'api/database/testConnect'
,
method
:
'post'
,
data
})
}
export
function
testServerConnect
(
data
)
{
return
request
({
url
:
'api/serverDeploy/testConnect'
,
method
:
'post'
,
data
})
}
src/api/mnt/database.js
View file @
ee3f478d
...
...
@@ -23,4 +23,12 @@ export function edit(data) {
})
}
export
default
{
add
,
edit
,
del
}
export
function
testDbConnection
(
data
)
{
return
request
({
url
:
'api/database/testConnect'
,
method
:
'post'
,
data
})
}
export
default
{
add
,
edit
,
del
,
testDbConnection
}
src/api/mnt/serverDeploy.js
View file @
ee3f478d
...
...
@@ -23,12 +23,4 @@ export function edit(data) {
})
}
export
function
testConnect
(
data
)
{
return
request
({
url
:
'api/serverDeploy/testConnect'
,
method
:
'post'
,
data
})
}
export
default
{
add
,
edit
,
del
}
src/views/mnt/database/index.vue
View file @
ee3f478d
...
...
@@ -22,7 +22,7 @@
<el-input
v-model=
"form.name"
style=
"width: 370px"
/>
</el-form-item>
<el-form-item
label=
"连接地址"
prop=
"jdbcUrl"
>
<el-input
v-model=
"form.jdbcUrl"
style=
"width: 3
70px"
/
>
<el-input
v-model=
"form.jdbcUrl"
style=
"width: 3
00px"
/><el-button
:loading=
"loading"
type=
"info"
@
click=
"testConnectDatabase"
>
测试
</el-button
>
</el-form-item>
<el-form-item
label=
"用户名"
prop=
"userName"
>
<el-input
v-model=
"form.userName"
style=
"width: 370px"
/>
...
...
@@ -74,13 +74,14 @@
<
script
>
import
crud
from
'@/mixins/crud'
import
crudDataBase
from
'@/api//mnt/database'
import
crudDatabase
from
'@/api/mnt/database'
import
{
testDbConnect
}
from
'@/api/mnt/connect'
export
default
{
mixins
:
[
crud
],
data
()
{
return
{
title
:
'数据库'
,
crudMethod
:
{
...
crudData
B
ase
},
crudMethod
:
{
...
crudData
b
ase
},
form
:
{
id
:
null
,
name
:
null
,
jdbcUrl
:
null
,
userName
:
null
,
pwd
:
null
},
rules
:
{
name
:
[
...
...
@@ -107,6 +108,23 @@ export default {
beforeInit
()
{
this
.
url
=
'api/database'
return
true
},
testConnectDatabase
()
{
this
.
$refs
[
'form'
].
validate
((
valid
)
=>
{
if
(
valid
)
{
this
.
loading
=
true
testDbConnect
(
this
.
form
).
then
((
res
)
=>
{
this
.
loading
=
false
this
.
$notify
({
title
:
res
?
'连接成功'
:
'连接失败'
,
type
:
res
?
'success'
:
'error'
,
duration
:
2500
})
}).
catch
(()
=>
{
this
.
loading
=
false
})
}
})
}
}
}
...
...
src/views/mnt/server/index.vue
View file @
ee3f478d
...
...
@@ -96,7 +96,8 @@
<
script
>
import
crud
from
'@/mixins/crud'
import
{
crudServer
,
testConnect
}
from
'@/api/mnt/serverDeploy'
import
crudServer
from
'@/api/mnt/serverDeploy'
import
{
testServerConnect
}
from
'@/api/mnt/connect'
import
{
validateIP
}
from
'@/utils/validate'
export
default
{
mixins
:
[
crud
],
...
...
@@ -141,7 +142,7 @@ export default {
this
.
$refs
[
'form'
].
validate
((
valid
)
=>
{
if
(
valid
)
{
this
.
loading
=
true
testConnect
(
this
.
form
).
then
((
res
)
=>
{
test
Server
Connect
(
this
.
form
).
then
((
res
)
=>
{
this
.
loading
=
false
this
.
$notify
({
title
:
res
?
'连接成功'
:
'连接失败'
,
...
...
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