|
@@ -1,4 +1,5 @@
|
|
|
import { useEffect } from 'react'
|
|
|
+import { useSearchParams } from 'react-router-dom';
|
|
|
import wxLogin from './wxLogin'
|
|
|
|
|
|
const CONFIG = {
|
|
@@ -13,12 +14,12 @@ const CONFIG = {
|
|
|
}
|
|
|
|
|
|
const Setting = () => {
|
|
|
-
|
|
|
+ const [searchParams] = useSearchParams()
|
|
|
useEffect(() => {
|
|
|
+
|
|
|
// 获取链接参数 code
|
|
|
- const code = new URLSearchParams(window.location.search).get('code') || localStorage.getItem('code')
|
|
|
- // 存储到localStorage
|
|
|
- localStorage.setItem('code', code || '')
|
|
|
+ const code = searchParams.get('code')
|
|
|
+
|
|
|
if (code) {
|
|
|
// 获取用户信息
|
|
|
getPiaoQuanUserInfo(code)
|