调成回调url一致

This commit is contained in:
niyyzf 2024-07-26 16:29:31 +08:00
parent d2f244aabf
commit f5959bb96b
1 changed files with 2 additions and 3 deletions

View File

@ -3,7 +3,7 @@ import {onMounted} from "vue";
// import wx from "weixin-js-sdk";
const appId="wx1bbe5c15d28b500c"
const redirect_uri="https://localhost:5173/welcome"
const redirect_uri="https://test.xn--7p0a.site/welcome"
const scope="snsapi_userinfo"
const state="123"
onMounted(()=>{
@ -11,8 +11,7 @@ onMounted(()=>{
})
const login=()=>{
// https://open.weixin.qq.com/connect/oauth2/authorize?appid=APPID&redirect_uri=REDIRECT_URI&response_type=code&scope=SCOPE&state=STATE#wechat_redirect
window.open(`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appId}&redirect_uri=${redirect_uri}&response_type=code&scope=${scope}&state=STATE#wechat_redirect`)
window.location.href=`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appId}&redirect_uri=${redirect_uri}&response_type=code&scope=${scope}&state=${state}#wechat_redirect`
}
</script>