Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nuxt-backend-helper
Project
Project
Details
Activity
Releases
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
王曜嵚 Wang Yaoqin
nuxt-backend-helper
Commits
8c61c719
Commit
8c61c719
authored
May 07, 2024
by
王曜嵚 Wang Yaoqin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev: 状态变化
parent
b649bc12
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
v1.vue
pages/v1.vue
+4
-4
login.post.ts
server/api/user/login.post.ts
+1
-1
docker.ts
server/utils/docker.ts
+2
-2
No files found.
pages/v1.vue
View file @
8c61c719
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<NuxtLayout>
<NuxtLayout>
<div
class=
'content'
>
<div
class=
'content'
>
<div
class=
'container'
>
<div
class=
'container'
>
<form
class=
'form'
ref=
'form'
>
<form
class=
'form'
>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<div
class=
"form-group__label"
>
<div
class=
"form-group__label"
>
<label
for=
"none"
>
<label
for=
"none"
>
...
@@ -44,11 +44,11 @@ const form = ref<Record<string, any>>({
...
@@ -44,11 +44,11 @@ const form = ref<Record<string, any>>({
})
})
onMounted
(()
=>
{
onMounted
(()
=>
{
getData
getData
()
})
})
function
getData
()
{
function
getData
()
{
$fetch
(
'/api/getProjectInfo'
).
then
((
res
:
any
)
=>
{
$fetch
(
'/api/
devops/v1/
getProjectInfo'
).
then
((
res
:
any
)
=>
{
Object
.
keys
(
form
.
value
).
forEach
(
key
=>
{
Object
.
keys
(
form
.
value
).
forEach
(
key
=>
{
if
(
res
[
key
])
{
if
(
res
[
key
])
{
form
.
value
[
key
]
=
res
[
key
]
form
.
value
[
key
]
=
res
[
key
]
...
@@ -58,7 +58,7 @@ function getData() {
...
@@ -58,7 +58,7 @@ function getData() {
}
}
function
handleSaveConfig
(
key
:
string
)
{
function
handleSaveConfig
(
key
:
string
)
{
const
value
=
JSON
.
stringify
(
form
.
value
[
key
])
const
value
=
JSON
.
stringify
(
form
.
value
[
key
])
$fetch
(
'/api/
config
/setUserSetting'
,
{
method
:
'post'
,
body
:
{
table
:
'v1'
,
key
,
value
}}).
then
(()
=>
{
$fetch
(
'/api/
user
/setUserSetting'
,
{
method
:
'post'
,
body
:
{
table
:
'v1'
,
key
,
value
}}).
then
(()
=>
{
alert
(
'保存成功'
)
alert
(
'保存成功'
)
}).
catch
(()
=>
{
}).
catch
(()
=>
{
alert
(
'保存失败!!!'
)
alert
(
'保存失败!!!'
)
...
...
server/api/user/login.post.ts
View file @
8c61c719
...
@@ -4,7 +4,7 @@ import { SESSION_PASSWORD } from "../../utils"
...
@@ -4,7 +4,7 @@ import { SESSION_PASSWORD } from "../../utils"
export
default
defineEventHandler
(
async
(
event
)
=>
{
export
default
defineEventHandler
(
async
(
event
)
=>
{
const
body
=
await
readBody
(
event
)
const
body
=
await
readBody
(
event
)
const
username
=
body
.
username
const
username
=
body
.
username
const
session
=
await
useSession
(
event
,
{
password
:
SESSION_PASSWORD
})
const
session
=
await
useSession
(
event
,
{
password
:
SESSION_PASSWORD
,
cookie
:
{
secure
:
false
}
})
await
session
.
update
({
username
})
await
session
.
update
({
username
})
let
user
=
await
getPgTableData
(
'user'
,
username
)
let
user
=
await
getPgTableData
(
'user'
,
username
)
...
...
server/utils/docker.ts
View file @
8c61c719
...
@@ -170,11 +170,11 @@ class Docker {
...
@@ -170,11 +170,11 @@ class Docker {
if
(
platform
===
'v1'
)
{
if
(
platform
===
'v1'
)
{
await
this
.
switchJavaVersion
({
container
,
username
,
version
:
8
})
await
this
.
switchJavaVersion
({
container
,
username
,
version
:
8
})
const
statusV2
=
(
await
getPgTableData
(
'v2'
,
username
))?.
status
const
statusV2
=
(
await
getPgTableData
(
'v2'
,
username
))?.
status
if
(
statusV2
)
setPgTableData
(
'v2'
,
username
,
'status'
,
'c
reat
ed'
)
// 如果系统在运行,回退到已创建的状态
if
(
statusV2
)
setPgTableData
(
'v2'
,
username
,
'status'
,
'c
ompil
ed'
)
// 如果系统在运行,回退到已创建的状态
}
else
{
}
else
{
await
this
.
switchJavaVersion
({
container
,
username
,
version
:
17
})
await
this
.
switchJavaVersion
({
container
,
username
,
version
:
17
})
const
statusV1
=
(
await
getPgTableData
(
'v1'
,
username
))?.
status
const
statusV1
=
(
await
getPgTableData
(
'v1'
,
username
))?.
status
if
(
statusV1
)
setPgTableData
(
'v1'
,
username
,
'status'
,
'c
reat
ed'
)
// 如果系统在运行,回退到已创建的状态
if
(
statusV1
)
setPgTableData
(
'v1'
,
username
,
'status'
,
'c
ompil
ed'
)
// 如果系统在运行,回退到已创建的状态
}
}
}
}
}
}
...
...
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