zoukankan      html  css  js  c++  java
  • vue获取博客授权url

    1.Vue页面加载时动态发送请求获取微博授权url

    1.1 componentscommonlab_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 vuemounted函数中调用获取微博授权url函数

    mounted() { 
    	this.oauth() 
    }, 
    

    1.3 点击"登录"弹出的form表单中加入url

    <form 
          action="/login" 
          method="post"
     > 
    	<div class="form-group widget-signin"> 
    		<a :href="weibo_url"><i class="fa fa-weibo"></i></a> 
        </div> 
    </form>
    
  • 相关阅读:
    有点难度的二分
    请教神牛_字符串hash
    引水进城
    dp的斜率优化
    关于学习oi的一些事项
    永续债
    消费税
    增值税
    BSC交流
    钉钉吐槽功能点
  • 原文地址:https://www.cnblogs.com/chao460/p/13800470.html
Copyright © 2011-2022 走看看