PageSourceSearch

https://www.mailblink.corvialabs.ai/assets/MailiveryEmbedTest-BlbK-OJ-.js

js corvialabs.ai collected 2026-10-05 12:05:20 UTC 4,205 bytes, 1 lines download raw bytes

1import{c as v,r as o,j as e}from"./bootstrapApp-D7_qjC6j.js";import"./index-D6z0c_Gc.js";const p="mailivery-embed-test:url",c="mailivery-embed-test:left-at";function h(r){try{return sessionStorage.getItem(r)??""}catch{return""}}function E(){const r=v(),[m,u]=o.useState(()=>h(p)),[n,s]=o.useState(""),[b,d]=o.useState(!1),x=`${window.location.origin}/mailivery-embed-test`,l=h(c),i=o.useMemo(()=>{const t=new URLSearchParams(r.search);return Array.from(t.entries())},[r.search]),y=i.length>0||!!l,f=()=>{const t=m.trim();if(!t){s("请先粘贴 Embed Form URL");return}try{const a=new URL(t);if(a.protocol!=="http:"&&a.protocol!=="https:"){s("URL 必须以 http 或 https 开头");return}}catch{s("这不是一个有效的 URL");return}s("");try{sessionStorage.setItem(p,t),sessionStorage.setItem(c,new Date().toISOString())}catch{}window.location.assign(t)},g=async()=>{try{await navigator.clipboard.writeText(x),d(!0),window.setTimeout(()=>d(!1),2e3)}catch{s("复制失败,请手动复制上方回跳地址")}},j=()=>{try{sessionStorage.removeItem(c)}catch{}window.history.replaceState(null,"","/mailivery-embed-test"),window.location.reload()};return e.jsx("div",{className:"min-h-dvh bg-[#F4F6F8] px-6 py-10 font-body text-[#121A2A]",children:e.jsxs("div",{className:"mx-auto flex w-full max-w-[720px] flex-col gap-6",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-caption font-semibold uppercase tracking-[0.08em] text-[#6B7280]",children:"本地测试页"}),e.jsx("h1",{className:"mt-1 text-[28px] font-semibold leading-9",children:"Mailivery Embed Form 回跳测试"}),e.jsx("p",{className:"mt-2 text-ui leading-6 text-[#4B5563]",children:"把后端手动签发的 Embed URL 贴到下面,点击跳转离开本页。授权结束后,看浏览器会不会回到这个地址,以及 URL 上带了什么参数。"})]}),e.jsxs("section",{className:"rounded-2xl border border-[#E5E7EB] bg-white p-5",children:[e.jsx("p",{className:"text-sm font-semibold",children:"Mailivery 后台应配置的 Return URL"}),e.jsx("p",{className:"mt-1 text-caption leading-5 text-[#6B7280]",children:"Embed Form 不会自动回到「离开前的页面」,只会跳到 Mailivery 后台填的固定回跳地址。测试回跳时请配成下面这一条。"}),e.jsxs("div",{className:"mt-3 flex flex-col gap-2 sm:flex-row",children:[e.jsx("code",{className:"min-h-[40px] flex-1 break-all rounded-lg bg-[#F3F4F6] px-3 py-2 text-sm",children:x}),e.jsx("button",{type:"button",onClick:g,className:"btn-corvia-secondary btn-corvia-sm shrink-0",children:b?"已复制":"复制"})]})]}),y&&e.jsxs("section",{className:"rounded-2xl border border-[#BBF7D0] bg-[#F0FDF4] p-5",children:[e.jsx("p",{className:"text-sm font-semibold text-[#166534]",children:"检测到回到本页"}),l&&e.jsxs("p",{className:"mt-1 text-caption text-[#166534]",children:["上次离开时间:",new Date(l).toLocaleString()]}),i.length>0?e.jsx("dl",{className:"mt-3 grid gap-2",children:i.map(([t,a])=>e.jsxs("div",{className:"rounded-lg bg-white/80 px-3 py-2",children:[e.jsx("dt",{className:"text-caption font-semibold text-[#6B7280]",children:t}),e.jsx("dd",{className:"break-all text-sm",children:a})]},t))}):e.jsx("p",{className:"mt-2 text-sm text-[#166534]",children:"当前没有 query 参数。如果这是授权后回来的,说明 Mailivery 回跳了,但没有带 meta。"}),e.jsx("button",{type:"button",onClick:j,className:"mt-3 text-caption font-medium text-[#166534] underline",children:"清除回跳痕迹"})]}),e.jsxs("section",{className:"rounded-2xl border border-[#E5E7EB] bg-white p-5",children:[e.jsx("label",{htmlFor:"mailivery-embed-url",className:"text-sm font-semibold",children:"Embed Form URL"}),e.jsx("textarea",{id:"mailivery-embed-url",value:m,onChange:t=>{u(t.target.value),n&&s("")},rows:5,placeholder:"https://app.mailivery.io/embed/form?expires=...",className:"mt-2 w-full resize-y rounded-lg border border-[#D1D5DB] px-3 py-2 text-sm outline-none focus:border-[#121A2A]"}),n&&e.jsx("p",{className:"mt-2 text-caption font-medium text-red-600",children:n}),e.jsx("button",{type:"button",onClick:f,className:"btn-corvia-primary mt-4",children:"跳转到 Embed Form"})]})]})})}export{E as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.