Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
DolphinScheduler
提交
5c576297
DolphinScheduler
项目概览
apache
/
DolphinScheduler
上一次同步 1 年多
通知
707
Star
9572
Fork
3514
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
DolphinScheduler
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
5c576297
编写于
1月 04, 2022
作者:
S
songjianet
提交者:
GitHub
1月 04, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[Feature][UI Next] Add password page. (#7795)
上级
a4168ae2
变更
13
显示空白变更内容
内联
并排
Showing
13 changed file
with
236 addition
and
16 deletion
+236
-16
dolphinscheduler-ui-next/src/layouts/content/components/user/use-dropdown.ts
...-next/src/layouts/content/components/user/use-dropdown.ts
+3
-1
dolphinscheduler-ui-next/src/layouts/content/use-dataList.ts
dolphinscheduler-ui-next/src/layouts/content/use-dataList.ts
+7
-1
dolphinscheduler-ui-next/src/locales/modules/en_US.ts
dolphinscheduler-ui-next/src/locales/modules/en_US.ts
+13
-0
dolphinscheduler-ui-next/src/locales/modules/zh_CN.ts
dolphinscheduler-ui-next/src/locales/modules/zh_CN.ts
+12
-0
dolphinscheduler-ui-next/src/router/routes.ts
dolphinscheduler-ui-next/src/router/routes.ts
+8
-0
dolphinscheduler-ui-next/src/service/modules/users/types.ts
dolphinscheduler-ui-next/src/service/modules/users/types.ts
+10
-0
dolphinscheduler-ui-next/src/store/user/types.ts
dolphinscheduler-ui-next/src/store/user/types.ts
+4
-1
dolphinscheduler-ui-next/src/store/user/user.ts
dolphinscheduler-ui-next/src/store/user/user.ts
+9
-1
dolphinscheduler-ui-next/src/views/login/index.tsx
dolphinscheduler-ui-next/src/views/login/index.tsx
+5
-2
dolphinscheduler-ui-next/src/views/login/use-form.ts
dolphinscheduler-ui-next/src/views/login/use-form.ts
+4
-4
dolphinscheduler-ui-next/src/views/login/use-login.ts
dolphinscheduler-ui-next/src/views/login/use-login.ts
+11
-6
dolphinscheduler-ui-next/src/views/password/index.tsx
dolphinscheduler-ui-next/src/views/password/index.tsx
+77
-0
dolphinscheduler-ui-next/src/views/password/use-form.ts
dolphinscheduler-ui-next/src/views/password/use-form.ts
+73
-0
未找到文件。
dolphinscheduler-ui-next/src/layouts/content/components/user/use-dropdown.ts
浏览文件 @
5c576297
...
@@ -26,15 +26,17 @@ export function useDropDown() {
...
@@ -26,15 +26,17 @@ export function useDropDown() {
const
userStore
=
useUserStore
()
const
userStore
=
useUserStore
()
const
handleSelect
=
(
key
:
string
|
number
,
option
:
DropdownOption
)
=>
{
const
handleSelect
=
(
key
:
string
|
number
,
option
:
DropdownOption
)
=>
{
console
.
log
(
key
,
option
)
if
(
key
===
'
logout
'
)
{
if
(
key
===
'
logout
'
)
{
useLogout
()
useLogout
()
}
else
if
(
key
===
'
password
'
)
{
router
.
push
({
path
:
'
password
'
})
}
}
}
}
const
useLogout
=
()
=>
{
const
useLogout
=
()
=>
{
logout
().
then
(()
=>
{
logout
().
then
(()
=>
{
userStore
.
setSessionId
(
''
)
userStore
.
setSessionId
(
''
)
userStore
.
setUserInfo
({})
router
.
push
({
path
:
'
login
'
})
router
.
push
({
path
:
'
login
'
})
})
})
}
}
...
...
dolphinscheduler-ui-next/src/layouts/content/use-dataList.ts
浏览文件 @
5c576297
...
@@ -41,6 +41,7 @@ import {
...
@@ -41,6 +41,7 @@ import {
SlackOutlined
,
SlackOutlined
,
EnvironmentOutlined
,
EnvironmentOutlined
,
KeyOutlined
,
KeyOutlined
,
SafetyOutlined
,
}
from
'
@vicons/antd
'
}
from
'
@vicons/antd
'
export
function
useDataList
()
{
export
function
useDataList
()
{
...
@@ -208,7 +209,7 @@ export function useDataList() {
...
@@ -208,7 +209,7 @@ export function useDataList() {
{
{
label
:
t
(
'
menu.token_manage
'
),
label
:
t
(
'
menu.token_manage
'
),
key
:
'
token-manage
'
,
key
:
'
token-manage
'
,
icon
:
renderIcon
(
Ke
yOutlined
),
icon
:
renderIcon
(
Safet
yOutlined
),
},
},
],
],
},
},
...
@@ -231,6 +232,11 @@ export function useDataList() {
...
@@ -231,6 +232,11 @@ export function useDataList() {
key
:
'
profile
'
,
key
:
'
profile
'
,
icon
:
renderIcon
(
UserOutlined
),
icon
:
renderIcon
(
UserOutlined
),
},
},
{
label
:
t
(
'
profile.password
'
),
key
:
'
password
'
,
icon
:
renderIcon
(
KeyOutlined
),
},
{
{
label
:
t
(
'
profile.logout
'
),
label
:
t
(
'
profile.logout
'
),
key
:
'
logout
'
,
key
:
'
logout
'
,
...
...
dolphinscheduler-ui-next/src/locales/modules/en_US.ts
浏览文件 @
5c576297
...
@@ -31,6 +31,7 @@ const theme = {
...
@@ -31,6 +31,7 @@ const theme = {
const
profile
=
{
const
profile
=
{
profile
:
'
Profile
'
,
profile
:
'
Profile
'
,
password
:
'
Password
'
,
logout
:
'
Logout
'
,
logout
:
'
Logout
'
,
}
}
...
@@ -76,10 +77,22 @@ const home = {
...
@@ -76,10 +77,22 @@ const home = {
state
:
'
State
'
,
state
:
'
State
'
,
}
}
const
password
=
{
edit_password
:
'
Edit Password
'
,
password
:
'
Password
'
,
confirm_password
:
'
Confirm Password
'
,
password_tips
:
'
Please enter your password
'
,
confirm_password_tips
:
'
Please enter your confirm password
'
,
two_password_entries_are_inconsistent
:
'
Two Password Entries Are Inconsistent
'
,
submit
:
'
Submit
'
,
}
export
default
{
export
default
{
login
,
login
,
theme
,
theme
,
profile
,
profile
,
menu
,
menu
,
home
,
home
,
password
,
}
}
dolphinscheduler-ui-next/src/locales/modules/zh_CN.ts
浏览文件 @
5c576297
...
@@ -31,6 +31,7 @@ const theme = {
...
@@ -31,6 +31,7 @@ const theme = {
const
profile
=
{
const
profile
=
{
profile
:
'
用户信息
'
,
profile
:
'
用户信息
'
,
password
:
'
密码管理
'
,
logout
:
'
退出登录
'
,
logout
:
'
退出登录
'
,
}
}
...
@@ -76,10 +77,21 @@ const home = {
...
@@ -76,10 +77,21 @@ const home = {
state
:
'
状态
'
,
state
:
'
状态
'
,
}
}
const
password
=
{
edit_password
:
'
修改密码
'
,
password
:
'
密码
'
,
confirm_password
:
'
确认密码
'
,
password_tips
:
'
请输入密码
'
,
confirm_password_tips
:
'
请输入确认密码
'
,
two_password_entries_are_inconsistent
:
'
两次密码输入不一致
'
,
submit
:
'
提交
'
,
}
export
default
{
export
default
{
login
,
login
,
theme
,
theme
,
profile
,
profile
,
menu
,
menu
,
home
,
home
,
password
,
}
}
dolphinscheduler-ui-next/src/router/routes.ts
浏览文件 @
5c576297
...
@@ -46,6 +46,14 @@ const basePage: RouteRecordRaw[] = [
...
@@ -46,6 +46,14 @@ const basePage: RouteRecordRaw[] = [
title
:
'
首页
'
,
title
:
'
首页
'
,
},
},
},
},
{
path
:
'
/password
'
,
name
:
'
password
'
,
component
:
components
[
'
password
'
],
meta
:
{
title
:
'
修改密码
'
,
},
},
],
],
},
},
projectsPage
,
projectsPage
,
...
...
dolphinscheduler-ui-next/src/service/modules/users/types.ts
浏览文件 @
5c576297
...
@@ -88,6 +88,15 @@ interface RegisterUserReq {
...
@@ -88,6 +88,15 @@ interface RegisterUserReq {
userPassword
:
string
userPassword
:
string
}
}
interface
UserInfoRes
extends
UserReq
,
IdReq
{
userType
:
string
tenantCode
?:
any
queueName
?:
any
alertGroup
?:
any
createTime
:
string
updateTime
:
string
}
export
{
export
{
UserNameReq
,
UserNameReq
,
UserNamesReq
,
UserNamesReq
,
...
@@ -103,4 +112,5 @@ export {
...
@@ -103,4 +112,5 @@ export {
ListAllReq
,
ListAllReq
,
ListReq
,
ListReq
,
RegisterUserReq
,
RegisterUserReq
,
UserInfoRes
,
}
}
dolphinscheduler-ui-next/src/store/user/types.ts
浏览文件 @
5c576297
...
@@ -15,8 +15,11 @@
...
@@ -15,8 +15,11 @@
* limitations under the License.
* limitations under the License.
*/
*/
import
type
{
UserInfoRes
}
from
'
@/service/modules/users/types
'
interface
UserState
{
interface
UserState
{
sessionId
:
string
sessionId
:
string
userInfo
:
UserInfoRes
|
{}
}
}
export
default
UserState
export
{
UserState
}
dolphinscheduler-ui-next/src/store/user/user.ts
浏览文件 @
5c576297
...
@@ -16,22 +16,30 @@
...
@@ -16,22 +16,30 @@
*/
*/
import
{
defineStore
}
from
'
pinia
'
import
{
defineStore
}
from
'
pinia
'
import
UserState
from
'
@/store/user/types
'
import
type
{
UserState
}
from
'
@/store/user/types
'
import
type
{
UserInfoRes
}
from
'
@/service/modules/users/types
'
export
const
useUserStore
=
defineStore
({
export
const
useUserStore
=
defineStore
({
id
:
'
user
'
,
id
:
'
user
'
,
state
:
():
UserState
=>
({
state
:
():
UserState
=>
({
sessionId
:
''
,
sessionId
:
''
,
userInfo
:
{},
}),
}),
persist
:
true
,
persist
:
true
,
getters
:
{
getters
:
{
getSessionId
():
string
{
getSessionId
():
string
{
return
this
.
sessionId
return
this
.
sessionId
},
},
getUserInfo
():
UserInfoRes
|
{}
{
return
this
.
userInfo
},
},
},
actions
:
{
actions
:
{
setSessionId
(
sessionId
:
string
):
void
{
setSessionId
(
sessionId
:
string
):
void
{
this
.
sessionId
=
sessionId
this
.
sessionId
=
sessionId
},
},
setUserInfo
(
userInfo
:
UserInfoRes
|
{}):
void
{
this
.
userInfo
=
userInfo
},
},
},
})
})
dolphinscheduler-ui-next/src/views/login/index.tsx
浏览文件 @
5c576297
...
@@ -18,14 +18,14 @@
...
@@ -18,14 +18,14 @@
import
{
defineComponent
,
toRefs
,
withKeys
}
from
'
vue
'
import
{
defineComponent
,
toRefs
,
withKeys
}
from
'
vue
'
import
styles
from
'
./index.module.scss
'
import
styles
from
'
./index.module.scss
'
import
{
NInput
,
NButton
,
NSwitch
,
NForm
,
NFormItem
}
from
'
naive-ui
'
import
{
NInput
,
NButton
,
NSwitch
,
NForm
,
NFormItem
}
from
'
naive-ui
'
import
{
use
Validate
}
from
'
./use-validate
'
import
{
use
Form
}
from
'
./use-form
'
import
{
useTranslate
}
from
'
./use-translate
'
import
{
useTranslate
}
from
'
./use-translate
'
import
{
useLogin
}
from
'
./use-login
'
import
{
useLogin
}
from
'
./use-login
'
const
login
=
defineComponent
({
const
login
=
defineComponent
({
name
:
'
login
'
,
name
:
'
login
'
,
setup
()
{
setup
()
{
const
{
state
,
t
,
locale
}
=
use
Validate
()
const
{
state
,
t
,
locale
}
=
use
Form
()
const
{
handleChange
}
=
useTranslate
(
locale
)
const
{
handleChange
}
=
useTranslate
(
locale
)
...
@@ -85,6 +85,9 @@ const login = defineComponent({
...
@@ -85,6 +85,9 @@ const login = defineComponent({
<
NButton
<
NButton
round
round
type
=
'info'
type
=
'info'
disabled
=
{
!
this
.
loginForm
.
userName
||
!
this
.
loginForm
.
userPassword
}
style
=
{
{
width
:
'
100%
'
}
}
style
=
{
{
width
:
'
100%
'
}
}
onClick
=
{
this
.
handleLogin
}
onClick
=
{
this
.
handleLogin
}
>
>
...
...
dolphinscheduler-ui-next/src/views/login/use-
validate
.ts
→
dolphinscheduler-ui-next/src/views/login/use-
form
.ts
浏览文件 @
5c576297
...
@@ -16,10 +16,10 @@
...
@@ -16,10 +16,10 @@
*/
*/
import
{
reactive
,
ref
}
from
'
vue
'
import
{
reactive
,
ref
}
from
'
vue
'
import
{
FormRules
}
from
'
naive-ui
'
import
{
useI18n
}
from
'
vue-i18n
'
import
{
useI18n
}
from
'
vue-i18n
'
import
type
{
FormRules
}
from
'
naive-ui
'
export
function
use
Validate
()
{
export
function
use
Form
()
{
const
{
t
,
locale
}
=
useI18n
()
const
{
t
,
locale
}
=
useI18n
()
const
state
=
reactive
({
const
state
=
reactive
({
...
@@ -33,7 +33,7 @@ export function useValidate() {
...
@@ -33,7 +33,7 @@ export function useValidate() {
trigger
:
[
'
input
'
,
'
blur
'
],
trigger
:
[
'
input
'
,
'
blur
'
],
validator
()
{
validator
()
{
if
(
state
.
loginForm
.
userName
===
''
)
{
if
(
state
.
loginForm
.
userName
===
''
)
{
return
new
Error
(
`
${
t
(
'
login.userName_tips
'
)}
`
)
return
new
Error
(
t
(
'
login.userName_tips
'
)
)
}
}
},
},
},
},
...
@@ -41,7 +41,7 @@ export function useValidate() {
...
@@ -41,7 +41,7 @@ export function useValidate() {
trigger
:
[
'
input
'
,
'
blur
'
],
trigger
:
[
'
input
'
,
'
blur
'
],
validator
()
{
validator
()
{
if
(
state
.
loginForm
.
userPassword
===
''
)
{
if
(
state
.
loginForm
.
userPassword
===
''
)
{
return
new
Error
(
`
${
t
(
'
login.userPassword_tips
'
)}
`
)
return
new
Error
(
t
(
'
login.userPassword_tips
'
)
)
}
}
},
},
},
},
...
...
dolphinscheduler-ui-next/src/views/login/use-login.ts
浏览文件 @
5c576297
...
@@ -17,21 +17,26 @@
...
@@ -17,21 +17,26 @@
import
{
useRouter
}
from
'
vue-router
'
import
{
useRouter
}
from
'
vue-router
'
import
{
login
}
from
'
@/service/modules/login
'
import
{
login
}
from
'
@/service/modules/login
'
import
{
getUserInfo
}
from
'
@/service/modules/users
'
import
{
useUserStore
}
from
'
@/store/user/user
'
import
{
useUserStore
}
from
'
@/store/user/user
'
import
{
SessionIdRes
}
from
'
@/service/modules/login/types
'
import
type
{
Router
}
from
'
vue-router
'
import
type
{
Router
}
from
'
vue-router
'
import
type
{
SessionIdRes
}
from
'
@/service/modules/login/types
'
import
type
{
UserInfoRes
}
from
'
@/service/modules/users/types
'
export
function
useLogin
(
state
:
any
)
{
export
function
useLogin
(
state
:
any
)
{
const
router
:
Router
=
useRouter
()
const
router
:
Router
=
useRouter
()
const
userStore
=
useUserStore
()
const
userStore
=
useUserStore
()
const
handleLogin
=
()
=>
{
const
handleLogin
=
()
=>
{
state
.
loginFormRef
.
validate
((
valid
:
any
)
=>
{
state
.
loginFormRef
.
validate
(
async
(
valid
:
any
)
=>
{
if
(
!
valid
)
{
if
(
!
valid
)
{
login
({
...
state
.
loginForm
}).
then
((
res
:
SessionIdRes
)
=>
{
const
loginRes
:
SessionIdRes
=
await
login
({
...
state
.
loginForm
})
userStore
.
setSessionId
(
res
.
sessionId
)
const
userInfoRes
:
UserInfoRes
=
await
getUserInfo
()
await
userStore
.
setSessionId
(
loginRes
.
sessionId
)
await
userStore
.
setUserInfo
(
userInfoRes
)
router
.
push
({
path
:
'
home
'
})
router
.
push
({
path
:
'
home
'
})
})
}
}
})
})
}
}
...
...
dolphinscheduler-ui-next/src/views/password/index.tsx
0 → 100644
浏览文件 @
5c576297
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
{
defineComponent
,
toRefs
}
from
'
vue
'
import
{
NForm
,
NFormItem
,
NButton
,
NInput
}
from
'
naive-ui
'
import
{
useForm
}
from
'
./use-form
'
import
Card
from
'
@/components/card
'
const
password
=
defineComponent
({
name
:
'
password
'
,
setup
()
{
const
{
state
,
t
}
=
useForm
()
return
{
...
toRefs
(
state
),
t
}
},
render
()
{
const
{
rules
,
passwordForm
,
t
,
handlePasswordInput
}
=
this
return
(
<
Card
title
=
{
t
(
'
password.edit_password
'
)
}
>
{
{
default
:
()
=>
(
<
div
>
<
NForm
rules
=
{
rules
}
ref
=
'passwordFormRef'
>
<
NFormItem
label
=
{
t
(
'
password.password
'
)
}
path
=
'password'
>
<
NInput
type
=
'password'
placeholder
=
{
t
(
'
password.password_tips
'
)
}
v
-
model
=
{
[
passwordForm
.
password
,
'
value
'
]
}
onInput
=
{
handlePasswordInput
}
/>
</
NFormItem
>
<
NFormItem
label
=
{
t
(
'
password.confirm_password
'
)
}
path
=
'confirmPassword'
ref
=
'confirmPasswordItemFormRef'
>
<
NInput
type
=
'password'
placeholder
=
{
t
(
'
password.confirm_password_tips
'
)
}
v
-
model
=
{
[
passwordForm
.
confirmPassword
,
'
value
'
]
}
/>
</
NFormItem
>
</
NForm
>
<
NButton
disabled
=
{
!
passwordForm
.
password
||
!
passwordForm
.
confirmPassword
||
passwordForm
.
password
!==
passwordForm
.
confirmPassword
}
type
=
'info'
>
{
t
(
'
password.submit
'
)
}
</
NButton
>
</
div
>
),
}
}
</
Card
>
)
},
})
export
default
password
dolphinscheduler-ui-next/src/views/password/use-form.ts
0 → 100644
浏览文件 @
5c576297
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
{
reactive
,
ref
}
from
'
vue
'
import
{
useI18n
}
from
'
vue-i18n
'
import
type
{
FormRules
}
from
'
naive-ui
'
export
function
useForm
()
{
const
{
t
}
=
useI18n
()
const
state
=
reactive
({
passwordFormRef
:
ref
(),
confirmPasswordItemFormRef
:
ref
(),
passwordForm
:
{
password
:
''
,
confirmPassword
:
''
,
},
rules
:
{
password
:
{
required
:
true
,
message
:
t
(
'
password.password_tips
'
),
},
confirmPassword
:
[
{
required
:
true
,
message
:
t
(
'
password.confirm_password_tips
'
),
},
{
trigger
:
[
'
input
'
],
message
:
t
(
'
password.two_password_entries_are_inconsistent
'
),
validator
:
(
rule
:
any
,
value
:
string
):
any
=>
{
return
(
state
.
passwordForm
.
password
&&
state
.
passwordForm
.
password
.
startsWith
(
value
)
&&
state
.
passwordForm
.
password
.
length
>=
value
.
length
)
},
},
{
trigger
:
[
'
blur
'
,
'
password-input
'
],
message
:
t
(
'
password.two_password_entries_are_inconsistent
'
),
validator
:
(
rule
:
any
,
value
:
string
):
any
=>
{
return
state
.
passwordForm
.
password
===
value
},
},
],
}
as
FormRules
,
handlePasswordInput
:
()
=>
{
if
(
state
.
passwordForm
.
confirmPassword
)
{
state
.
confirmPasswordItemFormRef
.
value
.
validate
({
trigger
:
'
password-input
'
,
})
}
},
})
return
{
state
,
t
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录