import{a as e,r as a,s,c as t,w as o,i as l,o as n,b as i,d,h as r,R as c,L as u}from"./index-ESTWQ1DK.js";import{t as m}from"./tools.CwkibfPM.js";import{i as p}from"./api.BMgalDqr.js";import{_ as h}from"./_plugin-vue_export-helper.BCo6x5W8.js";const g=h({data:()=>({username:"",password:""}),computed:{...e(["metadata"])},onLoad(){},methods:{login(){a({url:p,header:this.metadata,method:"POST",data:{username:this.username,password:this.password},success:e=>{if(console.log("login",e),0==e.data.code){const a=e.data.data;this.$store.commit("setUsername",a.userName),this.$store.commit("setUserlevel",a.level),this.$store.commit("setToken",a.token),s({title:"登录成功",icon:"none",duration:3e3}),setTimeout((()=>{m.appAction("/pages/actManage/index","uni.switchTab")}),100)}else s({title:`登录失败: ${e.data.message}`,icon:"none",duration:5e3})},fail:e=>{console.log("login err",e)}})},registerClick(){m.appAction("/pages/login/register","uni.navigateTo")}}},[["render",function(e,a,s,m,p,h){const g=l,f=r,_=c,x=u;return n(),t(g,{class:"body body-bg"},{default:o((()=>[i(g,{class:"main uni-column"},{default:o((()=>[i(g,{class:"topLogo"}),i(f,{class:"title"},{default:o((()=>[d("主理人登录")])),_:1}),i(g,{class:"box uni-column"},{default:o((()=>[i(_,{class:"input","placeholder-class":"input-placeholder",type:"text",maxlength:"20",placeholder:"请输入用户名",modelValue:p.username,"onUpdate:modelValue":a[0]||(a[0]=e=>p.username=e)},null,8,["modelValue"]),i(_,{class:"input","placeholder-class":"input-placeholder",password:"",type:"text",maxlength:"20",placeholder:"请输入密码",modelValue:p.password,"onUpdate:modelValue":a[1]||(a[1]=e=>p.password=e)},null,8,["modelValue"]),i(x,{class:"button",onClick:h.login},{default:o((()=>[d("登 录")])),_:1},8,["onClick"]),i(f,{class:"hint"},{default:o((()=>[d("没有账号？点击 "),i(f,{style:{color:"#FF8D1A"},onClick:h.registerClick},{default:o((()=>[d("注册")])),_:1},8,["onClick"])])),_:1})])),_:1}),i(g,{class:"bottomLogo"})])),_:1}),i(f,{class:"bottomText"},{default:o((()=>[d("© 彩图奔跑 All Rights Reserved.")])),_:1})])),_:1})}],["__scopeId","data-v-d3e9cd04"]]);export{g as default};
