修复充值会员后没有更新cookie的bug
This commit is contained in:
parent
2aaf8861b2
commit
97821d9dee
|
@ -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: "是否开通会员",
|
||||
|
|
Loading…
Reference in New Issue