var f=(e,o,t)=>new Promise((m,s)=>{var d=u=>{try{r(t.next(u))}catch(i){s(i)}},n=u=>{try{r(t.throw(u))}catch(i){s(i)}},r=u=>u.done?m(u.value):Promise.resolve(u.value).then(d,n);r((t=t.apply(e,o)).next())});import{d as C,e as B,U as a,a2 as F,ad as _,af as c,k as p,a4 as A,G as l}from"./vue-vendor-CxLCUzY4.js";import P from"./CurrentPermissionMode-B4c3wTcN.js";import{U as b,ab as D,z as g,bu as M,bw as w,_ as T}from"./index-CYriLmQo.js";import{P as $}from"./index-BxgvQLkr.js";import{A as v}from"./antd-vue-vendor-CDWW6V_M.js";import"./vxe-table-vendor-B5h3MVdD.js";import"./useContentHeight-DtBiGC0g.js";import"./useWindowSizeFn-BxrEMPtP.js";import"./useContentViewHeight-D71xl1HH.js";import"./usePageContext-CCgh0KDo.js";import"./injectionKey-DPVn4AgL.js";const S=C({components:{Alert:v,CurrentPermissionMode:P,PageWrapper:$},setup(){const{refreshMenu:e}=b(),o=D(),t=g(),m=B(()=>t.getProjectConfig.permissionMode===M.BACK);function s(d){return f(this,null,function*(){const n="fakeToken"+d;o.setToken(n),o.getUserInfoAction(),e()})}return{RoleEnum:w,refreshMenu:e,switchToken:s,isBackPremissionMode:m}}}),U={class:"mt-4"};function y(e,o,t,m,s,d){const n=a("CurrentPermissionMode"),r=a("Alert"),u=a("a-button"),i=a("a-button-group"),E=a("PageWrapper");return F(),_(E,{title:"后台权限示例",contentBackground:"",contentClass:"p-4",content:"目前mock了两组数据， id为1 和 2 具体返回的菜单可以在mock/sys/menu.ts内查看"},{default:c(()=>[p(n),p(r,{class:"mt-4",type:"info",message:"点击后请查看左侧菜单变化","show-icon":""}),A("div",U,[o[4]||(o[4]=l(" 权限切换(请先切换权限模式为后台权限模式): ")),p(i,null,{default:c(()=>[p(u,{onClick:o[0]||(o[0]=k=>e.switchToken(1)),disabled:!e.isBackPremissionMode},{default:c(()=>o[2]||(o[2]=[l(" 获取用户id为1的菜单 ")])),_:1},8,["disabled"]),p(u,{onClick:o[1]||(o[1]=k=>e.switchToken(2)),disabled:!e.isBackPremissionMode},{default:c(()=>o[3]||(o[3]=[l(" 获取用户id为2的菜单 ")])),_:1},8,["disabled"])]),_:1})])]),_:1})}const J=T(S,[["render",y],["__scopeId","data-v-37510850"]]);export{J as default};
