增加菜单栏帮助中心和登录页面相关协议的文档1.0版本 & allowedDevOrigins添加IP地址
This commit is contained in:
@@ -18,7 +18,7 @@ import {toast} from 'sonner'
|
||||
import {merge} from '@/lib/utils'
|
||||
import {Combobox} from '@/components/ui/combobox'
|
||||
import cities from './_assets/cities.json'
|
||||
import ExtractDocs from '@/components/docs/extract.mdx'
|
||||
import ExtractDocs from '@/docs/extract.mdx'
|
||||
import Link from 'next/link'
|
||||
import {useProfileStore} from '@/components/stores-provider'
|
||||
|
||||
@@ -71,14 +71,16 @@ export default function Extract(props: ExtractProps) {
|
||||
)}
|
||||
>
|
||||
<CardSection>
|
||||
<Alert variant="warn" className="flex items-center">
|
||||
<CircleAlert/>
|
||||
<AlertTitle className="flex">提取IP前需要将本机IP添加到白名单后才可使用</AlertTitle>
|
||||
<Alert variant="warn" className="flex items-center justify-between">
|
||||
<span className="flex items-center gap-2">
|
||||
<CircleAlert/>
|
||||
<AlertTitle className="flex text-gray-900">提取IP前需要将本机IP添加到白名单后才可使用</AlertTitle>
|
||||
</span>
|
||||
<Link
|
||||
href="/admin/whitelist"
|
||||
className="flex-none text-blue-600 hover:text-blue-800 hover:underline font-medium ml-2 flex gap-0.5 items-center"
|
||||
className="flex-none text-orange-600 font-medium ml-2 flex gap-0.5 items-center"
|
||||
>
|
||||
<span>去添加</span>
|
||||
<span>添加白名单</span>
|
||||
<ArrowRight className="size-4"/>
|
||||
</Link>
|
||||
</Alert>
|
||||
@@ -335,6 +337,8 @@ function SelectResource() {
|
||||
setStatus('load')
|
||||
try {
|
||||
const resp = await allResource()
|
||||
console.log(resp, '套餐管理resprespresp')
|
||||
|
||||
if (!resp.success) {
|
||||
console.log(11111)
|
||||
throw new Error('获取套餐失败,请稍后再试')
|
||||
@@ -392,12 +396,15 @@ function SelectResource() {
|
||||
<Timer size={20}/>
|
||||
<span>{name(resource)}</span>
|
||||
</div>
|
||||
<div className="flex text-xs text-weak">
|
||||
<span>{resource.resource_no}</span>
|
||||
</div>
|
||||
<div className="flex justify-between gap-2 text-xs text-weak">
|
||||
<span>
|
||||
到期时间:
|
||||
{format(resource.short.expire, 'yyyy-MM-dd HH:mm')}
|
||||
{format(resource.short.expire_at, 'yyyy-MM-dd HH:mm')}
|
||||
</span>
|
||||
<span>{intlFormatDistance(resource.short.expire, new Date())}</span>
|
||||
<span>{intlFormatDistance(resource.short.expire_at, new Date())}</span>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
@@ -407,6 +414,9 @@ function SelectResource() {
|
||||
<Box size={20}/>
|
||||
<span>{name(resource)}</span>
|
||||
</div>
|
||||
<div className="flex text-xs text-weak">
|
||||
<span>{resource.resource_no}</span>
|
||||
</div>
|
||||
<div className="flex justify-between gap-2 text-xs text-weak">
|
||||
<span>
|
||||
提取数量:
|
||||
@@ -428,12 +438,15 @@ function SelectResource() {
|
||||
<Timer size={20}/>
|
||||
<span>{name(resource)}</span>
|
||||
</div>
|
||||
<div className="flex text-xs text-weak">
|
||||
<span>{resource.resource_no}</span>
|
||||
</div>
|
||||
<div className="flex justify-between gap-2 text-xs text-weak">
|
||||
<span>
|
||||
到期时间:
|
||||
{format(resource.long.expire, 'yyyy-MM-dd HH:mm')}
|
||||
{format(resource.long.expire_at, 'yyyy-MM-dd HH:mm')}
|
||||
</span>
|
||||
<span>{intlFormatDistance(resource.long.expire, new Date())}</span>
|
||||
<span>{intlFormatDistance(resource.long.expire_at, new Date())}</span>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
@@ -443,6 +456,9 @@ function SelectResource() {
|
||||
<Box size={20}/>
|
||||
<span>{name(resource)}</span>
|
||||
</div>
|
||||
<div className="flex text-xs text-weak">
|
||||
<span>{resource.resource_no}</span>
|
||||
</div>
|
||||
<div className="flex justify-between gap-2 text-xs text-weak">
|
||||
<span>
|
||||
提取数量:
|
||||
|
||||
@@ -29,12 +29,14 @@ export default function UserCenter(props: UserCenterProps) {
|
||||
const pathname = usePathname()
|
||||
const isAdminPage = pathname.startsWith('/admin') // 判断是否在后台页面
|
||||
const displayName = () => {
|
||||
if (props.profile.username) return props.profile.username // 优先显示用户名
|
||||
if (props.profile.phone) {
|
||||
const phone = props.profile.phone
|
||||
return `${phone.substring(0, 3)}****${phone.substring(7)}`
|
||||
const {username, email, phone} = props.profile
|
||||
|
||||
switch (true) {
|
||||
case !!username: return username
|
||||
case !!phone: return `${phone.substring(0, 3)}****${phone.substring(7)}`
|
||||
case !!email: return email
|
||||
default: return null
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
const handleAvatarClick = () => {
|
||||
@@ -55,22 +57,14 @@ export default function UserCenter(props: UserCenterProps) {
|
||||
<AvatarImage src={props.profile.avatar} alt="avatar"/>
|
||||
<AvatarFallback className="bg-primary-muted"><UserIcon/></AvatarFallback>
|
||||
</Avatar>
|
||||
{/* 根据是否在后台页面显示不同内容 */}
|
||||
{isAdminPage ? (
|
||||
<span>{displayName() || '用户'}</span> // 后台显示姓名/脱敏手机号/默认"用户"
|
||||
<span>{displayName() || '用户'}</span>
|
||||
) : (
|
||||
<span>进入控制台</span> // 前台显示"进入控制台"
|
||||
<span>进入控制台</span>
|
||||
)}
|
||||
</Button>
|
||||
</HoverCardTrigger>
|
||||
<HoverCardContent className="w-36 p-1" align="end">
|
||||
{/* <Button
|
||||
theme="ghost"
|
||||
className="w-full justify-start text-sm h-9 px-3"
|
||||
onClick={() => router.push('/admin/profile')}>
|
||||
<UserPenIcon/>
|
||||
个人中心
|
||||
</Button> */}
|
||||
<Button
|
||||
theme="ghost"
|
||||
color="fail"
|
||||
|
||||
Reference in New Issue
Block a user