@blueking/paas-login

0.0.11 • Public • Published

参考用法

<template>
   <!-- success-url可以为本站的一个空白页,其内容见后面示例 -->
   <bk-paas-login ref="login" login-url="xxx" success-url="xxx"></bk-paas-login>
</template>

<script>
    import BkPaasLogin from '@blueking/paas-login'
    export default {
        components: { BkPaasLogin },
        mounted () {
            window.LoginModal = this.$refs.login
        }
    }
</script>
// api.js
axios.interceptors.response.use(response => { // some code }, error => {
    if (error.response && error.response.status === 401) {
       window.LoginModal.show()
    }
})
<!-- login_success.html -->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    <script>
        window.parent.location.reload()
    </script>
</body>
</html>

Readme

Keywords

none

Package Sidebar

Install

npm i @blueking/paas-login

Weekly Downloads

85

Version

0.0.11

License

none

Unpacked Size

13.1 kB

Total Files

6

Last publish

Collaborators

  • blueking