修复空间管理数据错位的bug;延长登陆cookie有效期

This commit is contained in:
yezian 2024-11-14 16:59:33 +08:00
parent 2af197f2af
commit c97a8cbca5
2 changed files with 154 additions and 150 deletions

View File

@ -739,156 +739,160 @@ const StreamerSpaceContent = () => {
scroll={{ y: window.innerHeight - 300 }}
/>
{/* 编辑空间模态框是否显示 */}
<Modal footer={null} open={isModalOpen} onCancel={handleCancel}>
<Form
name="change"
onFinish={onModalFormFinish}
onFinishFailed={onModalFormFinishFailed}
autoComplete="off"
>
<div className="flex flex-col overflow-y-scroll">
<div className="flex flex-row mb-4">
<Image
width={80}
height={80}
className="rounded-full"
src={defaultValues?.baseInfo?.avatar}
/>
<div className="flex flex-col justify-between ml-2">
<p className="font-bold">ID{defaultValues?.baseInfo?.id}</p>
<p className="font-bold">
昵称{defaultValues?.baseInfo?.name}
</p>
<p className="font-bold">
创建时间{defaultValues?.baseInfo?.ct}
</p>
{isModalOpen && (
<Modal footer={null} open={isModalOpen} onCancel={handleCancel}>
<Form
name="change"
onFinish={onModalFormFinish}
onFinishFailed={onModalFormFinishFailed}
autoComplete="off"
>
<div className="flex flex-col overflow-y-scroll">
<div className="flex flex-row mb-4">
<Image
width={80}
height={80}
className="rounded-full"
src={defaultValues?.baseInfo?.avatar}
/>
<div className="flex flex-col justify-between ml-2">
<p className="font-bold">ID{defaultValues?.baseInfo?.id}</p>
<p className="font-bold">
昵称{defaultValues?.baseInfo?.name}
</p>
<p className="font-bold">
创建时间{defaultValues?.baseInfo?.ct}
</p>
</div>
</div>
<div className="flex flex-col">
<Form.Item
name="profile"
label="空间介绍"
initialValue={defaultValues?.profile}
rules={[
{
required: true,
message: "请输入空间介绍",
},
]}
>
<TextArea />
</Form.Item>
<Form.Item
name="admission_price"
label="解锁空间价格(元)"
initialValue={defaultValues?.paymentSettings?.admission_price}
rules={[
{
required: true,
message: "请输入解锁空间价格",
},
]}
>
<InputNumber min={0} />
</Form.Item>
<Form.Item
name="ironfanship_price"
label="铁粉价格(元)"
initialValue={
defaultValues?.paymentSettings?.ironfanship_price
}
rules={[
{
required: true,
message: "请输入铁粉价格",
},
]}
>
<InputNumber min={0} />
</Form.Item>
<Form.Item
name="is_superfanship_enabled"
label="是否开通超粉功能"
initialValue={
defaultValues?.paymentSettings?.is_superfanship_enabled
}
rules={[
{
required: true,
message: "请选择是否开通超粉功能",
},
]}
>
<select
style={{
height: 32,
padding: "4px 11px",
border: "1px solid #d9d9d9",
borderRadius: 4,
outline: "none",
}}
>
<option value={1}></option>
<option value={0}></option>
</select>
</Form.Item>
<Form.Item
name="superfanship_price"
label="超粉价格(元)"
initialValue={
defaultValues?.paymentSettings?.superfanship_price
}
>
<InputNumber min={0} />
</Form.Item>
<Form.Item
name="superfanship_valid_period"
label="超粉有效期"
initialValue={
defaultValues?.paymentSettings?.superfanship_valid_period
}
>
<select
style={{
height: 32,
padding: "4px 11px",
border: "1px solid #d9d9d9",
borderRadius: 4,
outline: "none",
}}
>
<option value={0}>永久</option>
<option value={1}>月度</option>
<option value={2}>季度</option>
<option value={3}>半年</option>
<option value={4}>年度</option>
</select>
</Form.Item>
<Form.Item
name="is_superfanship_give_wechat"
label="开通超粉是否送微信"
initialValue={
defaultValues?.paymentSettings?.is_superfanship_give_wechat
}
>
<select
style={{
height: 32,
padding: "4px 11px",
border: "1px solid #d9d9d9",
borderRadius: 4,
outline: "none",
}}
>
<option value={1}></option>
<option value={0}></option>
</select>
</Form.Item>
<Button type="primary" htmlType="submit">
确认
</Button>
</div>
</div>
<div className="flex flex-col">
<Form.Item
name="profile"
label="空间介绍"
initialValue={defaultValues?.profile}
rules={[
{
required: true,
message: "请输入空间介绍",
},
]}
>
<TextArea />
</Form.Item>
<Form.Item
name="admission_price"
label="解锁空间价格(元)"
initialValue={defaultValues?.paymentSettings?.admission_price}
rules={[
{
required: true,
message: "请输入解锁空间价格",
},
]}
>
<InputNumber min={0} />
</Form.Item>
<Form.Item
name="ironfanship_price"
label="铁粉价格(元)"
initialValue={defaultValues?.paymentSettings?.ironfanship_price}
rules={[
{
required: true,
message: "请输入铁粉价格",
},
]}
>
<InputNumber min={0} />
</Form.Item>
<Form.Item
name="is_superfanship_enabled"
label="是否开通超粉功能"
initialValue={
defaultValues?.paymentSettings?.is_superfanship_enabled
}
rules={[
{
required: true,
message: "请选择是否开通超粉功能",
},
]}
>
<select
style={{
height: 32,
padding: "4px 11px",
border: "1px solid #d9d9d9",
borderRadius: 4,
outline: "none",
}}
>
<option value={1}></option>
<option value={0}></option>
</select>
</Form.Item>
<Form.Item
name="superfanship_price"
label="超粉价格(元)"
initialValue={
defaultValues?.paymentSettings?.superfanship_price
}
>
<InputNumber min={0} />
</Form.Item>
<Form.Item
name="superfanship_valid_period"
label="超粉有效期"
initialValue={
defaultValues?.paymentSettings?.superfanship_valid_period
}
>
<select
style={{
height: 32,
padding: "4px 11px",
border: "1px solid #d9d9d9",
borderRadius: 4,
outline: "none",
}}
>
<option value={0}>永久</option>
<option value={1}>月度</option>
<option value={2}>季度</option>
<option value={3}>半年</option>
<option value={4}>年度</option>
</select>
</Form.Item>
<Form.Item
name="is_superfanship_give_wechat"
label="开通超粉是否送微信"
initialValue={
defaultValues?.paymentSettings?.is_superfanship_give_wechat
}
>
<select
style={{
height: 32,
padding: "4px 11px",
border: "1px solid #d9d9d9",
borderRadius: 4,
outline: "none",
}}
>
<option value={1}></option>
<option value={0}></option>
</select>
</Form.Item>
<Button type="primary" htmlType="submit">
确认
</Button>
</div>
</div>
</Form>
</Modal>
</Form>
</Modal>
)}
{/* 添加代运营Modal是否可见 */}
{isAddAgencyModalOpen && (
<Modal

View File

@ -31,8 +31,8 @@ export async function checkAuth() {
export function signIn(data) {
const cookies = new Cookies();
cookies.set("token", data.data.token);
cookies.set("account", data.data.account);
cookies.set("token", data.data.token, { maxAge: 315576000 });
cookies.set("account", data.data.account, { maxAge: 315576000 });
window.location.reload();
}