5006642354
新增 /bind-wechat 公开路由: - 页面加载后自动重定向到企微 OAuth 授权页 - scope=snsapi_base (静默授权,无需用户确认) - 回调到 /login?wecom_code=xxx → 自动绑定 用法: 企微工作台应用主页设为 https://qj.dhdx.fun/bind-wechat Co-Authored-By: Claude <noreply@anthropic.com>
31 lines
757 B
Vue
31 lines
757 B
Vue
<script setup lang="ts">
|
|
import { onMounted } from 'vue'
|
|
|
|
const CORP_ID = 'ww69e8e44636f47780'
|
|
const REDIRECT_URI = encodeURIComponent('https://qj.dhdx.fun/login')
|
|
const STATE = 'bind'
|
|
|
|
onMounted(() => {
|
|
const url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${CORP_ID}&redirect_uri=${REDIRECT_URI}&response_type=code&scope=snsapi_base&state=${STATE}#wechat_redirect`
|
|
window.location.href = url
|
|
})
|
|
</script>
|
|
|
|
<template>
|
|
<div class="bind-wechat-page">
|
|
<p>正在跳转企业微信授权...</p>
|
|
</div>
|
|
</template>
|
|
|
|
<style scoped>
|
|
.bind-wechat-page {
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
height: 100vh;
|
|
font-size: 16px;
|
|
color: var(--ink);
|
|
font-family: 'Noto Serif SC', STSong, serif;
|
|
}
|
|
</style>
|