import{p as e,q as s,u as t,s as o,f as r,h as i,w as n,i as a,v as l,j as c,k as u,m as f,x as d}from"./index.7f5f4b6e.js";import{_ as p}from"./logo.c7996d37.js";import{_ as g}from"./plugin-vue_export-helper.21dcd24c.js";var m=g({data:()=>({userInfo:{},canIUseGetUserProfile:!1}),mounted(){uni.getUserProfile?this.canIUseGetUserProfile=!0:this.canIUseGetUserProfile=!1},methods:{getUserProfile(){let o=this;e({title:"授权中"});let r="";s({provider:"weixin",success:e=>{r=e.code}}),uni.getUserProfile({desc:"登录",success:e=>{o.userInfo=e.userInfo,console.log(e.userInfo),t(),o.userInfo,e.iv,e.encryptedData},fail:e=>{t(),console.log(e)}})},getuserinfo(){e({title:"授权中"}),s({provider:"weixin",success:e=>{e.code,uni.getUserInfo({provider:"weixin",success:e=>{this.userInfo=e.userInfo,console.log(e,this.userInfo),t()}})}})},getphonenumber(t){let r=this;"getPhoneNumber:fail user deny"==t.detail.errMsg?o({title:"授权登录后才可使用更多功能",icon:"none"}):(e({title:"绑定中"}),s({provider:"weixin",success:function(e){e.code,t.detail.encryptedData,t.detail.iv,r.key}}))}}},[["render",function(e,s,t,o,g,m){const h=u,I=f,U=d;return r(),i(I,{class:"content"},{default:n((()=>[a(h,{class:"logo",src:p}),l(' \n {{ title }}\n '),a(I,{class:"d-title"},{default:n((()=>[c("星优办公软件申请获取以下权限")])),_:1}),a(I,{class:"d-desc"},{default:n((()=>[c("获得你的公开信息(昵称、头像等)")])),_:1}),g.canIUseGetUserProfile?(r(),i(U,{key:0,class:"btn-login",type:"primary",onClick:m.getUserProfile},{default:n((()=>[c("点击授权")])),_:1},8,["onClick"])):l("v-if",!0),g.canIUseGetUserProfile?l("v-if",!0):(r(),i(U,{key:1,class:"btn-login",type:"primary","open-type":"getUserInfo",withCredentials:"true",onGetuserinfo:m.getuserinfo},{default:n((()=>[c("点击授权 ")])),_:1},8,["onGetuserinfo"])),l(' ')])),_:1})}],["__scopeId","data-v-fe0ee8a8"]]);export{m as default};