<template>
  <el-card class="box-card" style="width:800px;" size="small">
    <!-- <div slot="header" class="clearfix">
      <span>Security</span>
    </div> -->
    <div>
      <el-button type="danger" @click="handleReset">{{$t('admin:reset')}}</el-button>
    </div>
  </el-card>
</template>
<script>
import { resetPassword } from '@/api/admin'
export default {
  name: 'Account',
  props: {
    userId: { type: String, default: '' }
  },
  methods: {
    handleReset() {
      this.$confirm(this.$t('admin:message:password'), {
        type: 'warning',
        distinguishCancelAndClose: true,
      })
        .then(() => {
          resetPassword(this.userId).then(res => {
            if (res.IsSuccess) {
              this.$message({
                message: this.$t('trials:adRules:message:msg7'),
                type: 'success'
              })
            }
          })
        })
    }
  }
}
</script>
