This commit is contained in:
lnn19986213 2023-08-26 11:08:33 +08:00
parent 5d63c6dd1b
commit 2f40d42607
1 changed files with 9 additions and 53 deletions

View File

@ -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)
// loadFrameiframe
// 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);