uniugm/admin/ui/static/static/js/index-DeMa4Gf_.js
2025-06-06 18:30:12 +08:00

3 lines
13 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["static/js/project_op--KKuousu.js","static/js/table-D1Kdvwhj.js","static/js/vendor-yjVdc_EO.js","static/css/vendor-xHoP3d6v.css","static/js/resource-CRV-w0LR.js","static/js/empty-C-RENPGO.js","static/js/string-C8RKaQUb.js","static/css/table-opuiIZbE.css","static/js/project_cdkey-cAsUqlYb.js","static/css/project_cdkey-DtqeEn_d.css","static/js/project-BrSk79BC.js","static/js/user-CMmufT6_.js","static/js/tableUser-DLusgzKc.js","static/css/tableUser-D2eeKgYw.css","static/js/history-Dm6kV19W.js","static/css/history-Baixu_Oz.css","static/js/character-CjX4h7I4.js","static/js/history-DihFgPRL.js","static/js/welcome-glNRwS9e.js","static/js/Login-vcpB3J9K.js","static/css/Login-BwJ0jPRV.css"])))=>i.map(i=>d[i]);
import{c as e,o as t,u as o,R as n,a as s,b as a,w as r,d as c,t as i,E as l,e as u,f as d,h as p,g as h,i as m,j as f,k as g,r as _,l as y,m as I,n as j,p as v,F as k,q as w,s as C,v as E,x as R,y as b,z as x,A as D,B as L,C as P,D as T,G as O,H as A,I as U,J as M,K as z,L as S,M as N,N as B,O as G,P as V}from"./vendor-yjVdc_EO.js";!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))t(e);new MutationObserver((e=>{for(const o of e)if("childList"===o.type)for(const e of o.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&t(e)})).observe(document,{childList:!0,subtree:!0})}function t(e){if(e.ep)return;e.ep=!0;const t=function(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?t.credentials="include":"anonymous"===e.crossOrigin?t.credentials="omit":t.credentials="same-origin",t}(e);fetch(e.href,t)}}();const $={__name:"App",setup:s=>(s,a)=>(t(),e(o(n)))},q={},H=function(e,t,o){let n=Promise.resolve();if(t&&t.length>0){document.getElementsByTagName("link");const e=document.querySelector("meta[property=csp-nonce]"),o=(null==e?void 0:e.nonce)||(null==e?void 0:e.getAttribute("nonce"));n=Promise.allSettled(t.map((e=>{if((e=function(e){return"/"+e}(e))in q)return;q[e]=!0;const t=e.endsWith(".css"),n=t?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${e}"]${n}`))return;const s=document.createElement("link");return s.rel=t?"stylesheet":"modulepreload",t||(s.as="script"),s.crossOrigin="",s.href=e,o&&s.setAttribute("nonce",o),document.head.appendChild(s),t?new Promise(((t,o)=>{s.addEventListener("load",t),s.addEventListener("error",(()=>o(new Error(`Unable to preload CSS for ${e}`))))})):void 0})))}function s(e){const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return n.then((t=>{for(const e of t||[])"rejected"===e.status&&s(e.reason);return e().catch(s)}))};const F=new class{setCache(e,t){window.localStorage.setItem(e,JSON.stringify(t))}getCache(e){const t=window.localStorage.getItem(e);if(t)return JSON.parse(t)}deleteCache(e){window.localStorage.removeItem(e)}clearCache(){}},J={style:{"font-size":"20px"}},K={__name:"errcodeDetail",props:{data:{}},setup(e){const n=e;console.log("打开errcodeDetaildata:",n.data);let u="<span style='font-size: 20px;color: red'>错误详情:</span><span style='font-size: 20px'>";return u+=n.data.detail_msg,u+="<br/>",u+="<span style='font-size: 20px;color: red'>出错代码:</span>",u+=n.data.stack,u+="</span>",(n,d)=>{const p=l;return t(),s("div",null,[a(p,{content:o(u),"raw-content":"",placement:"bottom",effect:"light",style:{"font-size":"20px"}},{default:r((()=>[c("span",J,"原因:"+i(e.data.msg),1)])),_:1},8,["content"])])}}},W=u.create({baseURL:"/api",timeout:15e3,headers:{"Content-type":"application/json;charset=utf-8","Cache-Control":"no-cache",UserId:0,Token:""}});function Q(e,t,o,n,s,a,r){const c={pageNo:e,pageLen:t,userId:o,opResourceType:n,opResourceGroup:s,opResourceKey:a,method:r};return console.log("params:",c),W({url:"/user/history",method:"get",params:c})}W.interceptors.request.use((e=>{let t=X().userInfo,o=Y(),n=t?parseInt(t.user_id,10):0;const s=o?o.token:"";return e.headers=e.headers||{},e.headers.UserId=n,e.headers.Token=s,e.headers.Authorization="Bearer "+s,console.log("获取缓存token:",o," 获取缓存用户数据:",t," 发送http头",e.headers),e})),W.interceptors.response.use((e=>{console.log("res:",e.data);const t=e.headers["content-disposition"],o=/filename\*?=(?:UTF-8'')?"?([^";]+)"?/i;if(t){if(t.match(o))return e}const n=e.data.code;return 200!=n?5===n?(console.log("token无效重新登录"),X().logout(),location.href="/login",Promise.reject()):(7==n?d.alert("用户名或密码错误!",{type:"warning",confirmButtonText:"知道了"}):(console.log("interceptor err code",e),d({title:"服务器错误码["+n+"]",message:()=>p(K,{data:e.data}),type:"warning",confirmButtonText:"知道了"}).then((e=>{}))),Promise.reject(e.data)):e.data}),(e=>{console.log(e);const t=e.response&&e.response.status||-1,o=e.response&&e.response.data.message||e;return d.alert(o,"请求服务器返回http错误码-"+t,{type:"error",confirmButtonText:"知道了"}),Promise.reject(e)}));const X=h("user",{state:()=>({tokenInfo:Y(),userInfo:te(),projects:se(),dynamicMenuItems:[],dynamicRouteChildren:[],isGetUserInfo:!1}),actions:{hasGetUserInfo(){return this.generateDynamicRoutes(),this.isGetUserInfo},getDynamicRouteChildren(){return this.dynamicRouteChildren},pushDynamicRouteChildren(e){this.dynamicRouteChildren.push(e)},pushDynamicMenuItems(e){this.dynamicMenuItems.push(e)},clearDynamicRouteChildren(e){this.dynamicRouteChildren=[]},clearDynamicMenuItems(e){this.dynamicMenuItems=[]},login(e,t){return new Promise(((o,n)=>{var s;(s={user:e,password:t},W({url:"/user/login",method:"post",data:s})).then((e=>{this.userInfo=e.data.user_info,this.tokenInfo=e.data.token_info,this.projects=e.data.projects,Z(this.tokenInfo),ne(this.userInfo),re(this.projects),this.generateDynamicRoutes(),this.isGetUserInfo=!0,o()})).catch((e=>{n(e)}))}))},getUserInfo(){return new Promise(((e,t)=>{var o;W({url:"/user/info",method:"get",data:o}).then((t=>{this.userInfo=t.data.user_info,this.tokenInfo=t.data.token_info,this.projects=t.data.projects,Z(this.tokenInfo),ne(this.userInfo),re(this.projects),this.generateDynamicRoutes(),this.isGetUserInfo=!0,e()})).catch((e=>{t(e)}))}))},logout(){console.log("走logout清理缓存。。"),this.userInfo=null,this.tokenInfo=null,this.projects=null,oe(),ee(),ae()},generateDynamicRoutes(){this.clearDynamicRouteChildren(),this.clearDynamicMenuItems();const e=this.projects;for(let t=0;t<e.length;t++){const o=e[t];let n=!1;const s={path:"/project/"+o.project_id,name:o.project_id,meta:{projectId:o.project_id,projectName:o.project_name},children:[],props:!0};o.resource_list.forEach((e=>{const t=s.path+"/"+e.resource,a={path:t,name:s.name+"_"+e.resource,meta:{desc:e.desc,projectId:o.project_id,resource:e.resource,resource_url:t,methods:{},global_click_btns:e.global_btns,row_click_btns:e.row_btns},component:()=>H((()=>import("./project_op--KKuousu.js")),__vite__mapDeps([0,1,2,3,4,5,6,7])),props:!0};"cdkey"===e.resource&&(a.component=()=>H((()=>import("./project_cdkey-cAsUqlYb.js")),__vite__mapDeps([8,2,3,4,5,6,9]))),e.show_methods.forEach((e=>{"get"==e&&(n=!0),a.meta.methods[e]=!0})),s.children.push(a),this.pushDynamicRouteChildren(a)})),n&&this.pushDynamicMenuItems(s)}console.log("pinia重新生成路由。。"),_e.children=ge.concat(this.getDynamicRouteChildren()),ye.addRoute(_e)}}}),Y=()=>F.getCache("tokenInfo"),Z=e=>{F.setCache("tokenInfo",e)},ee=()=>{F.deleteCache("tokenInfo")},te=()=>F.getCache("userInfo"),oe=()=>{F.deleteCache("userInfo")},ne=e=>{F.setCache("userInfo",e)},se=()=>F.getCache("projects"),ae=()=>{F.deleteCache("projects")},re=e=>{F.setCache("projects",e)},ce=(e,t)=>{const o=e.__vccOpts||e;for(const[n,s]of t)o[n]=s;return o},ie={class:"sidebar-content"},le={style:{"border-bottom":"1px whitesmoke solid"}},ue={class:"header-content"},de={class:"avatar-container"},pe={style:{"font-size":"20px"}},he={__name:"Home",setup(n){const l=m(),u=f(),p=X().userInfo.nick_name,h=g((()=>u.path)),A=X().dynamicMenuItems,U=_(!1),M=()=>{l.push("/welcome")};function z(e){if("logout"===e)d.confirm("确定注销并退出系统吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{X().logout(),l.push("/login")})).catch((()=>{}))}return(n,u)=>{const d=E,m=C,f=v,g=j,_=I,S=y("User"),N=y("arrow-down"),B=T,G=P,V=L,$=D,q=y("router-view"),H=O,J=x;return t(),s("main",null,[c("div",null,[a(J,{class:"app-container"},{default:r((()=>[a(_,{class:"app-sidebar"},{default:r((()=>[c("div",ie,[c("div",{class:"sidebar-logo",onClick:M},u[1]||(u[1]=[c("img",{src:"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20261.76%20226.69'%3e%3cpath%20d='M161.096.001l-30.225%2052.351L100.647.001H-.005l130.877%20226.688L261.749.001z'%20fill='%2341b883'/%3e%3cpath%20d='M161.096.001l-30.225%2052.351L100.647.001H52.346l78.526%20136.01L209.398.001z'%20fill='%2334495e'/%3e%3c/svg%3e",class:"logo",alt:"Logo"},null,-1),c("span",{class:"system-name"},"游戏后台管理系统",-1)])),a(g,{"default-active":h.value,class:"el-menu-vertical-demo",collapse:!1},{default:r((()=>[c("div",le,[a(f,{index:"/user"},{title:r((()=>u[2]||(u[2]=[c("span",null,"用户管理",-1)]))),default:r((()=>[(t(!0),s(k,null,w(o(fe),(o=>(t(),e(m,{index:o.path,onClick:e=>n.$router.push(o.path)},{default:r((()=>[a(d,null,{default:r((()=>[(t(),e(R(o.meta.icon),{class:"el-icon"}))])),_:2},1024),c("span",null,i(o.meta.name),1)])),_:2},1032,["index","onClick"])))),256))])),_:1}),a(m,{index:"/project",onClick:u[0]||(u[0]=e=>n.$router.push("/project"))},{default:r((()=>u[3]||(u[3]=[c("span",null,"项目管理",-1)]))),_:1})]),(t(!0),s(k,null,w(o(A),(o=>(t(),e(f,{index:o.path},{title:r((()=>[c("span",null,i(o.meta.projectName),1)])),default:r((()=>[(t(!0),s(k,null,w(o.children,(o=>(t(),e(m,{key:o.path,index:o.path,onClick:e=>{return t=o,F.setCache("resource",t),l.push({path:t.path}),void(U.value=!0);var t}},{default:r((()=>[b(i(o.meta.desc),1)])),_:2},1032,["index","onClick"])))),128))])),_:2},1032,["index"])))),256))])),_:1},8,["default-active"])])])),_:1}),a(J,{class:"app-container-right"},{default:r((()=>[a($,{class:"app-header"},{default:r((()=>[c("div",ue,[c("div",de,[a(V,{class:"right-menu-item hover-effect",trigger:"click",onCommand:z},{dropdown:r((()=>[a(G,null,{default:r((()=>[a(B,{command:"logout"},{default:r((()=>u[4]||(u[4]=[b("退出登录")]))),_:1})])),_:1})])),default:r((()=>[c("span",pe,[a(d,null,{default:r((()=>[a(S)])),_:1}),b(" "+i(o(p))+" ",1),a(d,{color:"black",size:"10"},{default:r((()=>[a(N)])),_:1})])])),_:1})])])])),_:1}),a(H,{class:"app-main"},{default:r((()=>[(t(),e(q,{key:n.$route.fullPath}))])),_:1})])),_:1})])),_:1})])])}}},me={path:"/project",name:"project",meta:{name:"project",icon:"App",resource_url:"/project",methods:{get:!0,post:!0,put:!0,delete:!0}},component:()=>H((()=>import("./project-BrSk79BC.js")),__vite__mapDeps([10,1,2,3,4,5,6,7]))},fe=[{path:"/usermanager",name:"usermanager",meta:{name:"用户管理",icon:"User"},component:()=>H((()=>import("./user-CMmufT6_.js")),__vite__mapDeps([11,12,2,3,4,5,13,14,15]))},{path:"/character",name:"character",meta:{name:"角色管理",icon:"Avatar"},component:()=>H((()=>import("./character-CjX4h7I4.js")),__vite__mapDeps([16,12,2,3,4,5,13]))},{path:"/userhistory",name:"userhistory",meta:{name:"用户操作记录",icon:"Finished"},component:()=>H((()=>import("./history-DihFgPRL.js")),__vite__mapDeps([17,14,2,3,5,15]))}],ge=[{path:"/welcome",name:"welcome",component:()=>H((()=>import("./welcome-glNRwS9e.js")),__vite__mapDeps([18,2,3]))},{path:"/user",name:"user",meta:{name:"user",icon:"User"},children:fe},me],_e={path:"/",name:"home",component:ce(he,[["__scopeId","data-v-73cc4e85"]]),children:ge},ye=A({history:U("/"),routes:[{path:"/login",name:"login",component:()=>H((()=>import("./Login-vcpB3J9K.js")),__vite__mapDeps([19,2,3,20])),hidden:!0},_e]});ye.beforeEach(((e,t,o)=>{const n=Y();if(n&&void 0!==n.token&&""!==n.token)"/login"===e.path?(console.log("有token走登录跳过登录",n),o({path:"/welcome"})):(console.log("跳到页面:"+e.path+",当前所有路由:",ye.getRoutes()),X().hasGetUserInfo()?(console.log("获取过用户数据,跳过获取。。。"),"/"===e.path?o({path:"/welcome"}):o()):X().getUserInfo().then((()=>{console.log("获取用户信息成功,继续:",e.path),"/"===e.path?o({path:"/welcome"}):o({...e,replace:!0})})).catch((e=>{X().logout().then((()=>{M.error(e),o({path:"/login"})}))})));else{if("/login"===e.path)return void o();console.log("token无效走登录。",n),o(`/login?redirect=${e.fullPath}`)}}));const Ie=z();Ie.use(S);const je=N($);for(const[ve,ke]of Object.entries(B))je.component(ve,ke);je.use(G,{locale:V}),je.use(Ie),je.use(ye),je.mount("#app");export{ce as _,Q as a,me as c,se as g,F as l,ye as r,W as s,X as u};