This commit is contained in:
parent
5d63c6dd1b
commit
2f40d42607
|
@ -103,7 +103,7 @@
|
|||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { reactive, ref, onMounted, onBeforeUnmount, nextTick } from "vue";
|
||||
import { reactive, ref, onMounted, onBeforeUnmount } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { ElMessage } from "element-plus";
|
||||
import tools from "@/utils/tools";
|
||||
|
@ -248,6 +248,9 @@ const inputChange = (index, e) => {
|
|||
};
|
||||
|
||||
const backSpace = (index, e) => {
|
||||
|
||||
console.log(e)
|
||||
|
||||
aCheckCodeInputComputedRef.value.children[
|
||||
index - 1
|
||||
].children[0].children[0].children[0].focus();
|
||||
|
@ -288,7 +291,6 @@ const scanLogin = reactive({
|
|||
zzd_client_id: "",
|
||||
scanUrl: "",
|
||||
code: "",
|
||||
|
||||
});
|
||||
onMounted(() => {
|
||||
scanLogin.scanUrl = `https://login.dg-work.cn/oauth2/auth.htm?response_type=code&client_id=${scanLogin.zydd_client_id}&redirect_uri=${scanLogin.redirect_uri}&scope=get_user_info&authType=QRCODE&embedMode=true`;
|
||||
|
@ -296,60 +298,14 @@ onMounted(() => {
|
|||
});
|
||||
// 解除监听
|
||||
onBeforeUnmount(() => {
|
||||
window.removeEventListener('message', loginListener)
|
||||
})
|
||||
|
||||
const loginListener = () => {
|
||||
|
||||
}
|
||||
|
||||
const tabLogin = ref(false)
|
||||
|
||||
|
||||
|
||||
// loadFrame函数是iframe加载完成后回调函数
|
||||
// const fram_box = ref(null)
|
||||
// const loadFrame = () => {
|
||||
|
||||
// const iframe = fram_box.value;
|
||||
// const iframeWindow = iframe.contentWindow;
|
||||
// const iframeDocument = iframeWindow.document;
|
||||
|
||||
// const targetElement = iframeDocument.querySelector('.target-element');
|
||||
// targetElement.style.backgroundColor = 'red';
|
||||
|
||||
// }
|
||||
|
||||
nextTick(() => {
|
||||
window.DDLogin({
|
||||
id: "ding-login",
|
||||
goto: "",
|
||||
style: "border:none;background-color:#FFFFFF;margin-top: 0px;",
|
||||
width: "300",
|
||||
height: "300",
|
||||
});
|
||||
|
||||
var handleMessage = (event) => {
|
||||
var origin = event.origin;
|
||||
console.log(event);
|
||||
if (origin == "https://login.dingtalk.com") {
|
||||
//判断是否来自ddLogin扫码事件。
|
||||
var loginTmpCode = event.data;
|
||||
//获取到loginTmpCode后就可以在这里构造跳转链接进行跳转了
|
||||
console.log("loginTmpCode", loginTmpCode);
|
||||
}
|
||||
};
|
||||
if (typeof window.addEventListener != "undefined") {
|
||||
window.addEventListener("message", handleMessage, false);
|
||||
console.log("add event");
|
||||
} else if (typeof window.attachEvent != "undefined") {
|
||||
window.attachEvent("onmessage", handleMessage);
|
||||
console.log("attach event");
|
||||
}
|
||||
})
|
||||
window.removeEventListener("message", loginListener);
|
||||
});
|
||||
|
||||
const loginListener = () => {};
|
||||
|
||||
const tabLogin = ref(true);
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.login_bg {
|
||||
background-image: url(../../assets/images/login_08.png);
|
||||
|
|
Loading…
Reference in New Issue