Compare commits
5 Commits
81dff2e5e2
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 9b8a188038 | |||
| a2003ebf6a | |||
| 420fcaee08 | |||
| b84f41cc31 | |||
| 6571d91c7a |
@@ -76,9 +76,19 @@ const IframePostMessage = () => {
|
||||
* fetchAndStoreEmail
|
||||
* 调用 /console/api/account/profile 接口,获取当前用户信息,
|
||||
* 并将其中的 email 字段写入浏览器 Cookie。
|
||||
* 若当前页面 URL 携带 key 参数或包含子串 roma,则跳过请求与写入。
|
||||
*/
|
||||
const fetchAndStoreEmail = async () => {
|
||||
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 email = profile?.email || ''
|
||||
if (email) {
|
||||
|
||||
Reference in New Issue
Block a user