国产亚洲精品福利在线无卡一,国产精久久一区二区三区,亚洲精品无码国模,精品久久久久久无码专区不卡

當(dāng)前位置: 首頁 > news >正文

直播app開發(fā)一個(gè)需要多少錢整站優(yōu)化報(bào)價(jià)

直播app開發(fā)一個(gè)需要多少錢,整站優(yōu)化報(bào)價(jià),制作網(wǎng)頁一般需要兼容哪些網(wǎng)站,做網(wǎng)站水晶頭官方:地址 標(biāo)題 出現(xiàn)的問題解決后效果正常使用(按照官網(wǎng)的流程進(jìn)行使用)自己的理解(路人可忽略該內(nèi)容!) 出現(xiàn)的問題 1692861955468 解決后效果 1692861665687 正常使用(按照官網(wǎng)的流程進(jìn)行使用) fn.js 該文件就是釘釘官網(wǎng)的js文件,我下載到了…

官方:地址

標(biāo)題

  • 出現(xiàn)的問題
  • 解決后效果
  • 正常使用(按照官網(wǎng)的流程進(jìn)行使用)
  • 自己的理解(路人可忽略該內(nèi)容!)

出現(xiàn)的問題

1692861955468

解決后效果

1692861665687

正常使用(按照官網(wǎng)的流程進(jìn)行使用)

fn.js
該文件就是釘釘官網(wǎng)的js文件,我下載到了本地
js文件下載地址

!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1382)}({1382:function(e,t){var r=function(e,t){var r=e.match(new RegExp("[?&]"+t+"=([^&]+)"));return r?r[1]:null};window.DTFrameLogin=function(e,t,n,o){var i,u=e.id&&document.getElementById(e.id)||null,c=document.createElement("iframe");t.client_id&&t.redirect_uri&&t.response_type&&t.scope?u?(u.innerHTML="",u.appendChild(c),c&&c.contentWindow&&c.contentWindow.postMessage&&window.addEventListener?(c.src="https://"+((i=t).isPre?"pre-login":"login")+".dingtalk.com/oauth2/auth?iframe=true&redirect_uri="+i.redirect_uri+"&response_type="+i.response_type+"&client_id="+i.client_id+"&scope="+i.scope+(i.prompt?"&prompt="+i.prompt:"")+(i.state?"&state="+i.state:"")+(i.org_type?"&org_type="+i.org_type:"")+(i.corpId?"&corpId="+i.corpId:"")+(i.exclusiveLogin?"&exclusiveLogin="+i.exclusiveLogin:"")+(i.exclusiveCorpId?"&exclusiveCorpId="+i.exclusiveCorpId:""),c.width=""+(e.width||300),c.height=""+(e.height||300),c.frameBorder="0",c.scrolling="no",window.addEventListener("message",(function(e){var t=e.data,i=e.origin;if(/login\.dingtalk\.com/.test(i)&&t)if(t.success&&t.redirectUrl){var u=t.redirectUrl,c=r(u,"authCode")||"",d=r(u,"state")||"",s=r(u,"error")||"";c?n&&n({redirectUrl:u,authCode:c,state:d}):o&&o(s)}else o&&o(t.errorMsg)}))):o&&o("Browser not support")):o&&o("Element not found"):o&&o("Missing parameters")}}});

util.js
這個(gè)文件就是按照釘釘文檔的流程編寫的代碼

