1 line
13 KiB
JavaScript
1 line
13 KiB
JavaScript
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,90405,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},53996,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={assign:function(){return l},searchParamsToUrlQuery:function(){return a},urlQueryToSearchParams:function(){return i}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});function a(e){let t={};for(let[r,n]of e.entries()){let e=t[r];void 0===e?t[r]=n:Array.isArray(e)?e.push(n):t[r]=[e,n]}return t}function s(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function i(e){let t=new URLSearchParams;for(let[r,n]of Object.entries(e))if(Array.isArray(n))for(let e of n)t.append(r,s(e));else t.set(r,s(n));return t}function l(e,...t){for(let r of t){for(let t of r.keys())e.delete(t);for(let[t,n]of r.entries())e.append(t,n)}return e}},55020,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return i},formatWithValidation:function(){return u},urlObjectKeys:function(){return l}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let a=e.r(88835)._(e.r(53996)),s=/https?|ftp|gopher|file/;function i(e){let{auth:t,hostname:r}=e,n=e.protocol||"",o=e.pathname||"",i=e.hash||"",l=e.query||"",u=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?u=t+e.host:r&&(u=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(u+=":"+e.port)),l&&"object"==typeof l&&(l=String(a.urlQueryToSearchParams(l)));let c=e.search||l&&`?${l}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||s.test(n))&&!1!==u?(u="//"+(u||""),o&&"/"!==o[0]&&(o="/"+o)):u||(u=""),i&&"#"!==i[0]&&(i="#"+i),c&&"?"!==c[0]&&(c="?"+c),o=o.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${n}${u}${o}${c}${i}`}let l=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function u(e){return i(e)}},45707,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return o}});let n=e.r(34346);function o(e,t){let r=(0,n.useRef)(null),o=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=o.current;t&&(o.current=null,t())}else e&&(r.current=a(e,n)),t&&(o.current=a(t,n))},[e,t])}function a(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},70715,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={DecodeError:function(){return g},MiddlewareNotFoundError:function(){return v},MissingStaticPage:function(){return j},NormalizeError:function(){return x},PageNotFoundError:function(){return b},SP:function(){return m},ST:function(){return y},WEB_VITALS:function(){return a},execOnce:function(){return s},getDisplayName:function(){return f},getLocationOrigin:function(){return u},getURL:function(){return c},isAbsoluteUrl:function(){return l},isResSent:function(){return d},loadGetInitialProps:function(){return h},normalizeRepeatedSlashes:function(){return p},stringifyError:function(){return P}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let a=["CLS","FCP","FID","INP","LCP","TTFB"];function s(e){let t,r=!1;return(...n)=>(r||(r=!0,t=e(...n)),t)}let i=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,l=e=>i.test(e);function u(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function c(){let{href:e}=window.location,t=u();return e.substring(t.length)}function f(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function d(e){return e.finished||e.headersSent}function p(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function h(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await h(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&d(r))return n;if(!n)throw Object.defineProperty(Error(`"${f(e)}.getInitialProps()" should resolve to an object. But found "${n}" instead.`),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return n}let m="undefined"!=typeof performance,y=m&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class g extends Error{}class x extends Error{}class b extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class j extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class v extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function P(e){return JSON.stringify({message:e.message,stack:e.stack})}},17485,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return a}});let n=e.r(70715),o=e.r(57352);function a(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,o.hasBasePath)(r.pathname)}catch(e){return!1}}},85893,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},3965,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return g},useLinkStatus:function(){return b}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let a=e.r(88835),s=e.r(36792),i=a._(e.r(34346)),l=e.r(55020),u=e.r(12569),c=e.r(45707),f=e.r(70715),d=e.r(19664);e.r(90405);let p=e.r(44164),h=e.r(17485),m=e.r(36283);function y(e){return"string"==typeof e?e:(0,l.formatUrl)(e)}function g(t){var r;let n,o,a,[l,g]=(0,i.useOptimistic)(p.IDLE_LINK_STATUS),b=(0,i.useRef)(null),{href:j,as:v,children:P,prefetch:N=null,passHref:O,replace:_,shallow:w,scroll:C,onClick:E,onMouseEnter:S,onTouchStart:T,legacyBehavior:k=!1,onNavigate:R,ref:A,unstable_dynamicOnHover:L,...M}=t;n=P,k&&("string"==typeof n||"number"==typeof n)&&(n=(0,s.jsx)("a",{children:n}));let I=i.default.useContext(u.AppRouterContext),U=!1!==N,$=!1!==N?null===(r=N)||"auto"===r?m.FetchStrategy.PPR:m.FetchStrategy.Full:m.FetchStrategy.PPR,{href:B,as:F}=i.default.useMemo(()=>{let e=y(j);return{href:e,as:v?y(v):e}},[j,v]);if(k){if(n?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});o=i.default.Children.only(n)}let D=k?o&&"object"==typeof o&&o.ref:A,z=i.default.useCallback(e=>(null!==I&&(b.current=(0,p.mountLinkInstance)(e,B,I,$,U,g)),()=>{b.current&&((0,p.unmountLinkForCurrentNavigation)(b.current),b.current=null),(0,p.unmountPrefetchableInstance)(e)}),[U,B,I,$,g]),K={ref:(0,c.useMergedRef)(z,D),onClick(t){k||"function"!=typeof E||E(t),k&&o.props&&"function"==typeof o.props.onClick&&o.props.onClick(t),!I||t.defaultPrevented||function(t,r,n,o,a,s,l){if("undefined"!=typeof window){let u,{nodeName:c}=t.currentTarget;if("A"===c.toUpperCase()&&((u=t.currentTarget.getAttribute("target"))&&"_self"!==u||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,h.isLocalURL)(r)){a&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),l){let e=!1;if(l({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:f}=e.r(35686);i.default.startTransition(()=>{f(n||r,a?"replace":"push",s??!0,o.current)})}}(t,B,F,b,_,C,R)},onMouseEnter(e){k||"function"!=typeof S||S(e),k&&o.props&&"function"==typeof o.props.onMouseEnter&&o.props.onMouseEnter(e),I&&U&&(0,p.onNavigationIntent)(e.currentTarget,!0===L)},onTouchStart:function(e){k||"function"!=typeof T||T(e),k&&o.props&&"function"==typeof o.props.onTouchStart&&o.props.onTouchStart(e),I&&U&&(0,p.onNavigationIntent)(e.currentTarget,!0===L)}};return(0,f.isAbsoluteUrl)(F)?K.href=F:k&&!O&&("a"!==o.type||"href"in o.props)||(K.href=(0,d.addBasePath)(F)),a=k?i.default.cloneElement(o,K):(0,s.jsx)("a",{...M,...K,children:n}),(0,s.jsx)(x.Provider,{value:l,children:a})}e.r(85893);let x=(0,i.createContext)(p.IDLE_LINK_STATUS),b=()=>(0,i.useContext)(x);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},27458,e=>{"use strict";let t=(0,e.i(27706).default)("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);e.s(["BookOpen",()=>t],27458)},53474,e=>{"use strict";var t=e.i(36792),r=e.i(34346),n=e.i(87830),o=e.i(69074),a=e.i(3965),s=e.i(9991),i=e.i(77627),l=e.i(75985),u=e.i(10743),c=e.i(12039),f=e.i(27458);function d(){(0,o.useRouter)();let[e,d]=(0,r.useState)("wang@example.com"),[p,h]=(0,r.useState)("123456"),[m,y]=(0,r.useState)(""),[g,x]=(0,r.useState)(!1),b=async t=>{t.preventDefault(),y(""),x(!0);try{await (0,n.signOut)({redirect:!1}),await new Promise(e=>setTimeout(e,500)),localStorage.clear(),sessionStorage.clear();let t=await (0,n.signIn)("credentials",{email:e,password:p,redirect:!1});t?.error?(y("邮箱或密码错误"),x(!1)):window.location.replace("/")}catch(e){y("登录失败,请稍后重试"),x(!1)}};return(0,t.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-primary/5 via-background to-secondary/5 p-4",children:(0,t.jsxs)(u.Card,{className:"w-full max-w-md",children:[(0,t.jsxs)(u.CardHeader,{className:"space-y-1 text-center",children:[(0,t.jsx)("div",{className:"flex justify-center mb-4",children:(0,t.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-lg bg-primary text-primary-foreground",children:(0,t.jsx)(f.BookOpen,{className:"h-7 w-7"})})}),(0,t.jsx)(u.CardTitle,{className:"text-2xl font-serif",children:"登录"}),(0,t.jsx)(u.CardDescription,{children:"登录到华夏谱家族树系统"})]}),(0,t.jsxs)("form",{onSubmit:b,children:[(0,t.jsxs)(u.CardContent,{className:"space-y-4",children:[m&&(0,t.jsx)(c.Alert,{variant:"destructive",children:(0,t.jsx)(c.AlertDescription,{children:m})}),(0,t.jsx)(c.Alert,{className:"bg-blue-50 border-blue-200 dark:bg-blue-950 dark:border-blue-800",children:(0,t.jsx)(c.AlertDescription,{className:"text-sm text-blue-800 dark:text-blue-200",children:(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("div",{className:"font-semibold",children:"💡 测试账号:"}),(0,t.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{children:"王先生: wang@example.com / 123456"}),(0,t.jsx)(s.Button,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:()=>{d("wang@example.com"),h("123456")},children:"使用"})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{children:"虞女士: yu@example.com / 123456"}),(0,t.jsx)(s.Button,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:()=>{d("yu@example.com"),h("123456")},children:"使用"})]})]})]})})}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(l.Label,{htmlFor:"email",children:"邮箱"}),(0,t.jsx)(i.Input,{id:"email",type:"email",placeholder:"your@email.com",value:e,onChange:e=>d(e.target.value),required:!0,disabled:g})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(l.Label,{htmlFor:"password",children:"密码"}),(0,t.jsx)(i.Input,{id:"password",type:"password",placeholder:"••••••••",value:p,onChange:e=>h(e.target.value),required:!0,disabled:g})]})]}),(0,t.jsxs)(u.CardFooter,{className:"flex flex-col space-y-4",children:[(0,t.jsx)(s.Button,{type:"submit",className:"w-full",disabled:g,children:g?"登录中...":"登录"}),(0,t.jsxs)("div",{className:"text-sm text-center text-muted-foreground",children:["还没有账号?"," ",(0,t.jsx)(a.default,{href:"/auth/register",className:"text-primary hover:underline",children:"立即注册"})]})]})]})]})})}e.s(["default",()=>d])}]); |