1 |
- import{ar as u,d as I,r as h,N as x,z as j,O as L,o as m,j as P,w as d,i,k as v,t as z,c as w,F as U,m as g,a as B,K as F,L as K,__tla as O}from"./index-1e808f2e.js";import{_ as $,__tla as A}from"./XTextButton-c7a74f67.js";import{S as k}from"./constants-e43f22dd.js";import{g as D,__tla as E}from"./profile-94d4cdcc.js";import{u as G,__tla as H}from"./useMessage-5f9e8917.js";import{__tla as J}from"./XTextButton.vue_vue_type_style_index_0_scoped_7561ab3f_lang-a71ee685.js";import"./_plugin-vue_export-helper-1b428a4d.js";let C,M=Promise.all([(()=>{try{return O}catch{}})(),(()=>{try{return A}catch{}})(),(()=>{try{return E}catch{}})(),(()=>{try{return H}catch{}})(),(()=>{try{return J}catch{}})()]).then(async()=>{let _,y;_=["src"],y={class:"mr-5"},C=I({name:"UserSocial",__name:"UserSocial",props:{activeName:{}},emits:["update:activeName"],setup(Q,{emit:b}){const f=G(),c=h([]),l=h(),n=x(),N=b,R=()=>{const t=(e="type",new URL(decodeURIComponent(location.href)).searchParams.get(e)??"");var e;const a=n.query.code,s=n.query.state;a&&((o,r,p)=>u.post({url:"/system/social-user/bind",data:{type:o,code:r,state:p}}))(t,a,s).then(()=>{f.success("\u7ED1\u5B9A\u6210\u529F"),N("update:activeName","userSocial")})},S=t=>{const e=location.origin+"/user/profile?"+encodeURIComponent(`type=${t.type}`);((a,s)=>u.get({url:"/system/auth/social-auth-redirect?type="+a+"&redirectUri="+s}))(t.type,encodeURIComponent(e)).then(a=>{window.location.href=a})},q=async t=>{var e,a;await(e=t.type,a=t.openid,u.delete({url:"/system/social-user/unbind",data:{type:e,openid:a}}))&&(t.openid=void 0),f.success("\u89E3\u7ED1\u6210\u529F")};return j(async()=>{await(async()=>{var e;c.value=[];const t=await D();l.value=t;for(const a in k){const s={...k[a]};if(c.value.push(s),(e=l.value)==null?void 0:e.socialUsers){for(const o in l.value.socialUsers)if(s.type===l.value.socialUsers[o].type){s.openid=l.value.socialUsers[o].openid;break}}}})()}),L(()=>n,()=>{R()},{immediate:!0}),(t,e)=>{const a=F,s=$,o=K;return m(),P(o,{data:B(c),"show-header":!1},{default:d(()=>[i(a,{fixed:"left",title:"\u5E8F\u53F7",type:"seq",width:"60"}),i(a,{align:"left",label:"\u793E\u4EA4\u5E73\u53F0",width:"120"},{default:d(({row:r})=>[v("img",{src:r.img,alt:"",class:"h-5 align-middle"},null,8,_),v("p",y,z(r.title),1)]),_:1}),i(a,{align:"center",label:"\u64CD\u4F5C"},{default:d(({row:r})=>[r.openid?(m(),w(U,{key:0},[g(" \u5DF2\u7ED1\u5B9A "),i(s,{class:"mr-5",title:"(\u89E3\u7ED1)",type:"primary",onClick:p=>q(r)},null,8,["onClick"])],64)):(m(),w(U,{key:1},[g(" \u672A\u7ED1\u5B9A "),i(s,{class:"mr-5",title:"(\u7ED1\u5B9A)",type:"primary",onClick:p=>S(r)},null,8,["onClick"])],64))]),_:1})]),_:1},8,["data"])}}})});export{M as __tla,C as default};
|