1.vue微博回调空页面
注:微博回调空页面为: http://127.0.0.1:8888/oauth/callback/
1.1 页面路径components\oauth.vue
<template> <div> <p>跳转中....</p> </div> </template> <script> import { oauth_callback_post } from './axios_api/api' export default { mounted() { this.getCode() }, methods: { getCode() { let code = this.$route.query.code console.log(this.$route.query) let params = { code: code } oauth_callback_post(params).then((resp) => { console.log(resp) if (resp.data.type == '0') { let res = resp.data localStorage.setItem('username', res.username) // localStorage.setItem('img', res.img) localStorage.setItem('token', res.token) localStorage.setItem('uid', res.id) this.login_username = res.username this.opened = false // alert(res.message) this.$router.push('/') } if (resp.data.type == '1') { this.visiable = true this.uid = resp.data.uid } }) }, } } </script>