2 changed files with 38 additions and 45 deletions
@ -1,52 +1,38 @@ |
|||||
<template> |
<template> |
||||
<!-- <template> --> |
<!-- <template> --> |
||||
<div v-show="getShow"> |
<div v-show="getShow"> |
||||
<!-- <LoginFormTitle class="enter-x" /> --> |
<!-- <LoginFormTitle class="enter-x" /> --> |
||||
<div class="enter-x min-w-64 min-h-64"> |
<div class="enter-x min-w-64 min-h-64"> |
||||
<div class="qr_login" id="qr_login"></div> |
<div class="qr_login" id="qr_login"></div> |
||||
<Divider class="enter-x">{{ t('sys.login.scanSign') }}</Divider> |
|
||||
<Button size="large" block class="mt-4 enter-x" @click="handleBackLogin"> |
<Button size="large" block class="mt-4 enter-x" @click="handleBackLogin"> |
||||
{{ t('sys.login.backSignIn') }} |
{{ t('sys.login.backSignIn') }} |
||||
</Button> |
</Button> |
||||
</div> |
</div> |
||||
</div> |
</div> |
||||
|
|
||||
<!-- </template> --> |
<!-- </template> --> |
||||
</template> |
</template> |
||||
<script lang="ts" setup> |
<script lang="ts" setup> |
||||
import { computed, unref,nextTick } from 'vue'; |
import { computed, unref, nextTick } from 'vue'; |
||||
import LoginFormTitle from './LoginFormTitle.vue'; |
import LoginFormTitle from './LoginFormTitle.vue'; |
||||
import { Button, Divider } from 'ant-design-vue'; |
import { Button, Divider } from 'ant-design-vue'; |
||||
import { QrCode } from '/@/components/Qrcode/index'; |
import { QrCode } from '/@/components/Qrcode/index'; |
||||
import { useRouter } from 'vue-router'; |
|
||||
import { useI18n } from '/@/hooks/web/useI18n'; |
import { useI18n } from '/@/hooks/web/useI18n'; |
||||
import { useLoginState, LoginStateEnum } from './useLogin'; |
import { useLoginState, LoginStateEnum } from './useLogin'; |
||||
|
|
||||
const qrCodeUrl = 'https://vvbin.cn/next/login'; |
|
||||
|
|
||||
const { t } = useI18n(); |
const { t } = useI18n(); |
||||
const { handleBackLogin, getLoginState } = useLoginState(); |
const { handleBackLogin, getLoginState } = useLoginState(); |
||||
|
|
||||
const getShow = computed(() => unref(getLoginState) === LoginStateEnum.WORKWECHAT_QR_CODE); |
const getShow = computed(() => unref(getLoginState) === LoginStateEnum.WORKWECHAT_QR_CODE); |
||||
nextTick(()=>{ |
nextTick(() => { |
||||
var wwLogin =new WwLogin({ |
var wwLogin = new WwLogin({ |
||||
id: 'qr_login', |
id: 'qr_login', |
||||
appid: "wwd54b6d4fa4de4ac1", |
appid: 'wwd54b6d4fa4de4ac1', |
||||
agentid: "1000003", |
agentid: '1000003', |
||||
redirect_uri: encodeURI('http://myapp.com:4200/redirect'), |
redirect_uri: encodeURI('http://myapp.com:4200/login'), |
||||
state: "hellowecom", |
state: 'hellowecom', |
||||
href: "", |
href: '', |
||||
lang: "zh",}); |
lang: 'zh', |
||||
|
}); |
||||
|
}); |
||||
}) |
|
||||
|
|
||||
/** |
|
||||
* 使用watch监控当前 router 的变化 |
|
||||
*/ |
|
||||
// const router = useRouter() |
|
||||
// watch(() => router.currentRoute.value.path,(toPath) => { |
|
||||
// debugger |
|
||||
// //要执行的方法 |
|
||||
// },{immediate: true,deep: true}) |
|
||||
</script> |
</script> |
||||
|
|||||
Loading…
Reference in new issue