You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
1.9 KiB
67 lines
1.9 KiB
<template>
|
|
<BasicModal
|
|
:title="L('ManageSecret')"
|
|
@register="registerModal"
|
|
@ok="handleSubmit"
|
|
>
|
|
<BasicForm @register="registerForm" />
|
|
</BasicModal>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { reactive } from 'vue';
|
|
import { BasicForm, useForm } from '/@/components/Form';
|
|
import { BasicModal, useModalInner } from '/@/components/Modal';
|
|
import { useLocalization } from '/@/hooks/abp/useLocalization';
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
import { UpdateAsyncByIdAndInput } from '/@/api/openiddict/open-iddict-application';
|
|
import { OpenIddictApplicationUpdateDto } from '/@/api/openiddict/open-iddict-application/model';
|
|
|
|
const state = reactive<{
|
|
application: Recordable
|
|
}>({
|
|
application: {},
|
|
});
|
|
const emits = defineEmits(['change', 'register']);
|
|
const { createMessage } = useMessage();
|
|
const { L } = useLocalization(['AbpOpenIddict', 'AbpUi']);
|
|
const [registerForm, { validate, resetFields }] = useForm({
|
|
layout: 'vertical',
|
|
showActionButtonGroup: false,
|
|
schemas: [
|
|
{
|
|
field: 'clientSecret',
|
|
component: 'Input',
|
|
label: L('DisplayName:ClientSecret'),
|
|
colProps: { span: 24 },
|
|
required: true,
|
|
},
|
|
],
|
|
});
|
|
const [registerModal, { changeOkLoading, closeModal }] = useModalInner((data) => {
|
|
state.application = data;
|
|
});
|
|
|
|
function handleSubmit() {
|
|
validate().then((input) => {
|
|
changeOkLoading(true);
|
|
UpdateAsyncByIdAndInput(
|
|
state.application.id,
|
|
{
|
|
...state.application as OpenIddictApplicationUpdateDto,
|
|
clientSecret: input.clientSecret
|
|
}).then((dto) => {
|
|
createMessage.success(L('Successful'));
|
|
resetFields();
|
|
emits('change', dto);
|
|
closeModal();
|
|
}).finally(() => {
|
|
changeOkLoading(false);
|
|
});
|
|
});
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
|
|
</style>
|