feat(auth): 添加调试日志并优化卡片背景样式
This commit is contained in:
BIN
public/card-bg.png
Normal file
BIN
public/card-bg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 71 KiB |
@@ -182,6 +182,9 @@
|
||||
const reloadButton = document.getElementById('reload')
|
||||
const logNode = document.getElementById('log')
|
||||
const iframeOrigin = window.location.origin
|
||||
const apiBaseUrl = ['127.0.0.1', 'localhost'].includes(window.location.hostname)
|
||||
? `${window.location.origin}/api`
|
||||
: 'https://playx-api.cjdhr.top/api'
|
||||
const maxLogEntries = 80
|
||||
const logEntries = []
|
||||
const heightLogDelay = 300
|
||||
@@ -236,7 +239,7 @@
|
||||
return existingToken
|
||||
}
|
||||
|
||||
const response = await fetch(`/api/v1/temLogin?username=${encodeURIComponent(username)}`, {
|
||||
const response = await fetch(`${apiBaseUrl}/v1/temLogin?username=${encodeURIComponent(username)}`, {
|
||||
method: 'GET',
|
||||
})
|
||||
|
||||
|
||||
@@ -50,6 +50,19 @@ export function AuthGuide({children}: PropsWithChildren) {
|
||||
}
|
||||
|
||||
const {language, token} = message.payload
|
||||
const normalizedLanguage =
|
||||
typeof language === 'string' && language.trim()
|
||||
? normalizeLanguage(language)
|
||||
: undefined
|
||||
|
||||
console.log('[playx] received host payload:', {
|
||||
payload: message.payload,
|
||||
normalizedLanguage,
|
||||
tokenPreview:
|
||||
typeof token === 'string' && token.trim()
|
||||
? `${token.trim().slice(0, 12)}...`
|
||||
: undefined,
|
||||
})
|
||||
|
||||
if (typeof token === 'string' && token.trim()) {
|
||||
const normalizedToken = token.trim()
|
||||
@@ -63,7 +76,7 @@ export function AuthGuide({children}: PropsWithChildren) {
|
||||
}
|
||||
|
||||
if (typeof language === 'string' && language.trim()) {
|
||||
setLanguage(normalizeLanguage(language))
|
||||
setLanguage(normalizedLanguage ?? normalizeLanguage(language))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -172,31 +172,31 @@ body::-webkit-scrollbar,
|
||||
overflow: hidden;
|
||||
border-radius: 16px;
|
||||
border: 1px solid rgba(255, 214, 156, 0.12);
|
||||
background-image: url("/card-bg.png");
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
background-size: 100% 100%;
|
||||
box-shadow:
|
||||
inset 0 1px 0 rgba(255, 232, 193, 0.08),
|
||||
0 18px 32px rgba(0, 0, 0, 0.22);
|
||||
}
|
||||
|
||||
.home-stat-card::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background:
|
||||
radial-gradient(circle at 14% 18%, rgba(255, 194, 84, 0.14), transparent 36%),
|
||||
linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0));
|
||||
pointer-events: none;
|
||||
content: none;
|
||||
}
|
||||
|
||||
.home-stat-card-claim {
|
||||
background:
|
||||
linear-gradient(180deg, rgba(102, 76, 54, 0.16), rgba(58, 39, 28, 0.18)),
|
||||
linear-gradient(135deg, rgba(88, 58, 40, 0.96) 0%, rgba(60, 42, 31, 0.94) 44%, rgba(49, 34, 27, 0.92) 100%);
|
||||
background-image: url("/card-bg.png");
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.home-stat-card-limit {
|
||||
background:
|
||||
linear-gradient(180deg, rgba(124, 88, 57, 0.14), rgba(67, 47, 34, 0.12)),
|
||||
linear-gradient(135deg, rgba(99, 72, 50, 0.96) 0%, rgba(70, 48, 35, 0.95) 46%, rgba(55, 37, 28, 0.94) 100%);
|
||||
background-image: url("/card-bg.png");
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.home-withdraw-card {
|
||||
|
||||
@@ -45,7 +45,7 @@ function QuickNavCard({icon: Icon, label, to}: QuickNavCardProps) {
|
||||
return (
|
||||
<MotionLink
|
||||
to={to}
|
||||
className="liquid-glass-bg flex items-center justify-between gap-[12px] rounded-[12px] px-[12px] py-[8px] text-[13px] text-white/88 transition-colors hover:bg-white/28 focus-visible:ring-2 focus-visible:ring-[#FE9F00] focus-visible:ring-offset-2 focus-visible:ring-offset-[#08070E]"
|
||||
className="liquid-glass-bg flex items-center justify-between gap-[12px] rounded-[12px] px-[8px] py-[8px] text-[13px] text-white/88 transition-colors hover:bg-white/28 focus-visible:ring-2 focus-visible:ring-[#FE9F00] focus-visible:ring-offset-2 focus-visible:ring-offset-[#08070E]"
|
||||
{...tapMotionProps}
|
||||
>
|
||||
<div className="flex min-w-0 items-center gap-[10px]">
|
||||
@@ -157,7 +157,7 @@ function HomePage() {
|
||||
<QuickNavCard to="/account" icon={UserRound} label={t('nav.account')}/>
|
||||
<MotionButton
|
||||
type="button"
|
||||
className="liquid-glass-bg flex items-center justify-between gap-[12px] rounded-[12px] px-[12px] py-[8px] text-[13px] text-white/88 transition-colors hover:bg-white/28 focus-visible:ring-2 focus-visible:ring-[#FE9F00] focus-visible:ring-offset-2 focus-visible:ring-offset-[#08070E]"
|
||||
className="liquid-glass-bg flex items-center justify-between gap-[12px] rounded-[12px] px-[8px] py-[8px] text-[13px] text-white/88 transition-colors hover:bg-white/28 focus-visible:ring-2 focus-visible:ring-[#FE9F00] focus-visible:ring-offset-2 focus-visible:ring-offset-[#08070E]"
|
||||
onClick={() => setLanguageModalOpen(true)}
|
||||
{...tapMotionProps}
|
||||
>
|
||||
@@ -231,8 +231,8 @@ function HomePage() {
|
||||
<div className="flex min-w-0 flex-1 flex-col gap-3">
|
||||
<div className="grid grid-cols-[minmax(0,7fr)_minmax(0,3fr)] gap-3">
|
||||
<div
|
||||
className="home-withdraw-card pc-hover-float h-full min-h-[120px] py-[14px] sm:py-[18px]">
|
||||
<div className="flex h-full w-full flex-col justify-between gap-[18px]">
|
||||
className="home-withdraw-card pc-hover-float h-full min-h-[120px] pt-[14px] sm:py-[18px]">
|
||||
<div className="flex h-full w-full flex-col justify-between gap-[18px] sm:gap-[30px]">
|
||||
<div
|
||||
className="text-center text-[11px] font-medium tracking-[0.06em] text-white/88 drop-shadow-[0_1px_10px_rgba(0,0,0,0.28)] sm:text-[14px] sm:tracking-[0.16em]">{t('home.availableForWithdrawal')}</div>
|
||||
<div className="flex flex-1 items-center justify-center text-center">
|
||||
|
||||
Reference in New Issue
Block a user