var d=(e,t,o)=>new Promise((p,m)=>{var F=u=>{try{n(o.next(u))}catch(r){m(r)}},i=u=>{try{n(o.throw(u))}catch(r){m(r)}},n=u=>u.done?p(u.value):Promise.resolve(u.value).then(F,i);n((o=o.apply(e,t)).next())});import{d as _,U as c,a2 as B,ad as C,af as s,k as a,G as l,a4 as E}from"./vue-vendor-CxLCUzY4.js";import{P as k}from"./index-CRgSyMPH.js";import{h as A,ab as D,_ as T}from"./index-Cy4uayzW.js";import{J as f}from"./antd-vue-vendor-CahNzUUa.js";import"./useContentHeight-XU-h1taH.js";import"./useWindowSizeFn-DDyhhqyw.js";import"./vxe-table-vendor-Cdi8WfTx.js";import"./useContentViewHeight-Qm4QNm5l.js";import"./usePageContext-CXQdt-5h.js";import"./injectionKey-DPVn4AgL.js";const g=()=>A.post({url:"/mock/user/tokenExpired"}),x=_({name:"TestSessionTimeout",components:{ACardGrid:f.Grid,ACard:f,PageWrapper:k},setup(){const e=D();function t(){return d(this,null,function*(){e.setToken(void 0),e.setSessionTimeout(!0)})}function o(){return d(this,null,function*(){try{yield g()}catch(p){}})}return{test1:t,test2:o}}});function y(e,t,o,p,m,F){const i=c("a-button"),n=c("a-card-grid"),u=c("a-card"),r=c("PageWrapper");return B(),C(r,{title:"登录过期示例",content:"用户登录过期示例，不再跳转登录页，直接生成页面覆盖当前页面，方便保持过期前的用户状态！"},{default:s(()=>[a(u,{title:"请点击下面的按钮访问测试接口",extra:"所访问的接口会返回Token过期响应"},{default:s(()=>[a(n,{style:{width:"50%","text-align":"center"}},{default:s(()=>[a(i,{type:"primary",onClick:e.test1},{default:s(()=>t[0]||(t[0]=[l("HttpStatus == 401")])),_:1},8,["onClick"])]),_:1}),a(n,{style:{width:"50%","text-align":"center"}},{default:s(()=>[t[2]||(t[2]=E("span",null,null,-1)),a(i,{class:"ml-4",type:"primary",onClick:e.test2},{default:s(()=>t[1]||(t[1]=[l("Response.code == 401")])),_:1},8,["onClick"])]),_:1})]),_:1})]),_:1})}const V=T(x,[["render",y]]);export{V as default};
