Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 44 additions & 29 deletions ui/src/layout/components/top-bar/avatar/ResetPassword.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
:close-on-press-escape="false"
>
<el-form
class="reset-password-form mb-24"
ref="resetPasswordFormRef"
class="reset-password-form"
ref="resetPasswordFormRef1"
:model="resetPasswordForm"
:rules="rules"
:rules="rules1"
>
<p class="mb-8 lighter">{{ $t('layout.topbar.avatar.dialog.newPassword') }}</p>
<el-form-item prop="password" style="margin-bottom: 8px">
Expand All @@ -32,6 +32,13 @@
>
</el-input>
</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>
<el-form-item style="margin-bottom: 8px">
<el-input
Expand Down Expand Up @@ -97,21 +104,14 @@ const resetPasswordForm = ref<ResetCurrentUserPasswordRequest>({
re_password: ''
})

const resetPasswordFormRef = ref<FormInstance>()
const resetPasswordFormRef1 = ref<FormInstance>()
const resetPasswordFormRef2 = ref<FormInstance>()

const loading = ref<boolean>(false)
const isDisabled = ref<boolean>(false)
const time = ref<number>(60)

const rules = ref<FormRules<ResetCurrentUserPasswordRequest>>({
// @ts-ignore
code: [
{
required: true,
message: t('layout.topbar.avatar.dialog.enterVerificationCode'),
trigger: 'blur'
}
],
const rules1 = ref<FormRules<ResetCurrentUserPasswordRequest>>({
password: [
{
required: true,
Expand Down Expand Up @@ -149,14 +149,26 @@ 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 = () => {
UserApi.sendEmailToCurrent(loading).then(() => {
MsgSuccess(t('layout.topbar.avatar.dialog.verificationCodeSentSuccess'))
isDisabled.value = true
handleTimeChange()
resetPasswordFormRef1.value?.validate().then(() => {
UserApi.sendEmailToCurrent(loading).then(() => {
MsgSuccess(t('layout.topbar.avatar.dialog.verificationCodeSentSuccess'))
isDisabled.value = true
handleTimeChange()
})
})
}

Expand All @@ -179,20 +191,23 @@ const open = () => {
re_password: ''
}
resetPasswordDialog.value = true
resetPasswordFormRef.value?.resetFields()
resetPasswordFormRef1.value?.resetFields()
resetPasswordFormRef2.value?.resetFields()
}
const resetPassword = () => {
resetPasswordFormRef.value
?.validate()
.then(() => {
return UserApi.resetCurrentUserPassword(resetPasswordForm.value)
})
.then(() => {
return user.logout()
})
.then(() => {
router.push({ name: 'login' })
})
resetPasswordFormRef1.value?.validate().then(() => {
resetPasswordFormRef2.value
?.validate()
.then(() => {
return UserApi.resetCurrentUserPassword(resetPasswordForm.value)
})
.then(() => {
return user.logout()
})
.then(() => {
router.push({ name: 'login' })
})
})
}
const close = () => {
resetPasswordDialog.value = false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="workflow-publish-history border-l">
<h4 class="border-b p-16-24">发布历史</h4>
<div class="left-height pt-0">
<div class="list-height pt-0">
<el-scrollbar>
<div class="p-8 pt-0">
<common-list
Expand Down Expand Up @@ -137,5 +137,8 @@ onMounted(() => {
background: #ffffff;
height: calc(100vh - 57px);
z-index: 9;
.list-height {
height: calc(100vh - 120px);
}
}
</style>
4 changes: 3 additions & 1 deletion ui/src/views/application-workflow/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ function clickoutsideHistory() {
}

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

Expand Down
4 changes: 2 additions & 2 deletions ui/src/views/application/component/AddDatasetDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
<el-row :gutter="12" v-loading="loading">
<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">
<span class="ellipsis">
<auto-tooltip :content="item.name" style="max-width: 170px">
{{ item.name }}
</span>
</auto-tooltip>
</CardCheckbox>
</el-col>
</el-row>
Expand Down
9 changes: 7 additions & 2 deletions ui/src/workflow/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ const graphData = computed({

const lf = ref()
onMounted(() => {
renderGraphData()
})

const renderGraphData = () => {
const container: any = document.querySelector('#container')
if (container) {
lf.value = new LogicFlow({
Expand Down Expand Up @@ -94,7 +98,7 @@ onMounted(() => {
lf.value?.fitView()
}, 500)
}
})
}
const validate = () => {
return Promise.all(lf.value.graphModel.nodes.map((element: any) => element?.validate?.()))
}
Expand Down Expand Up @@ -137,7 +141,8 @@ defineExpose({
validate,
getGraphData,
addNode,
clearGraphData
clearGraphData,
renderGraphData
})
</script>
<style lang="scss">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<el-icon class="mr-4">
<Plus />
</el-icon>
添加参数
添加
</el-button>
</div>
<el-table
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<el-icon class="mr-4">
<Plus />
</el-icon>
添加参数
添加
</el-button>
</div>
<el-table
Expand Down
4 changes: 2 additions & 2 deletions ui/src/workflow/nodes/base-node/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,12 @@
<span class="mr-4">语音播放</span>
<div>
<el-button
v-if="form_data.tts_type === 'TTS'"
v-if="form_data.tts_type === 'TTS' && form_data.tts_model_enable"
type="primary"
link
@click="openTTSParamSettingDialog"
:disabled="!form_data.tts_model_id"
class="mr-4"
>
<el-icon class="mr-4">
<Setting />
Expand Down Expand Up @@ -321,7 +322,6 @@ function ttsModelChange() {
}
}


const openTTSParamSettingDialog = () => {
const model_id = form_data.value.tts_model_id
if (!model_id) {
Expand Down
Loading