import{m as _,v as x,x as e,E as m,F as v,o as w,B as C,C as b,D as y}from"./normalize-8daa80b1.js";import{a as I}from"./axios-4a70c6fc.js";import{_ as U}from"./_plugin-vue_export-helper-c27b6911.js";import"./base-a9e1396c.js";/* empty css                   */import{E as d}from"./index-bd490e64.js";import"./aria-fbed35f0.js";import"./config-provider-ecb8405d.js";/*! js-cookie v3.0.5 | MIT */function u(o){for(var r=1;r<arguments.length;r++){var a=arguments[r];for(var p in a)o[p]=a[p]}return o}var k={read:function(o){return o[0]==='"'&&(o=o.slice(1,-1)),o.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(o){return encodeURIComponent(o).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function f(o,r){function a(n,s,t){if(!(typeof document>"u")){t=u({},r,t),typeof t.expires=="number"&&(t.expires=new Date(Date.now()+t.expires*864e5)),t.expires&&(t.expires=t.expires.toUTCString()),n=encodeURIComponent(n).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var i="";for(var l in t)t[l]&&(i+="; "+l,t[l]!==!0&&(i+="="+t[l].split(";")[0]));return document.cookie=n+"="+o.write(s,n)+i}}function p(n){if(!(typeof document>"u"||arguments.length&&!n)){for(var s=document.cookie?document.cookie.split("; "):[],t={},i=0;i<s.length;i++){var l=s[i].split("="),g=l.slice(1).join("=");try{var h=decodeURIComponent(l[0]);if(t[h]=o.read(g,h),n===h)break}catch{}}return n?t[n]:t}}return Object.create({set:a,get:p,remove:function(n,s){a(n,"",u({},s,{expires:-1}))},withAttributes:function(n){return f(this.converter,u({},this.attributes,n))},withConverter:function(n){return f(u({},this.converter,n),this.attributes)}},{attributes:{value:Object.freeze(r)},converter:{value:Object.freeze(o)}})}var B=f(k,{path:"/"});const c=o=>(C("data-v-5e08dec7"),o=o(),b(),o),D={class:"limiter"},A={class:"container-login100"},E={class:"wrap-login100 p-l-55 p-r-55 p-t-65 p-b-54"},R={class:"login100-form validate-form"},j=c(()=>e("span",{class:"login100-form-title p-b-21"}," 後台系統 ",-1)),F={class:"wrap-input100 validate-input m-b-23","data-validate":"Username is reauired"},M=c(()=>e("span",{class:"label-input100"},"用戶帳號",-1)),S=c(()=>e("span",{class:"focus-input100","data-symbol":""},null,-1)),V={class:"wrap-input100 validate-input m-b-23","data-validate":"Password is required"},z=c(()=>e("span",{class:"label-input100"},"用戶密碼",-1)),O=c(()=>e("span",{class:"focus-input100","data-symbol":""},null,-1)),q={class:"wrap-input100 validate-input","data-validate":"Captcha is required"},T=c(()=>e("span",{class:"label-input100"},"輸入驗證碼",-1)),P={class:"captcha-combo"},G=["src"],H=c(()=>e("span",{class:"focus-input100","data-symbol":""},null,-1)),J=c(()=>e("div",{class:"text-right p-t-8 p-b-31"},[e("a",{href:"#"})],-1)),K=c(()=>e("div",{class:"login100-form-bgbtn"},null,-1)),L={__name:"index",setup(o){const r=_("http://localhost:8080/admin/index.php?act=captcha&"+Math.random()),a=_({username:"",password:"",captcha:"",remember:!1}),p=()=>{r.value="http://localhost:8080/admin/index.php?act=captcha&"+Math.random()},n=async()=>{if(a.value.username=="")return d.error("請輸入帳號");if(a.value.password=="")return d.error("請輸入密碼");if(a.value.captcha=="")return d.error("請輸入驗證碼");try{let{data:s}=await I.post("http://localhost:8080/admin/privilege.php?act=signin",a.value);if(s.code!==200)return r.value="http://localhost:8080/admin/index.php?act=captcha&"+Math.random(),d.error(s.data.msg);B.set("Authorization","Bearer "+s.token),window.location.href="index.php"}catch(s){console.log(s)}};return(s,t)=>(w(),x("div",D,[e("div",A,[e("div",E,[e("form",R,[j,e("div",F,[M,m(e("input",{class:"input100",type:"text","onUpdate:modelValue":t[0]||(t[0]=i=>a.value.username=i),placeholder:"請輸入您的帳號"},null,512),[[v,a.value.username]]),S]),e("div",V,[z,m(e("input",{class:"input100",type:"password","onUpdate:modelValue":t[1]||(t[1]=i=>a.value.password=i),placeholder:"請輸入您的密碼"},null,512),[[v,a.value.password]]),O]),e("div",q,[T,e("div",P,[e("div",null,[m(e("input",{class:"input80",type:"text",style:{"text-transform":"uppercase"},"onUpdate:modelValue":t[2]||(t[2]=i=>a.value.captcha=i),placeholder:"請輸入您的圖形驗證碼"},null,512),[[v,a.value.captcha]])]),e("div",null,[e("img",{src:r.value,alt:"captcha",onClick:p},null,8,G)])]),H]),J,e("div",{class:"container-login100-form-btn"},[e("div",{class:"wrap-login100-form-btn"},[K,e("button",{type:"button",class:"login100-form-btn",onClick:n}," 登入 ")])])])])])]))}},Q=U(L,[["__scopeId","data-v-5e08dec7"]]);y(Q).mount("#app");
