| | |
| | | <template> |
| | | <div class="login-container" |
| | | ref="login" |
| | | @keyup.enter.native="handleLogin"> |
| | | <div class="login-container" ref="login" @keyup.enter.native="handleLogin"> |
| | | <top-color v-show="false"></top-color> |
| | | <div class="login-weaper animated bounceInDown"> |
| | | <div class="login-left"> |
| | | <div class="login-time"> |
| | | {{time}} |
| | | </div> |
| | | <img class="img" src="/img/logo.png" alt=""> |
| | | <p class="title">{{ $t('login.info') }}</p> |
| | | <img class="img" src="/img/logo.png" alt="" /> |
| | | <p class="title">{{ $t("login.info") }}</p> |
| | | </div> |
| | | <div class="login-border"> |
| | | <div class="login-erweima"> |
| | | <img :src="link" alt="" /> |
| | | </div> |
| | | <div class="login-main"> |
| | | <h4 class="login-title"> |
| | | {{ $t('login.title') }} |
| | | {{ $t("login.title") }} |
| | | <!-- <top-lang></top-lang>--> |
| | | </h4> |
| | | <h4 class="login-title-child">IoT security cloud service platform</h4> |
| | |
| | | <!-- <thirdLogin v-else-if="activeName==='third'"></thirdLogin>--> |
| | | <div class="login-menu"> |
| | | <!-- <a href="#" @click.stop="activeName='user'">{{ $t('login.userLogin') }}</a>--> |
| | | <a href="#" @click.stop="zShow">{{ $t('login.phoneLogin') }}</a> |
| | | <a href="#" @click.stop="zShow">{{ $t("login.phoneLogin") }}</a> |
| | | <!-- <a href="#" @click.stop="activeName='third'">{{ $t('login.thirdLogin') }}</a>--> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="z" v-show="activeName == 'code'"> |
| | |
| | | import topLang from "@/page/index/top/top-lang"; |
| | | import topColor from "@/page/index/top/top-color"; |
| | | import {getQueryString, getTopUrl} from "@/util/util"; |
| | | import { geterweima } from "@/api/logs"; |
| | | |
| | | export default { |
| | | name: "login", |
| | |
| | | codeLogin, |
| | | thirdLogin, |
| | | topLang, |
| | | topColor |
| | | topColor, |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | source: "", |
| | | code: "", |
| | | state: "", |
| | | } |
| | | link: "", |
| | | }, |
| | | }; |
| | | }, |
| | | watch: { |
| | | $route() { |
| | | this.handleLogin(); |
| | | } |
| | | }, |
| | | }, |
| | | created() { |
| | | this.handleLogin(); |
| | | this.getTime(); |
| | | geterweima(9).then((res) => { |
| | | this.link = res.data.data.link; |
| | | }); |
| | | }, |
| | | mounted() { |
| | | }, |
| | | mounted() {}, |
| | | computed: { |
| | | ...mapGetters(["website", "tagWel"]) |
| | | ...mapGetters(["website", "tagWel"]), |
| | | }, |
| | | props: [], |
| | | methods: { |
| | |
| | | this.socialForm.source = getQueryString("source"); |
| | | this.socialForm.code = getQueryString("code"); |
| | | this.socialForm.state = getQueryString("state"); |
| | | if (validatenull(this.socialForm.source) && topUrl.includes(redirectUrl)) { |
| | | if ( |
| | | validatenull(this.socialForm.source) && |
| | | topUrl.includes(redirectUrl) |
| | | ) { |
| | | let source = topUrl.split("?")[0]; |
| | | source = source.split(redirectUrl)[1]; |
| | | this.socialForm.source = source; |
| | | } |
| | | if (!validatenull(this.socialForm.source) && !validatenull(this.socialForm.code) && !validatenull(this.socialForm.state)) { |
| | | if ( |
| | | !validatenull(this.socialForm.source) && |
| | | !validatenull(this.socialForm.code) && |
| | | !validatenull(this.socialForm.state) |
| | | ) { |
| | | const loading = this.$loading({ |
| | | lock: true, |
| | | text: '第三方系统登录中,请稍后。。。', |
| | | spinner: "el-icon-loading" |
| | | text: "第三方系统登录中,请稍后。。。", |
| | | spinner: "el-icon-loading", |
| | | }); |
| | | this.$store.dispatch("LoginBySocial", this.socialForm).then(() => { |
| | | this.$store |
| | | .dispatch("LoginBySocial", this.socialForm) |
| | | .then(() => { |
| | | window.location.href = topUrl.split(redirectUrl)[0]; |
| | | this.$router.push({path: this.tagWel.value}); |
| | | loading.close(); |
| | | }).catch(() => { |
| | | }) |
| | | .catch(() => { |
| | | loading.close(); |
| | | }); |
| | | } |
| | | }, |
| | | zShow() { |
| | | document.querySelector('.z').style.display = 'block'; |
| | | } |
| | | } |
| | | document.querySelector(".z").style.display = "block"; |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |