Compare commits

..

5 Commits

Author SHA1 Message Date
9b8a188038 增加忽略roma的配置 2026-03-03 14:55:23 +08:00
a2003ebf6a 移除日志 2026-02-28 12:00:49 +08:00
420fcaee08 添加日志打印 2026-02-27 14:31:40 +08:00
b84f41cc31 通过url中携带的参数来判断 2026-02-27 10:39:45 +08:00
6571d91c7a 在iframe中则不请求接口和写入email 2026-02-26 18:29:52 +08:00

View File

@@ -76,9 +76,19 @@ const IframePostMessage = () => {
* fetchAndStoreEmail * fetchAndStoreEmail
* 调用 /console/api/account/profile 接口,获取当前用户信息, * 调用 /console/api/account/profile 接口,获取当前用户信息,
* 并将其中的 email 字段写入浏览器 Cookie。 * 并将其中的 email 字段写入浏览器 Cookie。
* 若当前页面 URL 携带 key 参数或包含子串 roma则跳过请求与写入。
*/ */
const fetchAndStoreEmail = async () => { const fetchAndStoreEmail = async () => {
try { try {
if (typeof window !== 'undefined') {
try {
const url = new URL(globalThis.location.href)
const hasKeyParam = url.searchParams.has('key')
const hasRoma = url.href.toLowerCase().includes('roma')
if (hasKeyParam || hasRoma) return
} catch {}
}
//获取页面路径如果url中包含字符串roma则不进行任何处理
const profile = await get<{ email: string }>('/account/profile') const profile = await get<{ email: string }>('/account/profile')
const email = profile?.email || '' const email = profile?.email || ''
if (email) { if (email) {