1 |
- import{az as u,d as x,r as h,Z as N,b as B,w as E,o as m,C as P,A as d,f as i,B as v,E as j,c as w,F as U,D as g,a as z,W as A,X as D,__tla as F}from"./index-a9d538d5.js";import{_ as L,__tla as W}from"./XTextButton-d3eb23fc.js";import{S as C}from"./constants-c811e5ff.js";import{g as X,__tla as Z}from"./profile-b1c1171f.js";import{u as $,__tla as G}from"./useMessage-d5cbbfad.js";import{__tla as H}from"./XTextButton.vue_vue_type_style_index_0_scoped_7561ab3f_lang-d7de5eb9.js";import"./_plugin-vue_export-helper-1b428a4d.js";let k,J=Promise.all([(()=>{try{return F}catch{}})(),(()=>{try{return W}catch{}})(),(()=>{try{return Z}catch{}})(),(()=>{try{return G}catch{}})(),(()=>{try{return H}catch{}})()]).then(async()=>{let _,y;_=["src"],y={class:"mr-5"},k=x({name:"UserSocial",__name:"UserSocial",props:{activeName:{}},emits:["update:activeName"],setup(K,{emit:b}){const f=$(),c=h([]),l=h(),n=N(),R=b,S=()=>{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"),R("update:activeName","userSocial")})},q=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})},I=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 B(async()=>{await(async()=>{var e;c.value=[];const t=await X();l.value=t;for(const a in C){const s={...C[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}}}})()}),E(()=>n,()=>{S()},{immediate:!0}),(t,e)=>{const a=A,s=L,o=D;return m(),P(o,{data:z(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,j(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=>I(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=>q(r)},null,8,["onClick"])],64))]),_:1})]),_:1},8,["data"])}}})});export{J as __tla,k as default};
|