1import{_ as b,r as p,c as I,h as R}from"./index-DtSwWHNb.js";import{_ as S}from"./XTextButton.vue_vue_type_style_index_0_scoped_7561ab3f_lang-D9-kGU56.js";import{S as y}from"./constants-B0rL6szZ.js";import{g as q}from"./index-DbGW5zVF.js";import{$ as x,_ as N}from"./form-designer-ClxUBbeh.js";import{x as j,r as L,l as P,f as $,y as d,F as z,G as m,P as i,C as f,M as F,z as h,O as w,L as g,u as G}from"./form-create-Czj-GaDQ.js";const M=b(S,[["__scopeId","data-v-7561ab3f"]]),O=["src"],A={class:"mr-5"},B=j({name:"UserSocial",__name:"UserSocial",props:{activeName:{}},emits:["update:activeName"],setup(D,{emit:_}){const u=I(),r=L([]),n=R(),v=_,C=()=>{const t=(a="type",new URL(decodeURIComponent(location.href)).searchParams.get(a)??"");var a;const e=n.query.code,s=n.query.state;e&&((l,o,c)=>p.post({url:"/system/social-user/bind",data:{type:l,code:o,state:c}}))(t,e,s).then(()=>{u.success("\u7ED1\u5B9A\u6210\u529F"),v("update:activeName","userSocial")})},k=t=>{const a=location.origin+"/user/profile?"+encodeURIComponent(`type=${t.type}`);((e,s)=>p.get({url:"/system/auth/social-auth-redirect?type="+e+"&redirectUri="+s}))(t.type,encodeURIComponent(a)).then(e=>{window.location.href=e})},U=async t=>{var a,e;await(a=t.type,e=t.openid,p.delete({url:"/system/social-user/unbind",data:{type:a,openid:e}}))&&(t.openid=void 0),u.success("\u89E3\u7ED1\u6210\u529F")};return P(async()=>{await(async()=>{r.value=[];const t=await q();for(const a in y){const e={...y[a]};if(r.value.push(e),t&&t.length>0){for(const s of t)if(e.type===s.type){e.openid=s.openid;break}}}})()}),$(()=>n,()=>{C()},{immediate:!0}),(t,a)=>{const e=x,s=M,l=N;return d(),z(l,{data:G(r),"show-header":!1},{default:m(()=>[i(e,{fixed:"left",title:"\u5E8F\u53F7",type:"seq",width:"60"}),i(e,{align:"left",label:"\u793E\u4EA4\u5E73\u53F0",width:"120"},{default:m(({row:o})=>[f("img",{src:o.img,alt:"",class:"h-5 align-middle"},null,8,O),f("p",A,F(o.title),1)]),_:1}),i(e,{align:"center",label:"\u64CD\u4F5C"},{default:m(({row:o})=>[o.openid?(d(),h(w,{key:0},[a[0]||(a[0]=g(" \u5DF2\u7ED1\u5B9A ")),i(s,{class:"mr-5",title:"(\u89E3\u7ED1)",type:"primary",onClick:c=>U(o)},null,8,["onClick"])],64)):(d(),h(w,{key:1},[a[1]||(a[1]=g(" \u672A\u7ED1\u5B9A ")),i(s,{class:"mr-5",title:"(\u7ED1\u5B9A)",type:"primary",onClick:c=>k(o)},null,8,["onClick"])],64))]),_:1})]),_:1},8,["data"])}}});export{B as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.