修改网盘显示等细节,登陆验证更加严格,同时允许一台设备在线
This commit is contained in:
21
front/src/admin/dashboard-state.ts
Normal file
21
front/src/admin/dashboard-state.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import type { AdminSummary } from '@/src/lib/types';
|
||||
|
||||
export interface InviteCodePanelState {
|
||||
inviteCode: string;
|
||||
canCopy: boolean;
|
||||
}
|
||||
|
||||
export function getInviteCodePanelState(summary: AdminSummary | null | undefined): InviteCodePanelState {
|
||||
const inviteCode = summary?.inviteCode?.trim() ?? '';
|
||||
if (!inviteCode) {
|
||||
return {
|
||||
inviteCode: '未生成',
|
||||
canCopy: false,
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
inviteCode,
|
||||
canCopy: true,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user