提交 61dd95da 作者: 毛细亚

123

上级 d695ffbf
...@@ -5,8 +5,6 @@ ...@@ -5,8 +5,6 @@
<script> <script>
import {mapState, mapActions} from 'vuex' import {mapState, mapActions} from 'vuex'
import * as ww from '@wecom/jssdk'
console.log(ww,'ww')
export default { export default {
name: 'HomeView', name: 'HomeView',
// inject: ['authPromise'], // inject: ['authPromise'],
...@@ -20,13 +18,13 @@ export default { ...@@ -20,13 +18,13 @@ export default {
} }
}, },
created(){
console.log(window.location.href,'window.location.href')
},
computed: { computed: {
...mapState('user', ['userInfo'])
}, },
methods: { methods: {
getAuthUser() {
this.register()
},
} }
} }
......
// UnifiedLogin.vue // UnifiedLogin.vue
<template> <template>
<div class="loginContent"> <div class="loginContent">
<div> <div v-if="!showQrCode">
<div> <div>
当前组织:<span class="current-org">{{ currentOrg.name }}</span> 当前组织:<span class="current-org">{{ currentOrg.name }}</span>
<el-button type="text" @click="showOrgDialog = true">切换组织</el-button> <el-button type="text" @click="showOrgDialog = true">切换组织</el-button>
...@@ -47,6 +47,9 @@ ...@@ -47,6 +47,9 @@
<div v-if="dingUserInfo">钉钉用户:{{ dingUserInfo.name }}</div> <div v-if="dingUserInfo">钉钉用户:{{ dingUserInfo.name }}</div>
<div v-if="externalUserId">企微外部联系人ID:{{ externalUserId }}</div> <div v-if="externalUserId">企微外部联系人ID:{{ externalUserId }}</div>
</div> </div>
<div v-if="showQrCode">
跳转中 请稍等...
</div>
</div> </div>
</template> </template>
...@@ -73,6 +76,7 @@ export default { ...@@ -73,6 +76,7 @@ export default {
qrLoading: false, // 控制二维码 loading qrLoading: false, // 控制二维码 loading
redirectUri: process.env.NODE_ENV === 'production' ? 'https://companywx.zwnet.cn/api/api/sidebar_login/ding' : 'https://companywx.zwwlkj03.top/api/api/sidebar_login/ding', redirectUri: process.env.NODE_ENV === 'production' ? 'https://companywx.zwnet.cn/api/api/sidebar_login/ding' : 'https://companywx.zwwlkj03.top/api/api/sidebar_login/ding',
DDTestUrl:'', DDTestUrl:'',
showQrCode:false,
} }
}, },
async mounted() { async mounted() {
...@@ -82,6 +86,7 @@ export default { ...@@ -82,6 +86,7 @@ export default {
await this.initOrganization(); await this.initOrganization();
// 如果是钉钉扫码回调页面 // 如果是钉钉扫码回调页面
if ( urlParams.type && urlParams.type === 'ding') {// 钉钉回调 if ( urlParams.type && urlParams.type === 'ding') {// 钉钉回调
this.showQrCode = true
console.log('进入钉钉回调') console.log('进入钉钉回调')
this.handleDingCallback(); this.handleDingCallback();
}else{ }else{
...@@ -229,9 +234,9 @@ export default { ...@@ -229,9 +234,9 @@ export default {
this.DDTestUrl = url this.DDTestUrl = url
// window.location.href = url; // window.location.href = url;
}, },
// 7. 钉钉扫码回调页面处理 // 7. 钉钉扫码回调页面处理
async handleDingCallback() { async handleDingCallback() {
// 在这里处理钉钉扫码成功的回调
const ddParams = getParams(); const ddParams = getParams();
console.log(ddParams,'ddParams') console.log(ddParams,'ddParams')
await this.getSignature(); await this.getSignature();
...@@ -239,7 +244,6 @@ export default { ...@@ -239,7 +244,6 @@ export default {
this.getCurExternalContact(); this.getCurExternalContact();
}, 2000); }, 2000);
}, },
// 8. 获取企微外部联系人 // 8. 获取企微外部联系人
getCurExternalContact() { getCurExternalContact() {
ww.getCurExternalContact({ ww.getCurExternalContact({
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论