1 |
- import{d as N,a as w,r as $,K as r,aq as F,e as i,f as B,j as a,L as s,G as v,i as d,y as m,C as y,n as R,t as x,m as g,am as L,ae as U,ac as T,ab as D,u as S,Z as K}from"./vue-A59npLRR.js";import{_ as P,a as q}from"./wechat_mp-zANTKHXk.js";import{b as z,i as E,a as I,u as M}from"./oauth-flw5HISP.js";import{b as h}from"./validate-_EUdkMt3.js";import{_ as j}from"./index-EwE51S_X.js";const G={class:"third-party"},W=N({__name:"userProfile",setup(Z){const p=w(),u=w(),e=$({sources:{},showUnbind:!1,unbindForm:{password:""},unbindRules:{password:[h({name:"required",title:"账户密码"}),h({name:"password"})]},unbindLoading:!1,sourceTempName:""});z().then(t=>{e.sources=t.data.sources});const c=t=>{if(e.sources[t]=="Unbound"){if(t=="wechat_mp"&&!E())return K({type:"error",message:"请在微信内置浏览器打开!"}),!1;I(t,"bind")}else e.showUnbind=!0,e.sourceTempName=t,setTimeout(()=>{p.value.focus()},200)},f=t=>{t&&t.validate(o=>{o&&M({...e.unbindForm,name:e.sourceTempName}).then(l=>{e.showUnbind=!1,e.sources[l.data.name]="Unbound"}).catch(()=>{})})};return(t,o)=>{const l=r("el-tooltip"),b=r("el-form-item"),k=r("el-form"),_=r("el-button"),C=r("el-dialog"),V=F("blur");return i(),B("div",null,[a(b,{label:"绑定信息"},{default:s(()=>[d("div",G,[e.sources.wechat_scan?(i(),m(l,{key:0,effect:"dark",content:"微信扫码登录绑定",placement:"top"},{default:s(()=>[d("img",{onClick:o[0]||(o[0]=n=>c("wechat_scan")),class:v([e.sources.wechat_scan==="Unbound"?"grey":"","third-party-logo"]),src:P,alt:""},null,2)]),_:1})):y("",!0),e.sources.wechat_mp?(i(),m(l,{key:1,effect:"dark",content:"微信内登录绑定",placement:"top"},{default:s(()=>[d("img",{onClick:o[1]||(o[1]=n=>c("wechat_mp")),class:v([e.sources.wechat_mp==="Unbound"?"grey":"","third-party-logo"]),src:q,alt:""},null,2)]),_:1})):y("",!0)]),a(C,{title:"输入账户密码以解除绑定",modelValue:e.showUnbind,"onUpdate:modelValue":o[7]||(o[7]=n=>e.showUnbind=n),class:"ba-unbind-dialog","destroy-on-close":!0,"close-on-click-modal":!1,width:"30%"},{footer:s(()=>[d("div",{style:R("width: calc(100% - 20px)")},[a(_,{onClick:o[5]||(o[5]=n=>e.showUnbind=!1)},{default:s(()=>[g(x(t.$t("Cancel")),1)]),_:1}),L((i(),m(_,{loading:e.unbindLoading,onClick:o[6]||(o[6]=n=>f(u.value)),type:"primary"},{default:s(()=>[g(" 解绑 ")]),_:1},8,["loading"])),[[V]])],4)]),default:s(()=>[a(k,{model:e.unbindForm,rules:e.unbindRules,"label-position":"top",ref_key:"unbindFormRef",ref:u,onKeyup:o[3]||(o[3]=T(U(n=>f(u.value),["stop"]),["enter"])),onSubmit:o[4]||(o[4]=U(()=>{},["prevent"]))},{default:s(()=>[a(b,{prop:"password"},{default:s(()=>[a(S(D),{ref_key:"passwordRef",ref:p,type:"password",clearable:"",modelValue:e.unbindForm.password,"onUpdate:modelValue":o[2]||(o[2]=n=>e.unbindForm.password=n),"show-password":!0,placeholder:t.$t("Please input field",{field:t.$t("密码")})},null,8,["modelValue","placeholder"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["modelValue"])]),_:1})])}}}),X=j(W,[["__scopeId","data-v-1ddb6717"]]);export{X as U};
|