| | |
| | | |
| | | NProgress.configure({ showSpinner: false }) |
| | | |
| | | const whiteList = ['/login', '/register'] |
| | | const whiteList = ['/login', '/register', '/thirdpartylogin', '/logindemo'] |
| | | |
| | | const isWhiteList = (path) => { |
| | | return whiteList.some(pattern => isPathMatch(pattern, path)) |
| | |
| | | <router-link class="link-type" :to="'/register'">立即注册</router-link> |
| | | </div> |
| | | </el-form-item> |
| | | <el-button v-if="false" type="primary" plain @click="goLogin">集团集成登录</el-button> |
| | | <el-button v-if="true" type="primary" plain @click="goLogin">集团集成登录</el-button> |
| | | </el-form> |
| | | </div> |
| | | <!-- 底部 --> |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | SSO: window.location.hash |
| | | } |
| | | code: null // 用于存储获取到的 code 参数 |
| | | }; |
| | | }, |
| | | created() { |
| | | this.initLogin() |
| | | console.log(this.SSO) |
| | | this.initLogin(); |
| | | }, |
| | | methods: { |
| | | initLogin() { |
| | | const code = this.SSO.split('&')[0].split('=')[1] |
| | | console.log(code) |
| | | |
| | | if (code) { |
| | | this.$store.dispatch('LoginBySSO', code).then(() => { |
| | | this.$router.push({ path: '/' }) |
| | | }) |
| | | } |
| | | this.$store.dispatch('LoginBySSO', {code: this.$route.query.code}).then(() => { |
| | | this.$router.push({path: '/'}); |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | <style scoped></style> |
| | | <style scoped></style> |