//釘釘js文件地址
import './fn.js'
//跳轉(zhuǎn)地址,需要在釘釘后臺(tái)提前配置好,暫時(shí)未用到
const url = location.origin + '/#/'
export const BASE_URL = encodeURIComponent(url);
const appid_default = 'xxxxxx' //填寫自己的釘釘應(yīng)用id
const state_default = 'PC'const fn = () => {console.log('默認(rèn)的回調(diào)');
}//INIT_DINDING 生成釘釘二維碼 傳遞兩個(gè)參數(shù)
//參數(shù)一,html標(biāo)簽id,該標(biāo)簽用來渲染二維碼
//參數(shù)二,回調(diào),在掃碼完成后,進(jìn)行的操作
export const INIT_DINDING = (id = "qr_code_div", callback = fn) => {const demo = new window.DTFrameLogin({id,width: 300,//二維碼寬度height: 300,//二維碼高度},{client_id: appid_default,redirect_uri: BASE_URL,client_id: appid_default,scope: 'openid',response_type: 'code',state: state_default,prompt: 'consent',},(loginResult) => {// const { redirectUrl, authCode, state } = loginResult;//loginResult字段說明____________________________//redirectUrl  重定向的地址//authCode     !!!很重要,這個(gè)就是釘釘返回的唯一標(biāo)識(shí)//state        我上面寫的PC,因此這個(gè)值就是PC,用來以后區(qū)別pc和app// 這里可以直接進(jìn)行重定向// window.location.href = redirectUrl;// 也可以在不跳轉(zhuǎn)頁面的情況下,使用code進(jìn)行授權(quán)//——————————————觸發(fā)回調(diào)————————————————————————————————————callback && callback(loginResult)return},)
}

edit.vue
封裝出現(xiàn)二維碼的組件

<template><div><div class="qr_code_div" ref="qrCodeDiv" id="qr_code_div"></div></div>
</template>
<script>
//看準(zhǔn)你自己的文件地址---------------
import { INIT_DINDING, SET_MESSAGE } from "./util.js";
export default {data() {return {};},mounted() {INIT_DINDING("qr_code_div",function () {console.log("this__________________這是掃碼的回調(diào)");// fn=null});},created() {},methods: {},beforeDestroy(){}
};
</script>
<style lang="scss" scoped>
.qr_code_div {width: 300px;height: 300px;margin: 0 auto;
}
</style>

app.vue
使用組件

<template><div><button @click='blg = !blg'>{{blg}}</button><edit v-if="blg"></edit></div>
</template>
<script>
import edit from './edit'
export default {data() {return {blg:true};},components:{edit},mounted() {},created() {},methods: {},
};
</script>
<style lang="scss" scoped>
</style>```**按照上面的流程便可以正常的在h5使用釘釘?shù)膾叽a組件了**#  修改后使用(解決方式)
##  **解決組件關(guān)閉后,多次開啟組件會(huì)產(chǎn)生多個(gè)回調(diào)的bug**
在上方的edit.vue組件中進(jìn)行修改```html
<template><div><div class="qr_code_div" ref="qrCodeDiv" id="qr_code_div"></div></div>
</template>
<script>
import { INIT_DINDING, SET_MESSAGE } from "../utils/init";
//1、步驟一
//修改之前的匿名回調(diào)
let fn = function () {console.log("this__________________這是掃碼的回調(diào)");//2、步驟二//回調(diào)執(zhí)行后把函數(shù)置空fn = null;
};
export default {data() {return {};},mounted() {//3、步驟三,傳遞修改后的回調(diào)INIT_DINDING("qr_code_div", fn);},created() {},methods: {},beforeDestroy() {//4、步驟四---組件銷毀也把函數(shù)置空fn = null;},
};
</script>
<style lang="scss" scoped>
.qr_code_div {width: 300px;height: 300px;margin: 0 auto;
}
</style>

自己的理解(路人可忽略該內(nèi)容!)

查看釘釘?shù)拇虬蟮脑创a,發(fā)現(xiàn)是通過綁定message監(jiān)聽來接受回調(diào)的
其實(shí)還有另外一種,就是在message事件執(zhí)行后,立即取消綁定,只讓他執(zhí)行一次
但是考慮到是匿名事件,并且是打包后的代碼,并沒有進(jìn)行更改
就使用了另一種方法,也就是上訴的方法
釘釘源碼

! function (e) {var t = {};function r(n) {if (t[n]) return t[n].exports;var o = t[n] = {i: n,l: !1,exports: {}};return e[n].call(o.exports, o, o.exports, r), o.l = !0, o.exports}r.m = e, r.c = t, r.d = function (e, t, n) {r.o(e, t) || Object.defineProperty(e, t, {enumerable: !0,get: n})}, r.r = function (e) {"undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, {value: "Module"}), Object.defineProperty(e, "__esModule", {value: !0})}, r.t = function (e, t) {if (1 & t && (e = r(e)), 8 & t) return e;if (4 & t && "object" == typeof e && e && e.__esModule) return e;var n = Object.create(null);if (r.r(n), Object.defineProperty(n, "default", {enumerable: !0,value: e}), 2 & t && "string" != typeof e)for (var o in e) r.d(n, o, function (t) {return e[t]}.bind(null, o));return n}, r.n = function (e) {var t = e && e.__esModule ? function () {return e.default} : function () {return e};return r.d(t, "a", t), t}, r.o = function (e, t) {return Object.prototype.hasOwnProperty.call(e, t)}, r.p = "", r(r.s = 1382)
}({1382: function (e, t) {var r = function (e, t) {var r = e.match(new RegExp("[?&]" + t + "=([^&]+)"));return r ? r[1] : null};window.DTFrameLogin = function (e, t, n, o) {var i, u = e.id && document.getElementById(e.id) || null,c = document.createElement("iframe");t.client_id && t.redirect_uri && t.response_type && t.scope ? u ? (u.innerHTML = "", u.appendChild(c), c && c.contentWindow && c.contentWindow.postMessage && window.addEventListener ? (c.src = "https://" + ((i = t).isPre ? "pre-login" : "login") + ".dingtalk.com/oauth2/auth?iframe=true&redirect_uri=" + i.redirect_uri + "&response_type=" + i.response_type + "&client_id=" + i.client_id + "&scope=" + i.scope + (i.prompt ? "&prompt=" + i.prompt : "") + (i.state ? "&state=" + i.state : "") + (i.org_type ? "&org_type=" + i.org_type : "") + (i.corpId ? "&corpId=" + i.corpId : "") + (i.exclusiveLogin ? "&exclusiveLogin=" + i.exclusiveLogin : "") + (i.exclusiveCorpId ? "&exclusiveCorpId=" + i.exclusiveCorpId : ""), c.width = "" + (e.width || 300), c.height = "" + (e.height || 300), c.frameBorder = "0", c.scrolling = "no", window.addEventListener("message", (function (e) {var t = e.data,i = e.origin;//這里這里-------------------------------看上面👆if (/login\.dingtalk\.com/.test(i) && t)if (t.success && t.redirectUrl) {var u = t.redirectUrl,c = r(u, "authCode") || "",d = r(u, "state") || "",s = r(u, "error") || "";c ? n && n({redirectUrl: u,authCode: c,state: d}) : o && o(s)} else o && o(t.errorMsg)}))) : o && o("Browser not support")) : o && o("Element not found") : o && o("Missing parameters")}}
});
http://m.aloenet.com.cn/news/41278.html

相關(guān)文章:

  • 網(wǎng)頁制作要多少錢長(zhǎng)沙seo工作室
  • 網(wǎng)站外包合作網(wǎng)絡(luò)優(yōu)化報(bào)告
  • 鄭州做網(wǎng)站齒輪廣州網(wǎng)絡(luò)營(yíng)銷選擇
  • 餐飲公司網(wǎng)站建設(shè)策劃書網(wǎng)絡(luò)營(yíng)銷管理
  • 科汛kesioncms網(wǎng)站系統(tǒng)長(zhǎng)春百度網(wǎng)站優(yōu)化
  • 商融建設(shè)集團(tuán)有限公司網(wǎng)站廣州網(wǎng)站seo推廣
  • wordpress模版怎么上傳寧波關(guān)鍵詞優(yōu)化企業(yè)網(wǎng)站建設(shè)
  • 西安做網(wǎng)站公無憂seo博客
  • 做網(wǎng)站需要學(xué)習(xí)多久域名被墻查詢
  • 公司網(wǎng)站制作多少錢好用的磁力搜索引擎
  • 電影網(wǎng)頁制作素材刷關(guān)鍵詞排名seo軟件
  • 網(wǎng)費(fèi)一年多少錢優(yōu)化設(shè)計(jì)電子版在哪找
  • 南京做網(wǎng)站建設(shè)有哪些內(nèi)容做百度推廣多少錢
  • 東莞網(wǎng)站推廣公司建站abc官方網(wǎng)站
  • 上海網(wǎng)站設(shè)計(jì)銷售營(yíng)銷方案100例
  • 項(xiàng)目宣傳網(wǎng)站模板百度最新版本2022
  • 做wap網(wǎng)站能火嗎合肥網(wǎng)站
  • 網(wǎng)站維護(hù)一年多少費(fèi)收錄排名好的發(fā)帖網(wǎng)站
  • 網(wǎng)站地址欄圖標(biāo)制作企業(yè)高管培訓(xùn)課程有哪些
  • 做酒店管理網(wǎng)站的作用成都網(wǎng)絡(luò)推廣外包
  • wordpress 眾籌模板seo效果最好的是
  • 做百度推廣需要網(wǎng)站嗎單頁站好做seo嗎
  • 大氣網(wǎng)站背景圖怎么快速推廣自己的產(chǎn)品
  • 個(gè)人網(wǎng)站開發(fā)淘寶指數(shù)查詢官網(wǎng)
  • 個(gè)人網(wǎng)站怎么做微信支付一個(gè)企業(yè)該如何進(jìn)行網(wǎng)絡(luò)營(yíng)銷
  • 西安網(wǎng)站建設(shè)哪個(gè)平臺(tái)好百度搜索seo
  • 北京網(wǎng)站建設(shè)有哪些深圳搜索引擎優(yōu)化推廣
  • 有什么網(wǎng)站可以做搜索引擎調(diào)詞平臺(tái)
  • 上海建設(shè)工程造價(jià)協(xié)會(huì)官網(wǎng)班級(jí)優(yōu)化大師怎么下載
  • 網(wǎng)站建設(shè)佰首選金手指二六職業(yè)培訓(xùn)機(jī)構(gòu)哪家最好