<template>
  <div>
    <n-button v-if="validatePermission.includes('sys:permission:testOne')" @click="handleOne">这是按钮one</n-button>
    <n-button v-if="validatePermission.includes('sys:permission:testTwo')" @click="handleTwo">这是按钮two</n-button>
  </div>
</template>

<script>
import { usePermissionStore } from '@/store/modules/permission.js'
import { permissionOne, permissionTwo } from '@/api/auth/index.js'
import { computed } from 'vue'
import { signinRedirectCallback, signoutRedirectCallback, signoutRedirect, getPath, removePath } from '@/utils/oidc/index.js'
export default {
  name: 'StatisticalAnalysis',
  setup() {
    const { validatePermission } = usePermissionStore()
    const handleOne = async() => {
      const res = await permissionOne()
      alert(res)
    }
    const handleTwo = async() => {
      const res = await permissionTwo()
    }

    return {
      handleOne,
      handleTwo,
      validatePermission
    }
  }
}

</script>
<style scoped lang='scss'>
</style>
