Skip to content

Commit a6e475a

Browse files
fix: 调整修改密码逻辑(#1311)
1 parent 36efb58 commit a6e475a

File tree

8 files changed

+64
-39
lines changed

8 files changed

+64
-39
lines changed

ui/src/layout/components/top-bar/avatar/ResetPassword.vue

Lines changed: 44 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
:close-on-press-escape="false"
77
>
88
<el-form
9-
class="reset-password-form mb-24"
10-
ref="resetPasswordFormRef"
9+
class="reset-password-form"
10+
ref="resetPasswordFormRef1"
1111
:model="resetPasswordForm"
12-
:rules="rules"
12+
:rules="rules1"
1313
>
1414
<p class="mb-8 lighter">{{ $t('layout.topbar.avatar.dialog.newPassword') }}</p>
1515
<el-form-item prop="password" style="margin-bottom: 8px">
@@ -32,6 +32,13 @@
3232
>
3333
</el-input>
3434
</el-form-item>
35+
</el-form>
36+
<el-form
37+
class="reset-password-form mb-24"
38+
ref="resetPasswordFormRef2"
39+
:model="resetPasswordForm"
40+
:rules="rules2"
41+
>
3542
<p class="mb-8 lighter">{{ $t('layout.topbar.avatar.dialog.useEmail') }}</p>
3643
<el-form-item style="margin-bottom: 8px">
3744
<el-input
@@ -97,21 +104,14 @@ const resetPasswordForm = ref<ResetCurrentUserPasswordRequest>({
97104
re_password: ''
98105
})
99106
100-
const resetPasswordFormRef = ref<FormInstance>()
107+
const resetPasswordFormRef1 = ref<FormInstance>()
108+
const resetPasswordFormRef2 = ref<FormInstance>()
101109
102110
const loading = ref<boolean>(false)
103111
const isDisabled = ref<boolean>(false)
104112
const time = ref<number>(60)
105113
106-
const rules = ref<FormRules<ResetCurrentUserPasswordRequest>>({
107-
// @ts-ignore
108-
code: [
109-
{
110-
required: true,
111-
message: t('layout.topbar.avatar.dialog.enterVerificationCode'),
112-
trigger: 'blur'
113-
}
114-
],
114+
const rules1 = ref<FormRules<ResetCurrentUserPasswordRequest>>({
115115
password: [
116116
{
117117
required: true,
@@ -149,14 +149,26 @@ const rules = ref<FormRules<ResetCurrentUserPasswordRequest>>({
149149
}
150150
]
151151
})
152+
const rules2 = ref<FormRules<ResetCurrentUserPasswordRequest>>({
153+
// @ts-ignore
154+
code: [
155+
{
156+
required: true,
157+
message: t('layout.topbar.avatar.dialog.enterVerificationCode'),
158+
trigger: 'blur'
159+
}
160+
]
161+
})
152162
/**
153163
* 发送验证码
154164
*/
155165
const sendEmail = () => {
156-
UserApi.sendEmailToCurrent(loading).then(() => {
157-
MsgSuccess(t('layout.topbar.avatar.dialog.verificationCodeSentSuccess'))
158-
isDisabled.value = true
159-
handleTimeChange()
166+
resetPasswordFormRef1.value?.validate().then(() => {
167+
UserApi.sendEmailToCurrent(loading).then(() => {
168+
MsgSuccess(t('layout.topbar.avatar.dialog.verificationCodeSentSuccess'))
169+
isDisabled.value = true
170+
handleTimeChange()
171+
})
160172
})
161173
}
162174
@@ -179,20 +191,23 @@ const open = () => {
179191
re_password: ''
180192
}
181193
resetPasswordDialog.value = true
182-
resetPasswordFormRef.value?.resetFields()
194+
resetPasswordFormRef1.value?.resetFields()
195+
resetPasswordFormRef2.value?.resetFields()
183196
}
184197
const resetPassword = () => {
185-
resetPasswordFormRef.value
186-
?.validate()
187-
.then(() => {
188-
return UserApi.resetCurrentUserPassword(resetPasswordForm.value)
189-
})
190-
.then(() => {
191-
return user.logout()
192-
})
193-
.then(() => {
194-
router.push({ name: 'login' })
195-
})
198+
resetPasswordFormRef1.value?.validate().then(() => {
199+
resetPasswordFormRef2.value
200+
?.validate()
201+
.then(() => {
202+
return UserApi.resetCurrentUserPassword(resetPasswordForm.value)
203+
})
204+
.then(() => {
205+
return user.logout()
206+
})
207+
.then(() => {
208+
router.push({ name: 'login' })
209+
})
210+
})
196211
}
197212
const close = () => {
198213
resetPasswordDialog.value = false

ui/src/views/application-workflow/component/PublishHistory.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="workflow-publish-history border-l">
33
<h4 class="border-b p-16-24">发布历史</h4>
4-
<div class="left-height pt-0">
4+
<div class="list-height pt-0">
55
<el-scrollbar>
66
<div class="p-8 pt-0">
77
<common-list
@@ -137,5 +137,8 @@ onMounted(() => {
137137
background: #ffffff;
138138
height: calc(100vh - 57px);
139139
z-index: 9;
140+
.list-height {
141+
height: calc(100vh - 120px);
142+
}
140143
}
141144
</style>

ui/src/views/application-workflow/index.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ function clickoutsideHistory() {
180180
}
181181
182182
function refreshVersion(item?: any) {
183-
if (item) {
183+
if (item) {
184184
getHistortyDetail(item.id)
185185
}
186186
initInterval()
@@ -199,10 +199,12 @@ function getHistortyDetail(versionId: string) {
199199
res.data?.work_flow['nodes'].map((v: any) => {
200200
v['properties']['noRender'] = true
201201
})
202+
detail.value.work_flow = res.data.work_flow
202203
detail.value.stt_model_id = res.data.stt_model
203204
detail.value.tts_model_id = res.data.tts_model
204205
detail.value.tts_type = res.data.tts_type
205206
saveTime.value = res.data?.update_time
207+
workflowRef.value?.renderGraphData()
206208
})
207209
}
208210

ui/src/views/application/component/AddDatasetDialog.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@
4040
<el-row :gutter="12" v-loading="loading">
4141
<el-col :span="12" v-for="(item, index) in filterData" :key="index" class="mb-16">
4242
<CardCheckbox value-field="id" :data="item" v-model="checkList" @change="changeHandle">
43-
<span class="ellipsis">
43+
<auto-tooltip :content="item.name" style="max-width: 170px">
4444
{{ item.name }}
45-
</span>
45+
</auto-tooltip>
4646
</CardCheckbox>
4747
</el-col>
4848
</el-row>

ui/src/workflow/index.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ const graphData = computed({
4949
5050
const lf = ref()
5151
onMounted(() => {
52+
renderGraphData()
53+
})
54+
55+
const renderGraphData = () => {
5256
const container: any = document.querySelector('#container')
5357
if (container) {
5458
lf.value = new LogicFlow({
@@ -94,7 +98,7 @@ onMounted(() => {
9498
lf.value?.fitView()
9599
}, 500)
96100
}
97-
})
101+
}
98102
const validate = () => {
99103
return Promise.all(lf.value.graphModel.nodes.map((element: any) => element?.validate?.()))
100104
}
@@ -137,7 +141,8 @@ defineExpose({
137141
validate,
138142
getGraphData,
139143
addNode,
140-
clearGraphData
144+
clearGraphData,
145+
renderGraphData
141146
})
142147
</script>
143148
<style lang="scss">

ui/src/workflow/nodes/base-node/component/ApiInputFieldTable.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<el-icon class="mr-4">
66
<Plus />
77
</el-icon>
8-
添加参数
8+
添加
99
</el-button>
1010
</div>
1111
<el-table

ui/src/workflow/nodes/base-node/component/UserInputFieldTable.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<el-icon class="mr-4">
66
<Plus />
77
</el-icon>
8-
添加参数
8+
添加
99
</el-button>
1010
</div>
1111
<el-table

ui/src/workflow/nodes/base-node/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,12 @@
129129
<span class="mr-4">语音播放</span>
130130
<div>
131131
<el-button
132-
v-if="form_data.tts_type === 'TTS'"
132+
v-if="form_data.tts_type === 'TTS' && form_data.tts_model_enable"
133133
type="primary"
134134
link
135135
@click="openTTSParamSettingDialog"
136136
:disabled="!form_data.tts_model_id"
137+
class="mr-4"
137138
>
138139
<el-icon class="mr-4">
139140
<Setting />
@@ -321,7 +322,6 @@ function ttsModelChange() {
321322
}
322323
}
323324
324-
325325
const openTTSParamSettingDialog = () => {
326326
const model_id = form_data.value.tts_model_id
327327
if (!model_id) {

0 commit comments

Comments
 (0)