添加webviewBase监听

This commit is contained in:
al 2024-07-23 19:49:35 +08:00
parent c0c9520fee
commit ae2d164b84
4 changed files with 12 additions and 8 deletions

View File

@ -11,6 +11,7 @@ export default function BillDetail({ params }) {
const [data, setData] = useState([]);
const [isFetching, setIsFetching] = useState(true);
const searchParams = useSearchParams();
const webviewBase = webviewBaseRequest()
const base = useMemo(()=>{
let searchParamsObj=null;
if(searchParams.get("b_mid")){
@ -25,8 +26,8 @@ export default function BillDetail({ params }) {
searchParamsObj.b_ch=searchParams.get("b_ch");
searchParamsObj.b_ts=searchParams.get("b_ts");
}
return searchParamsObj || webviewBaseRequest();
},[searchParams]);
return searchParamsObj || webviewBase;
},[searchParams,webviewBase]);
useEffect(() => {
const getData = async () => {
let type;

View File

@ -44,6 +44,7 @@ export default function Pay() {
//
const [isFetching, setIsFetching] = useState(true);
const webviewBase = webviewBaseRequest()
const base = useMemo(()=>{
let searchParamsObj=null;
if(searchParams.get("b_mid")){
@ -58,8 +59,8 @@ export default function Pay() {
searchParamsObj.b_ch=searchParams.get("b_ch");
searchParamsObj.b_ts=searchParams.get("b_ts");
}
return searchParamsObj || webviewBaseRequest();
},[searchParams]);
return searchParamsObj || webviewBase;
},[searchParams,webviewBase]);
useEffect(() => {
const getData = async () => {

View File

@ -23,6 +23,7 @@ export default function Vip() {
const [isVip, setIsVip] = useState(false);
const [name, setName] = useState("");
const [isFetching, setIsFetching] = useState(true);
const webviewBase = webviewBaseRequest()
const base = useMemo(()=>{
let searchParamsObj=null;
if(searchParams.get("b_mid")){
@ -37,8 +38,8 @@ export default function Vip() {
searchParamsObj.b_ch=searchParams.get("b_ch");
searchParamsObj.b_ts=searchParams.get("b_ts");
}
return searchParamsObj || webviewBaseRequest();
},[searchParams]);
return searchParamsObj || webviewBase;
},[searchParams,webviewBase]);
const getUserData = async () => {
try {
const signature = generateSignature({

View File

@ -16,6 +16,7 @@ export default function Pay({ params }) {
//
const [superfanshipData, setSuperfanshipData] = useState();
const [isFetching, setIsFetching] = useState(true);
const webviewBase = webviewBaseRequest()
const base = useMemo(()=>{
let searchParamsObj=null;
if(searchParams.get("b_mid")){
@ -30,8 +31,8 @@ export default function Pay({ params }) {
searchParamsObj.b_ch=searchParams.get("b_ch");
searchParamsObj.b_ts=searchParams.get("b_ts");
}
return searchParamsObj || webviewBaseRequest();
},[searchParams]);
return searchParamsObj || webviewBase;
},[searchParams,webviewBase]);
//
const getData = async () => {
try {