import { useEffect } from 'react' import wxLogin from './wxLogin' const CONFIG = { test: { appid: 'wx853a8d12eea0e682', url: 'https://piaoquantv.yishihui.com' }, prod: { appid: 'wx73a6cb4d85be594f', url: 'https://www.piaoquantv.com' } } const Setting = () => { useEffect(() => { // 获取链接参数 code const code = new URLSearchParams(window.location.search).get('code') if (code) { // 获取用户信息 getPiaoQuanUserInfo(code) } else { renderQrcode() } }, []) const getPiaoQuanUserInfo = async (code: string) => { console.log(code) } const renderQrcode = () => { const env = window.location.host === ('content.piaoquantv.com') ? 'prod' : 'test' wxLogin({ id: 'code', appid: CONFIG[env].appid, scope: 'snsapi_login', redirect_uri: encodeURIComponent(CONFIG[env].url + '?jumpTo=contentCooper'), }) } return (
视频上传归属用户
) } export default Setting