摘要:
页面路径components/oauth.vue <template> <div> <div v-show='visiable'> 绑定用户 用户名:<input type='text' v-model='username' @blur='check_username'> <span>{{usern 阅读全文
posted @ 2020-10-11 21:27
CefiLing
阅读(149)
评论(0)
推荐(0)
摘要:
oauth/urls.py中添加路由 urlpatterns = [ path('weibo/binduser/', views.OauthWeiboBindUser.as_view()), # /oauth/weibo/callback/] oauth/views.py中添加视图函数 class 阅读全文
posted @ 2020-10-11 21:25
CefiLing
阅读(109)
评论(0)
推荐(0)
摘要:
微博回调空页面为:http://127.0.0.1:8888/oauth/callback/ 页面路径components/oauth.vue <template> <div> <p>跳转中...</p> </div></template><script>import {oauth_callback 阅读全文
posted @ 2020-10-11 21:24
CefiLing
阅读(88)
评论(0)
推荐(0)
摘要:
oauth/urls/py 中添加路由 urlpatterns = [ path('weibo/callback'/, views.OauthWeiboCallback.as_view()), # /oauth/weibo/callback] oauth/views.py中添加视图函数 http:/ 阅读全文
posted @ 2020-10-11 21:22
CefiLing
阅读(99)
评论(0)
推荐(0)
摘要:
在components/common/lab_header.vue中写oauth动态获取微博授权URL # 获取微博登录地址oauth(){ # 从后端获取 微博登录地址 oauth_post().then((resp) => { console.log(resp) # {'code':'0', ' 阅读全文
posted @ 2020-10-11 21:18
CefiLing
阅读(70)
评论(0)
推荐(0)
摘要:
创建apps/oauth模块进行oauth认证 '''2.1 在apps文件夹下新建应用: oauth'''cd syl/appspyhton ../manage.py startapp oauth'''2.2 添加子路由: oauth/urls.py'''from django.urls imp 阅读全文
posted @ 2020-10-11 21:17
CefiLing
阅读(77)
评论(0)
推荐(0)
摘要:
新浪微博开放平台:https://open.weibo.com/ 注册账号 接口文档 https://open.weibo.com/wiki/授权机制说明 阅读全文
posted @ 2020-10-11 21:16
CefiLing
阅读(676)
评论(0)
推荐(0)
摘要:
微博三方登录流程 前端获取认证code 1. 在Vue页面加载时,动态发送请求获取微博授权url2. django收到请求的url后, 通过微博应用ID(client_id)和回调地址(redirect_url)动态生成授权url返回给Vue3. 当用户点击上面的url进行扫码,授权成功会跳转我们的 阅读全文
posted @ 2020-10-11 21:07
CefiLing
阅读(120)
评论(0)
推荐(0)

浙公网安备 33010602011771号