Skip to content

Commit

Permalink
fix: 调整回调地址
Browse files Browse the repository at this point in the history
  • Loading branch information
liuhuapiaoyuan committed Nov 16, 2024
1 parent 0ce5c6e commit 2e0e1a9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
3 changes: 0 additions & 3 deletions apps/example/src/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ export const wechatMpProvder = Wehcatmp({
appId: process.env.AUTH_WECHATMP_APPID!,
appSecret: process.env.AUTH_WECHATMP_APPSECRET!,
}),
endpoint: 'http://localhost:3000/api/auth/wechatmp',
qrcodeImageUrl:
'https://oauth.chanlun.ggss.club/uploads/20240121/3fec8aa97489ad13a734c500038822a3.jpg',
})

export const authService = new AuthService()
Expand Down
1 change: 1 addition & 0 deletions packages/wechatmp/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export default function WeChatMp<P extends WechatMpProfile>(
process.env.AUTH_WECHATMP_ENDPOINT ??
'http://localhost:3000/api/auth/wechatmp',
checkType: process.env.AUTH_WECHATMP_CHECKTYPE ?? 'MESSAGE',
qrcodeImageUrl: process.env.AUTH_WECHATMP_QRCODE_IMAGE_URL,
},
options ?? {},
)
Expand Down
8 changes: 6 additions & 2 deletions packages/wechatmp/src/pages/qrcode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,18 @@ export function QrcodePage(params: {
</div>
<script>
new QRCode("qrcode", {
${
isLink
? ''
: ` new QRCode("qrcode", {
text: "${qrcode}",
width: 258,
height: 258,
colorDark : "#000000",
colorLight : "#ffffff",
correctLevel : QRCode.CorrectLevel.H
});
});`
}
// 模拟的API URL,用于检查登录状态
const checkLoginUrl = '${endpoint}?action=check';
Expand Down

0 comments on commit 2e0e1a9

Please sign in to comment.