修复空间管理数据错位的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 }} scroll={{ y: window.innerHeight - 300 }}
/> />
{/* 编辑空间模态框是否显示 */} {/* 编辑空间模态框是否显示 */}
<Modal footer={null} open={isModalOpen} onCancel={handleCancel}> {isModalOpen && (
<Form <Modal footer={null} open={isModalOpen} onCancel={handleCancel}>
name="change" <Form
onFinish={onModalFormFinish} name="change"
onFinishFailed={onModalFormFinishFailed} onFinish={onModalFormFinish}
autoComplete="off" onFinishFailed={onModalFormFinishFailed}
> autoComplete="off"
<div className="flex flex-col overflow-y-scroll"> >
<div className="flex flex-row mb-4"> <div className="flex flex-col overflow-y-scroll">
<Image <div className="flex flex-row mb-4">
width={80} <Image
height={80} width={80}
className="rounded-full" height={80}
src={defaultValues?.baseInfo?.avatar} 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> <div className="flex flex-col justify-between ml-2">
<p className="font-bold"> <p className="font-bold">ID{defaultValues?.baseInfo?.id}</p>
昵称{defaultValues?.baseInfo?.name} <p className="font-bold">
</p> 昵称{defaultValues?.baseInfo?.name}
<p className="font-bold"> </p>
创建时间{defaultValues?.baseInfo?.ct} <p className="font-bold">
</p> 创建时间{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> </div>
<div className="flex flex-col"> </Form>
<Form.Item </Modal>
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>
{/* 添加代运营Modal是否可见 */} {/* 添加代运营Modal是否可见 */}
{isAddAgencyModalOpen && ( {isAddAgencyModalOpen && (
<Modal <Modal

View File

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