04.vue获取微博授权URL
2020-12-25 07:27
阅读:510
标签:pos his 登录 component 成功 bsp 动态 comm orm
1.在Vue页面加载时动态发送请求获取微博授权url
1.1 在 components\common\lab_header.vue 中写oauth动态获取微
博授权URL
// 获取微博登录地址 oauth() { // 从后端获取 微博登录地址 oauth_post().then((resp) => { console.log(resp) //{‘code‘: ‘0‘, ‘msg‘: ‘成功‘, ‘data‘: {‘url‘: url}} let url = resp.data.url; this.weibo_url = url; }) },
1.2 在vue的mounted函数中调用获取微博授权url函数
mounted() { this.oauth() }
1.3 点击"登录"弹出的form表单中加入url
form action="/login" method="post" >
04.vue获取微博授权URL
标签:pos his 登录 component 成功 bsp 动态 comm orm
原文地址:https://www.cnblogs.com/shensy/p/13933511.html
评论
亲,登录后才可以留言!