From 16cd1ec0c429b8d11266ca4c0d93ae2f9100ba64 Mon Sep 17 00:00:00 2001 From: al Date: Thu, 14 Nov 2024 16:52:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0cookie=E6=97=B6=E9=95=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/space/setting/[mid]/page.js | 28 +++++++++++--------- components/AddToHome/index.jsx | 2 +- components/UploadImgs/index.js | 2 +- questions.text | 45 --------------------------------- utils/auth.js | 4 +-- 5 files changed, 20 insertions(+), 61 deletions(-) delete mode 100644 questions.text diff --git a/app/space/setting/[mid]/page.js b/app/space/setting/[mid]/page.js index fb7e4b6..cec9e2a 100644 --- a/app/space/setting/[mid]/page.js +++ b/app/space/setting/[mid]/page.js @@ -9,7 +9,11 @@ import { faAngleRight, faCalendar, } from "@fortawesome/free-solid-svg-icons"; -import { getSpaceData,getStreamerDetailInfo } from "@/api/space"; +import { + getSpaceData, + getStreamerDetailInfo, + getStreamerInfo, +} from "@/api/space"; import requireAPI from "@/utils/requireAPI"; export default function Setting() { const router = useRouter(); @@ -17,12 +21,16 @@ export default function Setting() { const [streamerInfo, setStreamerInfo] = useState(null); useEffect(() => { (async () => { - const {mid} = params; + const { mid } = params; if (mid) { - const info = await getStreamerDetailInfo(Number(mid)); + const info = await getStreamerInfo(Number(mid)); + const detailInfo = await getStreamerDetailInfo(Number(mid)); await getSpaceData(Number(mid)).then((res) => { - setStreamerInfo({ ...info.streamer_ext - , refund_enable: res?.refund_enable }); + setStreamerInfo({ + ...detailInfo.streamer_ext, + ...info, + refund_enable: res?.refund_enable, + }); }); } })(); @@ -125,16 +133,14 @@ export default function Setting() {
{ - router.push( - "spaceIntroSetting/" + streamerInfo.mid - ); + router.push("spaceIntroSetting/" + streamerInfo.mid); }} >
@@ -207,9 +213,7 @@ export default function Setting() {
  • - router.push( - "spacePaymentSetting?zid=" + streamerInfo.id - ) + router.push("spacePaymentSetting?zid=" + streamerInfo.id) } className="flex justify-between" > diff --git a/components/AddToHome/index.jsx b/components/AddToHome/index.jsx index 9965433..88df852 100644 --- a/components/AddToHome/index.jsx +++ b/components/AddToHome/index.jsx @@ -14,7 +14,7 @@ export default function AddToHome() { }, []); return firstLogin.first == "1" ? (
    {!firstLogin.second ? ( diff --git a/components/UploadImgs/index.js b/components/UploadImgs/index.js index ab44213..64be096 100644 --- a/components/UploadImgs/index.js +++ b/components/UploadImgs/index.js @@ -222,7 +222,7 @@ export default function UploadImgs({ } }; return ( -
    +
    {columns.map((column, index) => ( >>靠后) -17. 搜索页面,进入空间应该先到空间介绍页,然后判断是否解锁,如果解锁就重定向到空间内 (完成) -18. 加微信组件中/api/vas/query_wechat这个接口应该在确认用户已经解锁微信了才去调用 (完成) -19. 主播主页,空间动态的预览图,应该根据是否已经解锁空间来决定是否模糊,以及跳转空间介绍页还是空间内 (完成)(待验证!!!) -20. 修改密码页面,显示未获取到手机号请重新登录 (完成)(待验证!!!) -21. 意见反馈页面没完善 (完成)(待验证!!!) -22. 关于我们页面没完善 (完成) -23. 账号注销页面没完善、页面改成“账号注销” (完成)(待验证!!!) -24. 登录页面底部用户协议部分文案改成“我已阅读并同意《用户协议》、《隐私政策》” (完成) -25. 登录页面顶部加头图:和tiefen_space_web项目相同 (完成) -26. 登录页面和修改密码页面输入框的placeholder文本颜色不统一 (完成) -27. 登录页面缺少了忘记密码页面 (完成) -28. 缺少支付相关页面 -29. 空间卡片,“付费”标签出现两次,同时缺少“创建者”标签,这两个标签需要横向排列 (完成) -30. 切换账号之后,baseRequest没有更新 (完成) -31. 空间设置中缺少空间内用户提交退款申请功能 (完成)(待验证!!!) -32. 空间介绍页的空间价格目前是写死的,同时这里要判断空间价格是否为0,如果是0的话和不为0的点击事件有区别;此外,还有个退款后的用户不显示付费按钮的逻辑 (完成)(待验证!!!) -待开发的功能: - - -正在开发的功能: - -已完成功能: -1. 我的页面中的关注和粉丝 (完成) -2. 用户添加主播微信 (完成) -3. 搜索单条的样式 (完成) diff --git a/utils/auth.js b/utils/auth.js index 0b008ee..98ccbbb 100644 --- a/utils/auth.js +++ b/utils/auth.js @@ -15,8 +15,8 @@ export async function checkAuth() { } export function signIn(data) { - setCookie("token", data.data.token); - setCookie("mid", data.data.account.mid); + setCookie("token", data.data.token, { maxAge: 60 * 60 * 24 * 365 * 10 }); + setCookie("mid", data.data.account.mid, { maxAge: 60 * 60 * 24 * 365 * 10 }); } export function signOut() {