You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
2.1 KiB
2 lines
2.1 KiB
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dynamicAdminRoutes-C1-UxWlb.js","assets/dynamicAdminRoutes-avEHoeGP.js","assets/preload-helper-BIjWqNH5.js","assets/http-LCi9aT1G.js","assets/axios-CiYFffbI.js","assets/runtime-core.esm-bundler-CnFWH3R5.js"])))=>i.map(i=>d[i]);
|
|
import{n as e}from"./axios-CiYFffbI.js";import{I as t,V as n,Y as r,_ as i,it as a,nt as o,p as s,v as c,y as l}from"./runtime-core.esm-bundler-CnFWH3R5.js";import{n as u,t as d}from"./http-LCi9aT1G.js";import{t as f}from"./preload-helper-BIjWqNH5.js";import{c as p,s as m}from"./index-B07osdMA.js";var h={style:{height:`100vh`,display:`grid`,"place-items":`center`,background:`var(--color-fill-2)`}},g=l({__name:`Login`,setup(l){let g=p(),_=m(),v=a(!1),y=o({username:`admin`,password:`admin123456`});async function b(){v.value=!0;try{let{data:t}=await u.post(`/auth/login`,y);localStorage.setItem(d,t.token),e.success(`登录成功`);let{getFirstMenuPath:n}=await f(async()=>{let{getFirstMenuPath:e}=await import(`./dynamicAdminRoutes-C1-UxWlb.js`);return{getFirstMenuPath:e}},__vite__mapDeps([0,1,2,3,4,5])),r=typeof _.query.redirect==`string`?_.query.redirect.trim():``,i=r&&r.startsWith(`/`)&&!r.startsWith(`//`)?r:await n();g.replace(i)}catch(t){e.error(t?.response?.data?.message??`登录失败`)}finally{v.value=!1}}return(e,a)=>{let o=n(`a-input`),l=n(`a-form-item`),u=n(`a-input-password`),d=n(`a-button`),f=n(`a-form`),p=n(`a-card`);return t(),s(`div`,h,[c(p,{title:`苏州市科普场馆地图后台管理系统登录`,style:{width:`380px`}},{default:r(()=>[c(f,{model:y,layout:`vertical`,onSubmitSuccess:b},{default:r(()=>[c(l,{field:`username`,label:`用户名`},{default:r(()=>[c(o,{modelValue:y.username,"onUpdate:modelValue":a[0]||=e=>y.username=e,placeholder:`请输入用户名`},null,8,[`modelValue`])]),_:1}),c(l,{field:`password`,label:`密码`},{default:r(()=>[c(u,{modelValue:y.password,"onUpdate:modelValue":a[1]||=e=>y.password=e,placeholder:`请输入密码`},null,8,[`modelValue`])]),_:1}),c(d,{type:`primary`,long:``,loading:v.value,onClick:b},{default:r(()=>[...a[2]||=[i(`登录`,-1)]]),_:1},8,[`loading`])]),_:1},8,[`model`])]),_:1})])}}});export{g as default}; |