PageSourceSearch

https://fastdetect.net/assets/LoginView-a7463c73.js

js fastdetect.net collected 2026-09-28 07:14:23 UTC 4,517 bytes, 1 lines download raw bytes

1import{e as L,f as $,u as q,h as w,S as A,r as f,o as N,c as S,w as c,a as i,t as p,b as l,m as M,d as b,T,M as h,n as U}from"./index-ec27fdd6.js";import{A as z}from"./AppLayout-fe5daed4.js";import{C as B}from"./CaptchaInput-656efc15.js";import{_ as D}from"./_plugin-vue_export-helper-c27b6911.js";import"./LanguageToggle-392e7470.js";const F={class:"login-container"},P={class:"login-card"},x={class:"login-header"},E={class:"forgot-password-link"},Y={class:"login-footer"},j={__name:"LoginView",setup(G){const k=L(),u=$(),{t:s}=q(),v=w(),d=w(),r=A({email:"",password:"",captcha_code:""}),g=w({captcha_id:"",captcha_code:""}),y={email:[{required:!0,message:()=>s("auth.emailRequired"),trigger:"blur"},{type:"email",message:()=>s("auth.emailInvalid"),trigger:"blur"}],password:[{required:!0,message:()=>s("auth.passwordRequired"),trigger:"blur"},{min:6,message:()=>s("auth.passwordMinLength"),trigger:"blur"}],captcha_code:[{required:!0,message:()=>s("auth.captchaRequired"),trigger:"blur"},{min:4,max:4,message:()=>s("auth.captchaInvalid"),trigger:"blur"}]},R=e=>{g.value=e,r.captcha_code=e.captcha_code},C=e=>{r.email=e.toLowerCase()},V=async()=>{if(v.value)try{if(!await v.value.validate())return;if(!g.value.captcha_id||!g.value.captcha_code){h.error(s("auth.captchaRequired"));return}const n={...r,captcha_id:g.value.captcha_id,captcha_code:g.value.captcha_code},o=await u.login(n);if(console.log("登录结果:",o),console.log("当前认证状态:",u.isAuthenticated),o.success)h.success(o.message||"登录成功"),console.log("准备跳转到dashboard"),await U(),await new Promise(a=>setTimeout(a,100)),console.log("跳转前认证状态:",u.isAuthenticated),console.log("跳转前用户信息:",!!u.user),console.log("跳转前token状态:",!!u.tokens.access),u.isAuthenticated?(k.push("/dashboard"),console.log("已执行登录路由跳转")):(console.error("认证状态检查失败,无法跳转"),h.error("认证状态异常,请重新登录"));else{if(console.log("登录失败:",o.message),console.log("错误详情:",o.errors),o.errors&&o.errors.captcha_code){d.value&&d.value.refresh(),h.error(o.errors.captcha_code[0]||s("auth.captchaInvalid"));return}let a=o.message||"登录失败";if(o.errors){const m=o.errors.non_field_errors;if(m&&m.length>0){const t=m[0];console.log("后端错误文本:",t),t.includes("邮箱尚未注册")||t.includes("not registered")?a=s("auth.emailNotRegistered"):t.includes("密码错误")||t.includes("Incorrect password")||t.includes("incorrect")?a=s("auth.passwordIncorrect"):t.includes("已被禁用")||t.includes("disabled")?a=s("auth.accountDisabled"):a=t}}console.log("最终显示的错误信息:",a),h.error(a),(a.includes("验证码")||a.includes("captcha"))&&d.value&&d.value.refresh()}}catch(e){console.error("登录表单验证失败:",e),h.error("登录过程中发生错误,请稍后重试"),d.value&&d.value.refresh()}};return(e,n)=>{const o=f("el-input"),a=f("el-form-item"),m=f("el-button"),t=f("router-link"),I=f("el-form");return N(),S(z,null,{default:c(()=>[i("div",F,[i("div",P,[i("div",x,[i("h2",null,p(e.$t("title.appName")),1),i("p",null,p(e.$t("auth.loginSubtitle")),1)]),l(I,{ref_key:"loginFormRef",ref:v,model:r,rules:y,class:"login-form",onSubmit:T(V,["prevent"])},{default:c(()=>[l(a,{prop:"email"},{default:c(()=>[l(o,{modelValue:r.email,"onUpdate:modelValue":n[0]||(n[0]=_=>r.email=_),type:"email",placeholder:e.$t("auth.emailPlaceholder"),"prefix-icon":"User",size:"large",onInput:C},null,8,["modelValue","placeholder"])]),_:1}),l(a,{prop:"password"},{default:c(()=>[l(o,{modelValue:r.password,"onUpdate:modelValue":n[1]||(n[1]=_=>r.password=_),type:"password",placeholder:e.$t("auth.passwordPlaceholder"),"prefix-icon":"Lock",size:"large","show-password":""},null,8,["modelValue","placeholder"])]),_:1}),l(B,{ref_key:"captchaRef",ref:d,modelValue:r.captcha_code,"onUpdate:modelValue":n[2]||(n[2]=_=>r.captcha_code=_),size:"large",onCaptchaChange:R},null,8,["modelValue"]),l(a,null,{default:c(()=>[l(m,{type:"primary",size:"large",loading:M(u).loading,onClick:V,class:"login-button"},{default:c(()=>
1[b(p(e.$t("auth.loginButton")),1)]),_:1},8,["loading"])]),_:1}),i("div",E,[l(t,{to:"/forgot-password",class:"link"},{default:c(()=>[b(p(e.$t("auth.forgotPassword")),1)]),_:1})])]),_:1},8,["model"]),i("div",Y,[i("span",null,p(e.$t("auth.noAccountYet")),1),l(t,{to:"/register",class:"register-link"},{default:c(()=>[b(p(e.$t("auth.signUpNow")),1)]),_:1})])])])]),_:1})}}},W=D(j,[["__scopeId","data-v-e000ecde"]]);export{W 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.