import{d as k,V as y,a3 as A,X as F,r as c,o as I,c as t,e as g,f as v,h as l,i as n,F as S,j as L,k as N,m as x,E as D}from"./index.0308b213.js";import J from"./LoginPage.ad2bcaa4.js";const M=x("\u786E\u8BA4"),X=k({setup(O){const{router:h,route:U}=y(),{login:V}=A(),{getConfig:j,updateInfo:b}=F(),i=c({}),u=c([]),a=c(""),m=c(!1),d=r=>{i.value=r,V({...r,sid:a.value}).then(e=>{if(console.log(e,"res1231"),e.stores){if(u.value=e.stores,u.value.length==1){a.value=u.value[0].id,d(i.value);return}m.value=!0;return}let p=localStorage.getItem("shangpu_pinia-website-info")||"",s=JSON.parse(p);s.config.web_logo=e.logo,s.config.web_name=e.name;const _=JSON.stringify(s);localStorage.setItem("shangpu_pinia-website-info",_),b(e.name,e.logo,"","");const f="/pawn";h.replace(f)}).catch(e=>{console.log(e)})},w=()=>{if(!a.value){D.error("\u8BF7\u9009\u62E9\u5E73\u53F0");return}d(i.value)};return I(()=>{}),(r,e)=>{const p=t("el-option"),s=t("el-select"),_=t("el-form-item"),f=t("el-form"),C=t("el-button"),B=t("el-dialog");return g(),v(S,null,[l(J,{"login-title":"\u5178\u5F53",onLogin:d}),l(B,{modelValue:m.value,"onUpdate:modelValue":e[1]||(e[1]=o=>m.value=o),title:"\u9009\u62E9\u5546\u5BB6",width:"30%","destroy-on-close":"",onClose:r.handleSelectStoreDialogClose},{footer:n(()=>[l(C,{type:"primary",onClick:w},{default:n(()=>[M]),_:1})]),default:n(()=>[l(f,null,{default:n(()=>[l(_,null,{default:n(()=>[l(s,{modelValue:a.value,"onUpdate:modelValue":e[0]||(e[0]=o=>a.value=o),style:{width:"100%"}},{default:n(()=>[(g(!0),v(S,null,L(u.value,(o,E)=>(g(),N(p,{key:`select_platform_${E}`,value:o.id,label:o.title},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1},8,["modelValue","onClose"])],64)}}});export{X as default};
