修复充值会员后没有更新cookie的bug

This commit is contained in:
yezian 2024-12-27 00:31:18 +08:00
parent 2aaf8861b2
commit 97821d9dee
1 changed files with 9 additions and 7 deletions

View File

@ -1,19 +1,21 @@
"use client";
import React, { useState, useEffect } from "react";
import { Dialog, Toast } from "antd-mobile";
import { checkRole } from "@/utils/auth";
import React, { useEffect } from "react";
import { Dialog } from "antd-mobile";
// import { useRouter } from "next/navigation";
import baseRequest from "@/utils/baseRequest";
import { get } from "@/utils/storeInfo";
import { save } from "@/utils/storeInfo";
import { getUserInfo } from "@/api/public";
export default function CheckVip({ children, isVipToPassFun, router }) {
// const router = useRouter();
const base = baseRequest();
useEffect(() => {}, []);
const handleCheck = () => {
const account = get("account");
const handleCheck = async () => {
//
const account = await getUserInfo();
save("account", JSON.stringify(account));
const isVip = account?.is_a_member;
if (!isVip) {
const showMobal = Dialog.show({
title: "是否开通会员",