mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
fix: 调整修改密码逻辑(#1311)
This commit is contained in:
parent
36efb58a05
commit
a6e475a148
|
|
@ -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">
|
||||
|
|
@ -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
|
||||
|
|
@ -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,
|
||||
|
|
@ -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()
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -137,5 +137,8 @@ onMounted(() => {
|
|||
background: #ffffff;
|
||||
height: calc(100vh - 57px);
|
||||
z-index: 9;
|
||||
.list-height {
|
||||
height: calc(100vh - 120px);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ function clickoutsideHistory() {
|
|||
}
|
||||
|
||||
function refreshVersion(item?: any) {
|
||||
if (item) {
|
||||
if (item) {
|
||||
getHistortyDetail(item.id)
|
||||
}
|
||||
initInterval()
|
||||
|
|
@ -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()
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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({
|
||||
|
|
@ -94,7 +98,7 @@ onMounted(() => {
|
|||
lf.value?.fitView()
|
||||
}, 500)
|
||||
}
|
||||
})
|
||||
}
|
||||
const validate = () => {
|
||||
return Promise.all(lf.value.graphModel.nodes.map((element: any) => element?.validate?.()))
|
||||
}
|
||||
|
|
@ -137,7 +141,8 @@ defineExpose({
|
|||
validate,
|
||||
getGraphData,
|
||||
addNode,
|
||||
clearGraphData
|
||||
clearGraphData,
|
||||
renderGraphData
|
||||
})
|
||||
</script>
|
||||
<style lang="scss">
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<el-icon class="mr-4">
|
||||
<Plus />
|
||||
</el-icon>
|
||||
添加参数
|
||||
添加
|
||||
</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<el-icon class="mr-4">
|
||||
<Plus />
|
||||
</el-icon>
|
||||
添加参数
|
||||
添加
|
||||
</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
|
|
|
|||
|
|
@ -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 />
|
||||
|
|
@ -321,7 +322,6 @@ function ttsModelChange() {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
const openTTSParamSettingDialog = () => {
|
||||
const model_id = form_data.value.tts_model_id
|
||||
if (!model_id) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue