fix: 调整修改密码逻辑(#1311)

This commit is contained in:
wangdan-fit2cloud 2024-10-25 16:47:17 +08:00 committed by wangdan-fit2cloud
parent 36efb58a05
commit a6e475a148
8 changed files with 64 additions and 39 deletions

View File

@ -6,10 +6,10 @@
:close-on-press-escape="false" :close-on-press-escape="false"
> >
<el-form <el-form
class="reset-password-form mb-24" class="reset-password-form"
ref="resetPasswordFormRef" ref="resetPasswordFormRef1"
:model="resetPasswordForm" :model="resetPasswordForm"
:rules="rules" :rules="rules1"
> >
<p class="mb-8 lighter">{{ $t('layout.topbar.avatar.dialog.newPassword') }}</p> <p class="mb-8 lighter">{{ $t('layout.topbar.avatar.dialog.newPassword') }}</p>
<el-form-item prop="password" style="margin-bottom: 8px"> <el-form-item prop="password" style="margin-bottom: 8px">
@ -32,6 +32,13 @@
> >
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-form>
<el-form
class="reset-password-form mb-24"
ref="resetPasswordFormRef2"
:model="resetPasswordForm"
:rules="rules2"
>
<p class="mb-8 lighter">{{ $t('layout.topbar.avatar.dialog.useEmail') }}</p> <p class="mb-8 lighter">{{ $t('layout.topbar.avatar.dialog.useEmail') }}</p>
<el-form-item style="margin-bottom: 8px"> <el-form-item style="margin-bottom: 8px">
<el-input <el-input
@ -97,21 +104,14 @@ const resetPasswordForm = ref<ResetCurrentUserPasswordRequest>({
re_password: '' re_password: ''
}) })
const resetPasswordFormRef = ref<FormInstance>() const resetPasswordFormRef1 = ref<FormInstance>()
const resetPasswordFormRef2 = ref<FormInstance>()
const loading = ref<boolean>(false) const loading = ref<boolean>(false)
const isDisabled = ref<boolean>(false) const isDisabled = ref<boolean>(false)
const time = ref<number>(60) const time = ref<number>(60)
const rules = ref<FormRules<ResetCurrentUserPasswordRequest>>({ const rules1 = ref<FormRules<ResetCurrentUserPasswordRequest>>({
// @ts-ignore
code: [
{
required: true,
message: t('layout.topbar.avatar.dialog.enterVerificationCode'),
trigger: 'blur'
}
],
password: [ password: [
{ {
required: true, required: true,
@ -149,15 +149,27 @@ const rules = ref<FormRules<ResetCurrentUserPasswordRequest>>({
} }
] ]
}) })
const rules2 = ref<FormRules<ResetCurrentUserPasswordRequest>>({
// @ts-ignore
code: [
{
required: true,
message: t('layout.topbar.avatar.dialog.enterVerificationCode'),
trigger: 'blur'
}
]
})
/** /**
* 发送验证码 * 发送验证码
*/ */
const sendEmail = () => { const sendEmail = () => {
resetPasswordFormRef1.value?.validate().then(() => {
UserApi.sendEmailToCurrent(loading).then(() => { UserApi.sendEmailToCurrent(loading).then(() => {
MsgSuccess(t('layout.topbar.avatar.dialog.verificationCodeSentSuccess')) MsgSuccess(t('layout.topbar.avatar.dialog.verificationCodeSentSuccess'))
isDisabled.value = true isDisabled.value = true
handleTimeChange() handleTimeChange()
}) })
})
} }
const handleTimeChange = () => { const handleTimeChange = () => {
@ -179,10 +191,12 @@ const open = () => {
re_password: '' re_password: ''
} }
resetPasswordDialog.value = true resetPasswordDialog.value = true
resetPasswordFormRef.value?.resetFields() resetPasswordFormRef1.value?.resetFields()
resetPasswordFormRef2.value?.resetFields()
} }
const resetPassword = () => { const resetPassword = () => {
resetPasswordFormRef.value resetPasswordFormRef1.value?.validate().then(() => {
resetPasswordFormRef2.value
?.validate() ?.validate()
.then(() => { .then(() => {
return UserApi.resetCurrentUserPassword(resetPasswordForm.value) return UserApi.resetCurrentUserPassword(resetPasswordForm.value)
@ -193,6 +207,7 @@ const resetPassword = () => {
.then(() => { .then(() => {
router.push({ name: 'login' }) router.push({ name: 'login' })
}) })
})
} }
const close = () => { const close = () => {
resetPasswordDialog.value = false resetPasswordDialog.value = false

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="workflow-publish-history border-l"> <div class="workflow-publish-history border-l">
<h4 class="border-b p-16-24">发布历史</h4> <h4 class="border-b p-16-24">发布历史</h4>
<div class="left-height pt-0"> <div class="list-height pt-0">
<el-scrollbar> <el-scrollbar>
<div class="p-8 pt-0"> <div class="p-8 pt-0">
<common-list <common-list
@ -137,5 +137,8 @@ onMounted(() => {
background: #ffffff; background: #ffffff;
height: calc(100vh - 57px); height: calc(100vh - 57px);
z-index: 9; z-index: 9;
.list-height {
height: calc(100vh - 120px);
}
} }
</style> </style>

View File

@ -199,10 +199,12 @@ function getHistortyDetail(versionId: string) {
res.data?.work_flow['nodes'].map((v: any) => { res.data?.work_flow['nodes'].map((v: any) => {
v['properties']['noRender'] = true v['properties']['noRender'] = true
}) })
detail.value.work_flow = res.data.work_flow
detail.value.stt_model_id = res.data.stt_model detail.value.stt_model_id = res.data.stt_model
detail.value.tts_model_id = res.data.tts_model detail.value.tts_model_id = res.data.tts_model
detail.value.tts_type = res.data.tts_type detail.value.tts_type = res.data.tts_type
saveTime.value = res.data?.update_time saveTime.value = res.data?.update_time
workflowRef.value?.renderGraphData()
}) })
} }

View File

@ -40,9 +40,9 @@
<el-row :gutter="12" v-loading="loading"> <el-row :gutter="12" v-loading="loading">
<el-col :span="12" v-for="(item, index) in filterData" :key="index" class="mb-16"> <el-col :span="12" v-for="(item, index) in filterData" :key="index" class="mb-16">
<CardCheckbox value-field="id" :data="item" v-model="checkList" @change="changeHandle"> <CardCheckbox value-field="id" :data="item" v-model="checkList" @change="changeHandle">
<span class="ellipsis"> <auto-tooltip :content="item.name" style="max-width: 170px">
{{ item.name }} {{ item.name }}
</span> </auto-tooltip>
</CardCheckbox> </CardCheckbox>
</el-col> </el-col>
</el-row> </el-row>

View File

@ -49,6 +49,10 @@ const graphData = computed({
const lf = ref() const lf = ref()
onMounted(() => { onMounted(() => {
renderGraphData()
})
const renderGraphData = () => {
const container: any = document.querySelector('#container') const container: any = document.querySelector('#container')
if (container) { if (container) {
lf.value = new LogicFlow({ lf.value = new LogicFlow({
@ -94,7 +98,7 @@ onMounted(() => {
lf.value?.fitView() lf.value?.fitView()
}, 500) }, 500)
} }
}) }
const validate = () => { const validate = () => {
return Promise.all(lf.value.graphModel.nodes.map((element: any) => element?.validate?.())) return Promise.all(lf.value.graphModel.nodes.map((element: any) => element?.validate?.()))
} }
@ -137,7 +141,8 @@ defineExpose({
validate, validate,
getGraphData, getGraphData,
addNode, addNode,
clearGraphData clearGraphData,
renderGraphData
}) })
</script> </script>
<style lang="scss"> <style lang="scss">

View File

@ -5,7 +5,7 @@
<el-icon class="mr-4"> <el-icon class="mr-4">
<Plus /> <Plus />
</el-icon> </el-icon>
添加参数 添加
</el-button> </el-button>
</div> </div>
<el-table <el-table

View File

@ -5,7 +5,7 @@
<el-icon class="mr-4"> <el-icon class="mr-4">
<Plus /> <Plus />
</el-icon> </el-icon>
添加参数 添加
</el-button> </el-button>
</div> </div>
<el-table <el-table

View File

@ -129,11 +129,12 @@
<span class="mr-4">语音播放</span> <span class="mr-4">语音播放</span>
<div> <div>
<el-button <el-button
v-if="form_data.tts_type === 'TTS'" v-if="form_data.tts_type === 'TTS' && form_data.tts_model_enable"
type="primary" type="primary"
link link
@click="openTTSParamSettingDialog" @click="openTTSParamSettingDialog"
:disabled="!form_data.tts_model_id" :disabled="!form_data.tts_model_id"
class="mr-4"
> >
<el-icon class="mr-4"> <el-icon class="mr-4">
<Setting /> <Setting />
@ -321,7 +322,6 @@ function ttsModelChange() {
} }
} }
const openTTSParamSettingDialog = () => { const openTTSParamSettingDialog = () => {
const model_id = form_data.value.tts_model_id const model_id = form_data.value.tts_model_id
if (!model_id) { if (!model_id) {