<template>
  <CollapseContainer title="修改当前用户密码,修改成功后会自动退出当前登录！" :canExpan="false">
    <!-- <div class="flex flex-col items-center justify-center py-8 bg-white">
      <BasicForm @register="register" />
      <div class="flex justify-center">
        <a-button @click="resetFields"> 重置 </a-button>
        <a-button class="!ml-4" type="primary" @click="handleSubmit"> 确认 </a-button>
      </div>
    </div> -->
  </CollapseContainer>
</template>
<script lang="ts" setup>
  // import { CollapseContainer } from '/@/components/Container/index';
  // import { BasicForm, useForm } from '/@/components/Form';
  // import { formSchemaPwd } from './data';
  // import { updatePwd } from '/@/api/sys/sysUserApi';
  // import { useUserStore } from '/@/store/modules/user';
  // import { useMessage } from '/@/hooks/web/useMessage';

  // const userStore = useUserStore();
  // const { createMessage } = useMessage();
  // const [register, { validate, resetFields }] = useForm({
  //   size: 'large',
  //   labelWidth: 100,
  //   showActionButtonGroup: false,
  //   schemas: formSchemaPwd,
  // });

  // async function handleSubmit() {
  //   try {
  //     const values = await validate();
  //     console.log('🚀 ~ file: SecureSetting.vue ~ line 27 ~ handleSubmit ~ values', values);
  //     const { passwordOld, passwordNew } = values;

  //     // TODO custom api
  //     console.log(passwordOld, passwordNew);
  //     const data = {
  //       oldPass: passwordOld,
  //       newPass: passwordNew,
  //     };
  //     await updatePwd(data);
  //     createMessage.success('修改成功,请重新登录');
  //     setTimeout(() => {
  //       userStore.logout(true);
  //     }, 2000);
  //   } catch (error) {}
  // }
</script>
<style lang="less" scoped>
  .extra {
    float: right;
    margin-top: 10px;
    margin-right: 30px;
    font-weight: normal;
    color: #1890ff;
    cursor: pointer;
  }
</style>
