<template>
  <div>
     <el-popconfirm
      title="确定重置当前账号密码吗？"
      @confirm="resetPassword()">
       <el-button type="text" slot="reference" size="small" style="margin:-4px 0 0 10px">重置</el-button>
    </el-popconfirm>
  </div>
</template>

<script>
export default {
  methods:{
    async resetPassword () {
      const res = await this.$api.requested({
        "classname": "webmanage.users.users",
        "method": "resetPassword",
        "content": {
            "userid": this.$route.query.id
        }
      })
      if (res.code === 0) return this.$notify({
        title:'失败',
        message:res.data,
        type:'error'
      })
      this.$notify({
        title:'成功',
        message:'密码已重置为站点默认密码',
        type:'success'
      })
    }
  }
}

</script>
<style>
</style>