feat: 企微绑定入口 — BindWechat.vue + 路由
新增 /bind-wechat 公开路由: - 页面加载后自动重定向到企微 OAuth 授权页 - scope=snsapi_base (静默授权,无需用户确认) - 回调到 /login?wecom_code=xxx → 自动绑定 用法: 企微工作台应用主页设为 https://qj.dhdx.fun/bind-wechat Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -16,6 +16,12 @@ const router = createRouter({
|
|||||||
component: () => import('@/views/BindWecom.vue'),
|
component: () => import('@/views/BindWecom.vue'),
|
||||||
meta: { public: true },
|
meta: { public: true },
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/bind-wechat',
|
||||||
|
name: 'BindWechat',
|
||||||
|
component: () => import('@/views/BindWechat.vue'),
|
||||||
|
meta: { public: true },
|
||||||
|
},
|
||||||
// Mobile routes (manager-facing)
|
// Mobile routes (manager-facing)
|
||||||
{
|
{
|
||||||
path: '/m',
|
path: '/m',
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
<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>
|
||||||
Reference in New Issue
Block a user