vome-core 0.0.12 → 0.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/admin/api/client.js +147 -1
  2. package/dist/admin/config/plugin-dev.js +1 -1
  3. package/dist/admin/crud/config.js +1 -1
  4. package/dist/admin/crud/confirm.js +1 -1
  5. package/dist/admin/crud/dict.js +1 -1
  6. package/dist/admin/crud/index.js +1 -1
  7. package/dist/admin/crud/key.js +1 -1
  8. package/dist/admin/crud/mitt.js +1 -1
  9. package/dist/admin/crud/plugins.js +1 -1
  10. package/dist/admin/crud/span.js +1 -1
  11. package/dist/admin/crud/style.js +1 -1
  12. package/dist/admin/crud/useCrud.js +1 -1
  13. package/dist/admin/crud/validate.js +1 -1
  14. package/dist/admin/directives/perm.js +1 -1
  15. package/dist/admin/hooks/useBrowser.js +1 -1
  16. package/dist/admin/hooks/useUpload.js +1 -1
  17. package/dist/admin/hooks/useVome.js +1 -1
  18. package/dist/admin/index.js +1 -1
  19. package/dist/admin/lib/browser.js +1 -1
  20. package/dist/admin/lib/cn.js +1 -1
  21. package/dist/admin/lib/dialog-float.js +1 -1
  22. package/dist/admin/lib/eps.js +33 -1
  23. package/dist/admin/lib/menu.js +1 -1
  24. package/dist/admin/lib/module.js +1 -1
  25. package/dist/admin/lib/tree.js +1 -1
  26. package/dist/admin/lib/upload.js +1 -1
  27. package/dist/admin/router/index.js +65 -1
  28. package/dist/admin/router/menu-routes.js +113 -1
  29. package/dist/admin/service/base.js +76 -1
  30. package/dist/admin/service/index.d.ts +4 -1
  31. package/dist/admin/service/index.js +263 -1
  32. package/dist/admin/stores/app.js +1 -1
  33. package/dist/admin/stores/tags.js +1 -1
  34. package/dist/admin/stores/user.js +64 -1
  35. package/dist/index.js +1 -1
  36. package/dist/server/index.js +1 -1
  37. package/dist/shared/index.js +1 -1
  38. package/dist/shared/tree.js +1 -1
  39. package/package.json +1 -1
@@ -1 +1,113 @@
1
- (function(_0x391b41,_0xec1e08){const _0x34d68d=_0x1e08,_0xcad00e=_0x391b41();while(!![]){try{const _0x2ef33d=parseInt(_0x34d68d(0x1ee))/0x1*(parseInt(_0x34d68d(0x1f5))/0x2)+parseInt(_0x34d68d(0x1de))/0x3*(parseInt(_0x34d68d(0x1f9))/0x4)+parseInt(_0x34d68d(0x1ed))/0x5+-parseInt(_0x34d68d(0x1e2))/0x6+-parseInt(_0x34d68d(0x1dc))/0x7*(-parseInt(_0x34d68d(0x1e4))/0x8)+-parseInt(_0x34d68d(0x1f3))/0x9*(parseInt(_0x34d68d(0x1f8))/0xa)+-parseInt(_0x34d68d(0x1fb))/0xb;if(_0x2ef33d===_0xec1e08)break;else _0xcad00e['push'](_0xcad00e['shift']());}catch(_0x1c66af){_0xcad00e['push'](_0xcad00e['shift']());}}}(_0x5483,0xf0c74));import{defineComponent,h}from'vue';import{resolveView,viewPathToName}from'../lib/module';import _0x33353d from'#vome-host/pages/missing/index.vue';import _0x1dbb2c from'#vome-host/pages/micro/index.vue';const addedNames=new Set();function isMicroMenu(_0x18a341){const _0x30f197=_0x1e08;return Boolean(_0x18a341[_0x30f197(0x1db)]&&_0x18a341['router']);}function walk(_0x1cdf93,_0x5f9c9c){const _0x3656e4=_0x1e08;for(const _0xa1cfdf of _0x1cdf93){if(Number(_0xa1cfdf[_0x3656e4(0x1df)])===0x1&&_0xa1cfdf[_0x3656e4(0x1dd)])_0x5f9c9c[_0x3656e4(0x1e8)](_0xa1cfdf);if(_0xa1cfdf[_0x3656e4(0x1e6)]?.[_0x3656e4(0x1e9)])walk(_0xa1cfdf[_0x3656e4(0x1e6)],_0x5f9c9c);}}function missingView(_0x4a0303){return defineComponent({'name':'MissingViewPage','setup'(){return()=>h(_0x33353d,{'path':_0x4a0303});}});}function routeNameOf(_0x230c47){const _0x8e5126=_0x1e08;return _0x8e5126(0x1e0)+_0x230c47;}function buildRoute(_0x13a82c){const _0x46e537=_0x1e08,_0xc3fbc8=_0x13a82c['router'],_0x380f3c=_0xc3fbc8[_0x46e537(0x1f4)](/^\//,'');let _0x23b150;const _0x51f013=viewPathToName(_0x13a82c[_0x46e537(0x1ec)]),_0x88d6fc={'title':_0x13a82c['name'],'keepAlive':_0x13a82c[_0x46e537(0x1ef)]!==![],'viewPath':_0x13a82c[_0x46e537(0x1ec)],'perms':_0x13a82c[_0x46e537(0x1f1)],'componentName':_0x51f013};if(isMicroMenu(_0x13a82c))_0x23b150=_0x1dbb2c,_0x88d6fc[_0x46e537(0x1db)]=_0x13a82c[_0x46e537(0x1db)],_0x88d6fc[_0x46e537(0x1fd)]='micro-'+_0x13a82c[_0x46e537(0x1db)],_0x88d6fc[_0x46e537(0x1ef)]=![];else{if(_0x13a82c['viewPath']){const _0x596554=resolveView(_0x13a82c['viewPath']);_0x23b150=_0x596554||missingView(_0x13a82c[_0x46e537(0x1ec)]);}else _0x23b150=missingView(_0xc3fbc8);}return{'path':_0x380f3c,'name':routeNameOf(_0x13a82c['id']),'component':_0x23b150,'meta':_0x88d6fc};}export async function ensureMenuRoutes(_0x274849,_0x37b7c8){const _0x198bf9=_0x1e08,_0x3884d5=[];walk(_0x37b7c8,_0x3884d5);for(const _0xb223b9 of _0x3884d5){const _0x2688b8=routeNameOf(_0xb223b9['id']);if(addedNames[_0x198bf9(0x1f7)](_0x2688b8))continue;addedNames[_0x198bf9(0x1eb)](_0x2688b8),_0x274849[_0x198bf9(0x1e1)]('layout',buildRoute(_0xb223b9));}}export async function syncMenuRoutes(_0x466155,_0x409181){const _0x12bb89=_0x1e08,_0x4db138=[];walk(_0x409181,_0x4db138);const _0x324d1b=new Set(_0x4db138[_0x12bb89(0x1e5)](_0x522281=>routeNameOf(_0x522281['id'])));for(const _0xa89d2 of[...addedNames]){if(!_0x324d1b['has'](_0xa89d2)){if(_0x466155[_0x12bb89(0x1fc)](_0xa89d2))_0x466155['removeRoute'](_0xa89d2);addedNames[_0x12bb89(0x1f0)](_0xa89d2);}}for(const _0x5b6a33 of _0x4db138){const _0xf4eeb4=routeNameOf(_0x5b6a33['id']),_0x5da5e4=_0x5b6a33[_0x12bb89(0x1dd)]['replace'](/^\//,'');if(addedNames['has'](_0xf4eeb4)&&_0x466155[_0x12bb89(0x1fc)](_0xf4eeb4)){const _0x108f41=_0x466155[_0x12bb89(0x1ff)]()[_0x12bb89(0x1ea)](_0x1159d2=>_0x1159d2[_0x12bb89(0x1e7)]===_0xf4eeb4);if(_0x108f41&&_0x108f41[_0x12bb89(0x1e3)][_0x12bb89(0x1f4)](/^\//,'')!==_0x5da5e4)_0x466155[_0x12bb89(0x1fa)](_0xf4eeb4),addedNames[_0x12bb89(0x1f0)](_0xf4eeb4);else{if(_0x108f41?.[_0x12bb89(0x1f2)]){_0x108f41['meta'][_0x12bb89(0x1f6)]=_0x5b6a33[_0x12bb89(0x1e7)],_0x108f41[_0x12bb89(0x1f2)][_0x12bb89(0x1ef)]=_0x5b6a33['keepAlive']!==![],_0x108f41[_0x12bb89(0x1f2)][_0x12bb89(0x1ec)]=_0x5b6a33[_0x12bb89(0x1ec)],_0x108f41['meta'][_0x12bb89(0x1f1)]=_0x5b6a33[_0x12bb89(0x1f1)];if(_0x5b6a33[_0x12bb89(0x1db)])_0x108f41['meta']['appKey']=_0x5b6a33['appKey'];continue;}}}!addedNames[_0x12bb89(0x1f7)](_0xf4eeb4)&&(addedNames[_0x12bb89(0x1eb)](_0xf4eeb4),_0x466155[_0x12bb89(0x1e1)](_0x12bb89(0x1fe),buildRoute(_0x5b6a33)));}}function _0x1e08(_0x5258ba,_0x1dad4f){_0x5258ba=_0x5258ba-0x1db;const _0x5483ed=_0x5483();let _0x1e08f5=_0x5483ed[_0x5258ba];if(_0x1e08['oBueKS']===undefined){var _0x63f88d=function(_0x356002){const _0x40cae1='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x33353d='',_0x1dbb2c='';for(let _0x18a341=0x0,_0x1cdf93,_0x5f9c9c,_0xa1cfdf=0x0;_0x5f9c9c=_0x356002['charAt'](_0xa1cfdf++);~_0x5f9c9c&&(_0x1cdf93=_0x18a341%0x4?_0x1cdf93*0x40+_0x5f9c9c:_0x5f9c9c,_0x18a341++%0x4)?_0x33353d+=String['fromCharCode'](0xff&_0x1cdf93>>(-0x2*_0x18a341&0x6)):0x0){_0x5f9c9c=_0x40cae1['indexOf'](_0x5f9c9c);}for(let _0x4a0303=0x0,_0x230c47=_0x33353d['length'];_0x4a0303<_0x230c47;_0x4a0303++){_0x1dbb2c+='%'+('00'+_0x33353d['charCodeAt'](_0x4a0303)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x1dbb2c);};_0x1e08['dUrDjM']=_0x63f88d,_0x1e08['ccubzE']={},_0x1e08['oBueKS']=!![];}const _0x4d0ec2=_0x5483ed[0x0],_0x2cd179=_0x5258ba+_0x4d0ec2,_0x34faf0=_0x1e08['ccubzE'][_0x2cd179];return!_0x34faf0?(_0x1e08f5=_0x1e08['dUrDjM'](_0x1e08f5),_0x1e08['ccubzE'][_0x2cd179]=_0x1e08f5):_0x1e08f5=_0x34faf0,_0x1e08f5;}export function clearMenuRoutesFlag(){const _0x1735e0=_0x1e08;addedNames[_0x1735e0(0x200)]();}function _0x5483(){const _0x15ea4b=['mtGZmtaZnfrHEezuAq','DgL0Bgu','AgfZ','mti5nJCWC25NDgnn','mti1otzWzwPkvhO','CMvTB3zLuM91Dgu','mtu1nZa0odLHyNnwBuK','AgfZuM91Dgu','y29TCg9Uzw50tMfTzq','Bgf5B3v0','z2v0uM91DgvZ','y2XLyxi','yxbWs2v5','mte0mZK2mZH5sLLhu3G','CM91DgvY','mtm1m1zgqwjPtq','DhLWzq','BwvUDs0','ywrKuM91Dgu','mta5mJu0mdbPueDUsxu','Cgf0Aa','ofnjqxj0qq','BwfW','y2HPBgrYzw4','BMfTzq','ChvZAa','BgvUz3rO','zMLUza','ywrK','DMLLD1bHDgG','otGYmtyWnwHqruzRtq','mxPRsfvXDq','A2vLCefSAxzL','zgvSzxrL','CgvYBxm','Bwv0yq','mte4ognKsunAAa','CMvWBgfJzq'];_0x5483=function(){return _0x15ea4b;};return _0x5483();}export function removeAllMenuRoutes(_0x5cf26a){const _0x4ea0db=_0x1e08;for(const _0x1fe60b of[...addedNames]){if(_0x5cf26a[_0x4ea0db(0x1fc)](_0x1fe60b))_0x5cf26a['removeRoute'](_0x1fe60b);}addedNames[_0x4ea0db(0x200)]();}
1
+ import { defineComponent, h } from "vue";
2
+ import { resolveView, viewPathToName } from "../lib/module";
3
+ import MissingView from "#vome-host/pages/missing/index.vue";
4
+ import MicroAppView from "#vome-host/pages/micro/index.vue";
5
+ const addedNames = new Set;
6
+ function isMicroMenu(m) {
7
+ return Boolean(m.appKey && m.router);
8
+ }
9
+ function walk(nodes, out) {
10
+ for (const n of nodes) {
11
+ if (Number(n.type) === 1 && n.router)
12
+ out.push(n);
13
+ if (n.children?.length)
14
+ walk(n.children, out);
15
+ }
16
+ }
17
+ function missingView(viewPath) {
18
+ return defineComponent({
19
+ name: "MissingViewPage",
20
+ setup() {
21
+ return () => h(MissingView, { path: viewPath });
22
+ }
23
+ });
24
+ }
25
+ function routeNameOf(id) {
26
+ return `menu-${id}`;
27
+ }
28
+ function buildRoute(item) {
29
+ const full = item.router;
30
+ const childPath = full.replace(/^\//, "");
31
+ let component;
32
+ const componentName = viewPathToName(item.viewPath);
33
+ const meta = {
34
+ title: item.name,
35
+ keepAlive: item.keepAlive !== false,
36
+ viewPath: item.viewPath,
37
+ perms: item.perms,
38
+ componentName
39
+ };
40
+ if (isMicroMenu(item)) {
41
+ component = MicroAppView;
42
+ meta.appKey = item.appKey;
43
+ meta.componentName = `micro-${item.appKey}`;
44
+ meta.keepAlive = false;
45
+ } else if (item.viewPath) {
46
+ const loader = resolveView(item.viewPath);
47
+ component = loader || missingView(item.viewPath);
48
+ } else {
49
+ component = missingView(full);
50
+ }
51
+ return {
52
+ path: childPath,
53
+ name: routeNameOf(item.id),
54
+ component,
55
+ meta
56
+ };
57
+ }
58
+ export async function ensureMenuRoutes(router, menus) {
59
+ const items = [];
60
+ walk(menus, items);
61
+ for (const item of items) {
62
+ const name = routeNameOf(item.id);
63
+ if (addedNames.has(name))
64
+ continue;
65
+ addedNames.add(name);
66
+ router.addRoute("layout", buildRoute(item));
67
+ }
68
+ }
69
+ export async function syncMenuRoutes(router, menus) {
70
+ const items = [];
71
+ walk(menus, items);
72
+ const nextNames = new Set(items.map((i) => routeNameOf(i.id)));
73
+ for (const name of [...addedNames]) {
74
+ if (!nextNames.has(name)) {
75
+ if (router.hasRoute(name))
76
+ router.removeRoute(name);
77
+ addedNames.delete(name);
78
+ }
79
+ }
80
+ for (const item of items) {
81
+ const name = routeNameOf(item.id);
82
+ const childPath = item.router.replace(/^\//, "");
83
+ if (addedNames.has(name) && router.hasRoute(name)) {
84
+ const existing = router.getRoutes().find((r) => r.name === name);
85
+ if (existing && existing.path.replace(/^\//, "") !== childPath) {
86
+ router.removeRoute(name);
87
+ addedNames.delete(name);
88
+ } else if (existing?.meta) {
89
+ existing.meta.title = item.name;
90
+ existing.meta.keepAlive = item.keepAlive !== false;
91
+ existing.meta.viewPath = item.viewPath;
92
+ existing.meta.perms = item.perms;
93
+ if (item.appKey)
94
+ existing.meta.appKey = item.appKey;
95
+ continue;
96
+ }
97
+ }
98
+ if (!addedNames.has(name)) {
99
+ addedNames.add(name);
100
+ router.addRoute("layout", buildRoute(item));
101
+ }
102
+ }
103
+ }
104
+ export function clearMenuRoutesFlag() {
105
+ addedNames.clear();
106
+ }
107
+ export function removeAllMenuRoutes(router) {
108
+ for (const name of [...addedNames]) {
109
+ if (router.hasRoute(name))
110
+ router.removeRoute(name);
111
+ }
112
+ addedNames.clear();
113
+ }
@@ -1 +1,76 @@
1
- function _0x5207(_0x20e674,_0x403f9a){_0x20e674=_0x20e674-0x6e;const _0x20caed=_0x20ca();let _0x520720=_0x20caed[_0x20e674];if(_0x5207['KonoNx']===undefined){var _0x53c9f0=function(_0x10d937){const _0x247e09='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3eed47='',_0x4a91e3='';for(let _0x3db8e3=0x0,_0x33aa97,_0x1f69bb,_0x48cf1f=0x0;_0x1f69bb=_0x10d937['charAt'](_0x48cf1f++);~_0x1f69bb&&(_0x33aa97=_0x3db8e3%0x4?_0x33aa97*0x40+_0x1f69bb:_0x1f69bb,_0x3db8e3++%0x4)?_0x3eed47+=String['fromCharCode'](0xff&_0x33aa97>>(-0x2*_0x3db8e3&0x6)):0x0){_0x1f69bb=_0x247e09['indexOf'](_0x1f69bb);}for(let _0x4b3202=0x0,_0x2e36c2=_0x3eed47['length'];_0x4b3202<_0x2e36c2;_0x4b3202++){_0x4a91e3+='%'+('00'+_0x3eed47['charCodeAt'](_0x4b3202)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4a91e3);};_0x5207['bekGtp']=_0x53c9f0,_0x5207['QPxcya']={},_0x5207['KonoNx']=!![];}const _0x1a6555=_0x20caed[0x0],_0x4001ae=_0x20e674+_0x1a6555,_0xbfb9f6=_0x5207['QPxcya'][_0x4001ae];return!_0xbfb9f6?(_0x520720=_0x5207['bekGtp'](_0x520720),_0x5207['QPxcya'][_0x4001ae]=_0x520720):_0x520720=_0xbfb9f6,_0x520720;}const _0x82cab5=_0x5207;(function(_0x676971,_0x2d1de1){const _0x1177fa=_0x5207,_0x4d35ad=_0x676971();while(!![]){try{const _0x2c06fd=-parseInt(_0x1177fa(0x6f))/0x1*(-parseInt(_0x1177fa(0x7c))/0x2)+parseInt(_0x1177fa(0x70))/0x3+-parseInt(_0x1177fa(0x89))/0x4*(parseInt(_0x1177fa(0x77))/0x5)+-parseInt(_0x1177fa(0x90))/0x6*(-parseInt(_0x1177fa(0x71))/0x7)+-parseInt(_0x1177fa(0x74))/0x8*(-parseInt(_0x1177fa(0x82))/0x9)+parseInt(_0x1177fa(0x8f))/0xa*(-parseInt(_0x1177fa(0x96))/0xb)+-parseInt(_0x1177fa(0x83))/0xc;if(_0x2c06fd===_0x2d1de1)break;else _0x4d35ad['push'](_0x4d35ad['shift']());}catch(_0x35815b){_0x4d35ad['push'](_0x4d35ad['shift']());}}}(_0x20ca,0xd7418));function _0x20ca(){const _0x15132f=['ndK2sw16EgLK','zgf0yq','DxbKyxrL','nvjMzfPWzG','BgLZDa','zgvSzxrL','CMvXDwvZDa','Dg9tDhjPBMC','mZaWnduZoennyunnDq','AxnbCNjHEq','C3rHCNrZv2L0Aa','B2jQzwn0','DgvZDa','CgfNzq','mJi5mZaYuu1hq0jL','ndu4nJm1ntzntePTseK','DxbKyxrLvgLTzq','BMfTzxnWywnL','y3jLyxrLvgLTzq','CMvWBgfJzq','Aw5MBW','mtGXntC2yurWsKvT','l3jLC3rVCMu','l2XPC3q','C3rYAw5NAwz5','l2fKza','BwfW','mtCYmJuWt29Stuvy','ndHRs3LprwW','ue9tva','CMvZDg9Yzq','CgfYyw1Z','r0vu','Bwv0Ag9K','nJq5vhjNsxHL','l2LUzM8','mwXMuLLiqG','ndi5mJm3m2X5wKjkEq','mta5nJa0nMjZCLrvEq','l2rLBgv0zq','zw50CMLLCW'];_0x20ca=function(){return _0x15132f;};return _0x20ca();}import{request}from'../api/client';function stripTimeMeta(_0x3eed47){const _0x4d113b=_0x5207;if(Array[_0x4d113b(0x7d)](_0x3eed47))return _0x3eed47[_0x4d113b(0x8e)](_0x4a91e3=>stripTimeMeta(_0x4a91e3));if(_0x3eed47&&typeof _0x3eed47===_0x4d113b(0x7f)){const _0x3db8e3={..._0x3eed47};return delete _0x3db8e3[_0x4d113b(0x86)],delete _0x3db8e3[_0x4d113b(0x84)],_0x3db8e3;}return _0x3eed47;}export class BaseService{[_0x82cab5(0x85)];constructor(_0x33aa97){const _0x4c1989=_0x82cab5;if(_0x33aa97)this[_0x4c1989(0x85)]=_0x33aa97[_0x4c1989(0x87)](/^\//,'');}async[_0x82cab5(0x7a)](_0x1f69bb={}){const _0x3706ec=_0x82cab5;let _0x48cf1f=_0x1f69bb['url']||'';if(_0x48cf1f&&!/^https?:\/\//[_0x3706ec(0x80)](_0x48cf1f)){if(this[_0x3706ec(0x85)]){const _0x2e36c2=this['namespace'][_0x3706ec(0x7e)]('/')?this[_0x3706ec(0x85)]:'/'+this['namespace'];_0x48cf1f=_0x48cf1f[_0x3706ec(0x7e)]('/')?''+_0x2e36c2+_0x48cf1f:_0x2e36c2+'/'+_0x48cf1f;}if(!_0x48cf1f[_0x3706ec(0x7e)]('/'))_0x48cf1f='/'+_0x48cf1f;}const _0x4b3202=(_0x1f69bb[_0x3706ec(0x95)]||'GET')['toUpperCase']();if(_0x4b3202==='GET'){const _0x258dd1=_0x1f69bb[_0x3706ec(0x93)]||{},_0x56b08e=new URLSearchParams();for(const [_0x49196c,_0xf0e17]of Object[_0x3706ec(0x73)](_0x258dd1)){if(_0xf0e17==null)continue;_0x56b08e['set'](_0x49196c,String(_0xf0e17));}const _0x2f7e67=_0x56b08e[_0x3706ec(0x7b)]();return request(_0x2f7e67?_0x48cf1f+'?'+_0x2f7e67:_0x48cf1f);}return request(_0x48cf1f,{'method':_0x4b3202,'body':JSON[_0x3706ec(0x8c)](stripTimeMeta(_0x1f69bb[_0x3706ec(0x75)]??{}))});}[_0x82cab5(0x81)](_0x4f5640={}){const _0xed2fbd=_0x82cab5;return this[_0xed2fbd(0x7a)]({'url':'/page','method':_0xed2fbd(0x91),'data':_0x4f5640});}[_0x82cab5(0x78)](_0x44e4eb={}){const _0x1df560=_0x82cab5;return this['request']({'url':_0x1df560(0x8b),'method':'POST','data':_0x44e4eb});}[_0x82cab5(0x88)](_0x3dfac7){const _0x20733d=_0x82cab5;return this['request']({'url':_0x20733d(0x6e),'method':_0x20733d(0x94),'params':_0x3dfac7});}['add'](_0x3afbcb){const _0x48bf66=_0x82cab5;return this['request']({'url':_0x48bf66(0x8d),'method':_0x48bf66(0x91),'data':_0x3afbcb});}[_0x82cab5(0x76)](_0x493846){return this['request']({'url':'/update','method':'POST','data':_0x493846});}[_0x82cab5(0x79)](_0x556bb8){const _0x4d2d1e=_0x82cab5;return this[_0x4d2d1e(0x7a)]({'url':_0x4d2d1e(0x72),'method':_0x4d2d1e(0x91),'data':_0x556bb8});}[_0x82cab5(0x92)](_0x32fe51){const _0x132f0e=_0x82cab5;return this['request']({'url':_0x132f0e(0x8a),'method':_0x132f0e(0x91),'data':_0x32fe51});}}
1
+ import { request } from "../api/client";
2
+ function stripTimeMeta(data) {
3
+ if (Array.isArray(data))
4
+ return data.map((item) => stripTimeMeta(item));
5
+ if (data && typeof data === "object") {
6
+ const out = { ...data };
7
+ delete out.createTime;
8
+ delete out.updateTime;
9
+ return out;
10
+ }
11
+ return data;
12
+ }
13
+
14
+ export class BaseService {
15
+ namespace;
16
+ constructor(namespace) {
17
+ if (namespace)
18
+ this.namespace = namespace.replace(/^\//, "");
19
+ }
20
+ async request(options = {}) {
21
+ let url = options.url || "";
22
+ if (url && !/^https?:\/\//.test(url)) {
23
+ if (this.namespace) {
24
+ const ns = this.namespace.startsWith("/") ? this.namespace : `/${this.namespace}`;
25
+ url = url.startsWith("/") ? `${ns}${url}` : `${ns}/${url}`;
26
+ }
27
+ if (!url.startsWith("/"))
28
+ url = `/${url}`;
29
+ }
30
+ const method = (options.method || "GET").toUpperCase();
31
+ if (method === "GET") {
32
+ const params = options.params || {};
33
+ const q = new URLSearchParams;
34
+ for (const [k, v] of Object.entries(params)) {
35
+ if (v == null)
36
+ continue;
37
+ q.set(k, String(v));
38
+ }
39
+ const qs = q.toString();
40
+ return request(qs ? `${url}?${qs}` : url);
41
+ }
42
+ return request(url, {
43
+ method,
44
+ body: JSON.stringify(stripTimeMeta(options.data ?? {}))
45
+ });
46
+ }
47
+ page(data = {}) {
48
+ return this.request({ url: "/page", method: "POST", data });
49
+ }
50
+ list(data = {}) {
51
+ return this.request({
52
+ url: "/list",
53
+ method: "POST",
54
+ data
55
+ });
56
+ }
57
+ info(params) {
58
+ return this.request({
59
+ url: "/info",
60
+ method: "GET",
61
+ params
62
+ });
63
+ }
64
+ add(data) {
65
+ return this.request({ url: "/add", method: "POST", data });
66
+ }
67
+ update(data) {
68
+ return this.request({ url: "/update", method: "POST", data });
69
+ }
70
+ delete(data) {
71
+ return this.request({ url: "/delete", method: "POST", data });
72
+ }
73
+ restore(data) {
74
+ return this.request({ url: "/restore", method: "POST", data });
75
+ }
76
+ }
@@ -2,7 +2,10 @@ import { BaseService } from './base';
2
2
  type ServiceRoot = Eps.Service & {
3
3
  request: BaseService['request'];
4
4
  };
5
- /** 与 globalThis 同源;页面 / createEps 必须读写同一对象 */
5
+ /**
6
+ * Proxy:任意模块读 service.xxx 都落到 globalThis 根上。
7
+ * 避免 Vite 多实例下 `export const service = serviceRoot` 绑到不同对象。
8
+ */
6
9
  export declare const service: ServiceRoot;
7
10
  /** 从 EPS 全量重建 service 树(无写死业务路由) */
8
11
  export declare function createEps(force?: boolean): Promise<any>;
@@ -1 +1,263 @@
1
- const _0x1a6344=_0x48ef;(function(_0x66325e,_0x3a4183){const _0x11e64f=_0x48ef,_0x1898d1=_0x66325e();while(!![]){try{const _0x2212a6=parseInt(_0x11e64f(0x14f))/0x1+parseInt(_0x11e64f(0x143))/0x2+parseInt(_0x11e64f(0x152))/0x3+parseInt(_0x11e64f(0x13d))/0x4+parseInt(_0x11e64f(0x162))/0x5*(parseInt(_0x11e64f(0x14a))/0x6)+-parseInt(_0x11e64f(0x15c))/0x7+-parseInt(_0x11e64f(0x163))/0x8;if(_0x2212a6===_0x3a4183)break;else _0x1898d1['push'](_0x1898d1['shift']());}catch(_0x295d5b){_0x1898d1['push'](_0x1898d1['shift']());}}}(_0x46d6,0xde0ad));import{loadEps}from'../lib/eps';import{BaseService}from'./base';const SIDE_ID=_0x1a6344(0x13c);function toCamel(_0x1a5aad){const _0x28d2a0=_0x1a6344;return _0x1a5aad[_0x28d2a0(0x155)](/([^-])(?:-+([^-]))/g,(_0x3600dc,_0x43c434,_0x14c453)=>_0x43c434+String(_0x14c453)[_0x28d2a0(0x160)]());}function methodName(_0x1c5c95){const _0x8bf99b=_0x1a6344;return _0x1c5c95[_0x8bf99b(0x155)](/^\//,'')[_0x8bf99b(0x155)](/[:,\s/-]/g,'');}function isValidName(_0x52fa07){const _0x146fa7=_0x1a6344;return Boolean(_0x52fa07)&&!['{','}',':'][_0x146fa7(0x138)](_0x491f2c=>_0x52fa07[_0x146fa7(0x165)](_0x491f2c));}function resolvePermCode(_0x3f5bf3,_0x1bf9fd){const _0x4a3cbd=_0x1a6344,_0x146bec=_0x3f5bf3[_0x4a3cbd(0x155)](/^\//,'')['split']('/')[_0x4a3cbd(0x16c)](Boolean),_0x3db4d1=_0x146bec[0x1]||_0x146bec[0x0]||_0x4a3cbd(0x144);let _0x4a919e=_0x146bec[_0x4a3cbd(0x14d)](0x2)[_0x4a3cbd(0x16f)](':');if(_0x4a919e===_0x3db4d1)_0x4a919e=_0x3db4d1;else _0x4a919e[_0x4a3cbd(0x15a)](_0x3db4d1+':')&&(_0x4a919e=_0x4a919e['slice'](_0x3db4d1[_0x4a3cbd(0x15d)]+0x1));const _0x35d89d=_0x3db4d1+'-';if(_0x4a919e[_0x4a3cbd(0x15a)](_0x35d89d))_0x4a919e=_0x4a919e[_0x4a3cbd(0x14d)](_0x35d89d[_0x4a3cbd(0x15d)]);_0x4a919e=_0x4a919e[_0x4a3cbd(0x155)](/-/g,':');if(!_0x4a919e)_0x4a919e=_0x3db4d1;return _0x3db4d1+':'+_0x4a919e+':'+_0x1bf9fd;}function prefixToParts(_0x7f2e17){const _0x35da2a=_0x1a6344,_0x4a370b=_0x7f2e17[_0x35da2a(0x155)](/^\//,'');return _0x4a370b[_0x35da2a(0x155)](new RegExp('^'+SIDE_ID+'/?'),'')[_0x35da2a(0x15e)]('/')['filter'](Boolean)[_0x35da2a(0x158)](toCamel);}function bindCrud(_0x1da546,_0x247cb0){const _0xec930d=_0x1a6344,_0x4a3628=BaseService[_0xec930d(0x16a)];for(const _0x102eb1 of[_0xec930d(0x154),'page',_0xec930d(0x146),_0xec930d(0x164),_0xec930d(0x148),_0xec930d(0x139),'delete',_0xec930d(0x13b)]){const _0x4f7b33=_0x4a3628[_0x102eb1];typeof _0x4f7b33===_0xec930d(0x145)&&(_0x1da546[_0x102eb1]=_0x4f7b33[_0xec930d(0x140)](_0x247cb0));}}function bindApis(_0x2dee57,_0x31471f,_0x5cca6a){const _0x1ed431=_0x1a6344;_0x2dee57[_0x1ed431(0x157)]||={};for(const _0x48db09 of _0x5cca6a){const _0xd36646=methodName(_0x48db09[_0x1ed431(0x171)]);if(!isValidName(_0xd36646)||/[-:]/g[_0x1ed431(0x156)](_0xd36646))continue;const _0x6c9549=(_0x48db09['method']||_0x1ed431(0x16e))[_0x1ed431(0x166)]();_0x2dee57[_0xd36646]=function(_0x143c6e){const _0x2a9948=_0x1ed431;return this[_0x2a9948(0x154)]({'url':_0x48db09['path'][_0x2a9948(0x15a)]('/')?_0x48db09['path']:'/'+_0x48db09['path'],'method':_0x6c9549,[_0x6c9549===_0x2a9948(0x14c)?_0x2a9948(0x15f):_0x2a9948(0x13e)]:_0x143c6e});}[_0x1ed431(0x140)](_0x31471f),_0x2dee57[_0x1ed431(0x157)][_0xd36646]=_0x48db09['perms']?.[0x0]||resolvePermCode('/'+_0x2dee57[_0x1ed431(0x167)],_0xd36646);}}function createLeaf(_0x3d5ca3,_0x35b44f=[]){const _0x27de7c=_0x1a6344,_0x103b7f=_0x3d5ca3['replace'](/^\//,''),_0x2a345d=new BaseService(_0x103b7f),_0x2587e8=_0x2a345d;return _0x2587e8[_0x27de7c(0x167)]=_0x103b7f,_0x2587e8[_0x27de7c(0x157)]={},_0x2587e8[_0x27de7c(0x150)]={},bindCrud(_0x2587e8,_0x2a345d),bindApis(_0x2587e8,_0x2a345d,_0x35b44f),_0x2587e8;}function attachLeaf(_0x23bde3,_0x3d5dcb,_0x1bd8f0=[]){const _0x436c77=_0x1a6344,_0x4f976f=_0x3d5dcb[_0x436c77(0x155)](/^\//,''),_0x2f7578=prefixToParts(_0x3d5dcb);if(!_0x2f7578['length'])return;let _0x4aeb56=_0x23bde3;for(let _0x25027f=0x0;_0x25027f<_0x2f7578['length'];_0x25027f++){const _0x1e712e=_0x2f7578[_0x25027f],_0x2d7c12=_0x25027f===_0x2f7578[_0x436c77(0x15d)]-0x1;if(!_0x2d7c12){const _0x7b95ef=_0x4aeb56[_0x1e712e];(!_0x7b95ef||typeof _0x7b95ef!=='object'||'namespace'in _0x7b95ef)&&(_0x4aeb56[_0x1e712e]={});_0x4aeb56=_0x4aeb56[_0x1e712e];continue;}const _0x4ff819=createLeaf(_0x4f976f,_0x1bd8f0);return _0x4aeb56[_0x1e712e]=_0x4ff819,_0x4ff819;}return;}function buildFromEps(_0x15f873){const _0x59d704=_0x1a6344,_0x5b5a5f=Object[_0x59d704(0x14b)](_0x15f873)[_0x59d704(0x13f)]();for(const _0x1e0506 of _0x5b5a5f){if(!_0x1e0506?.[_0x59d704(0x161)])continue;const _0x5156ee=attachLeaf(serviceRoot,_0x1e0506['prefix'],_0x1e0506[_0x59d704(0x14e)]||[]);if(_0x5156ee){const _0x3a1d4a=_0x1e0506['pageQueryOp'];_0x3a1d4a&&(_0x5156ee[_0x59d704(0x13a)]={'fieldEq':_0x3a1d4a['fieldEq'],'fieldLike':_0x3a1d4a[_0x59d704(0x142)],'fieldArray':_0x3a1d4a[_0x59d704(0x147)],'fieldRange':_0x3a1d4a[_0x59d704(0x149)],'keyWordLikeFields':_0x3a1d4a['keyWordLikeFields']});}}}function normalizeEpsMap(_0x4f92e2){const _0x1991dd=_0x1a6344;if(!_0x4f92e2||typeof _0x4f92e2!=='object')return{};const _0xe4ac4e=_0x4f92e2;if(_0x1991dd(0x141)in _0xe4ac4e&&'data'in _0xe4ac4e&&_0xe4ac4e['data']&&typeof _0xe4ac4e['data']==='object'&&!Array[_0x1991dd(0x16d)](_0xe4ac4e['data']))return _0xe4ac4e[_0x1991dd(0x15f)];return _0x4f92e2;}function countPrefixedEntities(_0x233db5){const _0x852de3=_0x1a6344;return Object[_0x852de3(0x14b)](_0x233db5)[_0x852de3(0x13f)]()['filter'](_0x40636c=>_0x40636c&&typeof _0x40636c===_0x852de3(0x151)&&Boolean(_0x40636c[_0x852de3(0x161)]))['length'];}function createServiceRoot(){const _0x2d970b=_0x1a6344,_0x16d21e=new BaseService();return{'request':_0x16d21e[_0x2d970b(0x154)][_0x2d970b(0x140)](_0x16d21e)};}const g=globalThis;function getOrCreateRoot(){const _0x168dd0=_0x1a6344;return!g[_0x168dd0(0x159)]&&(g[_0x168dd0(0x159)]=createServiceRoot()),g[_0x168dd0(0x159)];}const serviceRoot=getOrCreateRoot();function resetServiceModules(){const _0x4011e5=_0x1a6344;for(const _0xebac2a of Object[_0x4011e5(0x168)](serviceRoot)){if(_0xebac2a===_0x4011e5(0x154))continue;delete serviceRoot[_0xebac2a];}}export const service=serviceRoot;export async function createEps(_0x3cf870=![]){const _0x407281=_0x1a6344;if(!_0x3cf870&&g[_0x407281(0x153)])return g['__vome_admin_eps__'];const _0x31568f=((async()=>{const _0x63a90f=_0x407281,_0x468cf2=await loadEps(_0x3cf870)||{},_0x4ce15b=normalizeEpsMap(_0x468cf2),_0x370ed3=countPrefixedEntities(_0x4ce15b);if(!_0x370ed3)throw new Error(_0x63a90f(0x15b));resetServiceModules(),buildFromEps(_0x4ce15b);const _0x2a444b=serviceRoot[_0x63a90f(0x144)];if(!_0x2a444b||typeof _0x2a444b!==_0x63a90f(0x151))throw new Error(_0x63a90f(0x170));return serviceRoot;})());g[_0x407281(0x153)]=_0x31568f;try{return await _0x31568f;}catch(_0x298c8b){g['__vome_admin_eps__']=null;throw _0x298c8b;}}if(undefined){}export function setServicePerms(_0x3bc280,_0xbf280e=![]){const _0x20a813=_0x3bc280||[];function _0x38cd5e(_0x4e10f6){const _0x14bdfa=_0x48ef;if(!_0x4e10f6||typeof _0x4e10f6!=='object')return;const _0x25f79a=_0x4e10f6;if(_0x25f79a[_0x14bdfa(0x157)]&&_0x25f79a[_0x14bdfa(0x167)]){_0x25f79a['_permission']={};for(const _0x1dbbf5 of Object[_0x14bdfa(0x168)](_0x25f79a['permission'])){if(_0xbf280e){_0x25f79a['_permission'][_0x1dbbf5]=!![];continue;}const _0x120339=_0x25f79a['permission'][_0x1dbbf5];_0x25f79a['_permission'][_0x1dbbf5]=_0x20a813[_0x14bdfa(0x165)](_0x120339)||_0x20a813[_0x14bdfa(0x138)](_0x690511=>_0x690511[_0x14bdfa(0x155)](/:/g,'/')[_0x14bdfa(0x165)](_0x25f79a[_0x14bdfa(0x167)][_0x14bdfa(0x155)](/^admin\//,'')+'/'+_0x1dbbf5));}return;}for(const _0x18069f of Object['keys'](_0x25f79a)){if(_0x18069f===_0x14bdfa(0x154))continue;_0x38cd5e(_0x25f79a[_0x18069f]);}}_0x38cd5e(serviceRoot);}function _0x48ef(_0x1c3eca,_0x30be1c){_0x1c3eca=_0x1c3eca-0x138;const _0x46d6d7=_0x46d6();let _0x48ef41=_0x46d6d7[_0x1c3eca];if(_0x48ef['NioKTO']===undefined){var _0x1f6cb6=function(_0x4e7ed1){const _0x326086='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x1a5aad='',_0x3600dc='';for(let _0x43c434=0x0,_0x14c453,_0x1c5c95,_0x52fa07=0x0;_0x1c5c95=_0x4e7ed1['charAt'](_0x52fa07++);~_0x1c5c95&&(_0x14c453=_0x43c434%0x4?_0x14c453*0x40+_0x1c5c95:_0x1c5c95,_0x43c434++%0x4)?_0x1a5aad+=String['fromCharCode'](0xff&_0x14c453>>(-0x2*_0x43c434&0x6)):0x0){_0x1c5c95=_0x326086['indexOf'](_0x1c5c95);}for(let _0x491f2c=0x0,_0x3f5bf3=_0x1a5aad['length'];_0x491f2c<_0x3f5bf3;_0x491f2c++){_0x3600dc+='%'+('00'+_0x1a5aad['charCodeAt'](_0x491f2c)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3600dc);};_0x48ef['ZWpqkg']=_0x1f6cb6,_0x48ef['CcOfCd']={},_0x48ef['NioKTO']=!![];}const _0x2f5d7a=_0x46d6d7[0x0],_0x5282bf=_0x1c3eca+_0x2f5d7a,_0x2692cf=_0x48ef['CcOfCd'][_0x5282bf];return!_0x2692cf?(_0x48ef41=_0x48ef['ZWpqkg'](_0x48ef41),_0x48ef['CcOfCd'][_0x5282bf]=_0x48ef41):_0x48ef41=_0x2692cf,_0x48ef41;}export function resolveService(_0x24fd46){const _0x131a2c=_0x1a6344,_0x14f824=_0x24fd46['replace'](/^\//,'')[_0x131a2c(0x15e)]('.')['filter'](Boolean);let _0x485d3b=serviceRoot;for(const _0x4a15ea of _0x14f824){if(!_0x485d3b||typeof _0x485d3b!==_0x131a2c(0x151))return;_0x485d3b=_0x485d3b[_0x4a15ea];}if(_0x485d3b&&typeof _0x485d3b===_0x131a2c(0x151)&&_0x131a2c(0x167)in _0x485d3b)return _0x485d3b;return;}export function serviceOf(_0x4d3c1b){const _0x1b1f32=_0x1a6344,_0x3125bc=_0x4d3c1b[_0x1b1f32(0x155)](/\/$/,''),_0x4755bb=prefixToParts(_0x3125bc)[_0x1b1f32(0x16f)]('.'),_0x59e89e=resolveService(_0x4755bb);if(!_0x59e89e)throw new Error(_0x1b1f32(0x169)+_0x4d3c1b+_0x1b1f32(0x16b));return _0x59e89e;}function _0x46d6(){const _0x52bcb9=['BwfW','x192B21Lx2fKBwLUx3nLCNzPy2vFxW','C3rHCNrZv2L0Aa','w3zVBwuTzxbZxsbLBxb0EsbVCIbPBNzHBgLKiokaLcbLBMfIBguGDM9Tzs5LChmGyw5KignOzwnRieDfvcaVywrTAw4VyMfZzs9VCgvUl2vWCYaOzxHWzwn0ig1VzhvSzsbTyxaGD2L0AcbWCMvMAxGP','mta0mJKWnZzOtezZBhG','BgvUz3rO','C3bSAxq','zgf0yq','Dg9vChbLCKnHC2u','ChjLzML4','mJmZnuXTq3zMBa','mta0nZu1nJHWCgn1D1G','Aw5MBW','Aw5JBhvKzxm','Dg9mB3DLCKnHC2u','BMfTzxnWywnL','A2v5CW','w3zVBwuTzxbZxsbZzxj2AwnLig1PC3nPBMC6ia','ChjVDg90ExbL','icHHD2fPDcbJCMvHDgvfChmGzMLYC3qP','zMLSDgvY','AxnbCNjHEq','z2v0','AM9PBG','w3zVBwuTzxbZxsbTB3vUDcbMywLSzwq6ihnLCNzPy2uUyMfZzsbTAxnZAw5NigfMDgvYievquYbHChbSEq','Cgf0Aa','C29Tzq','DxbKyxrL','C2vHCMnO','CMvZDg9Yzq','ywrTAw4','ndK1odm0mfzLD3PvyW','CgfYyw1Z','zMXHDa','yMLUza','y29Kzq','zMLLBgrmAwTL','mJy1nte4og1sDLDhCG','yMfZzq','zNvUy3rPB24','BgLZDa','zMLLBgrbCNjHEq','ywrK','zMLLBgrsyw5Nzq','mtu5me1gCvbhEa','DMfSDwvZ','Cg9ZDa','C2XPy2u','yxbP','mJi3ntyZtu9Zv2ry','x3bLCM1PC3nPB24','B2jQzwn0','mJm3mdKWnLnXCw5AAG','x192B21Lx2fKBwLUx2vWC19F','CMvXDwvZDa','CMvWBgfJzq','DgvZDa','CgvYBwLZC2LVBG'];_0x46d6=function(){return _0x52bcb9;};return _0x46d6();}export function createEpsService(_0x5abeda){return serviceOf(_0x5abeda);}export{BaseService};
1
+ import { loadEps } from "../lib/eps";
2
+ import { BaseService } from "./base";
3
+ const SIDE_ID = "admin";
4
+ function toCamel(str) {
5
+ return str.replace(/([^-])(?:-+([^-]))/g, (_m, a, b) => a + String(b).toUpperCase());
6
+ }
7
+ function methodName(path) {
8
+ return path.replace(/^\//, "").replace(/[:,\s/-]/g, "");
9
+ }
10
+ function isValidName(name) {
11
+ return Boolean(name) && !["{", "}", ":"].some((c) => name.includes(c));
12
+ }
13
+ function resolvePermCode(prefix, action) {
14
+ const parts = prefix.replace(/^\//, "").split("/").filter(Boolean);
15
+ const module = parts[1] || parts[0] || "base";
16
+ let resource = parts.slice(2).join(":");
17
+ if (resource === module) {
18
+ resource = module;
19
+ } else if (resource.startsWith(`${module}:`)) {
20
+ resource = resource.slice(module.length + 1);
21
+ }
22
+ const head = `${module}-`;
23
+ if (resource.startsWith(head))
24
+ resource = resource.slice(head.length);
25
+ resource = resource.replace(/-/g, ":");
26
+ if (!resource)
27
+ resource = module;
28
+ return `${module}:${resource}:${action}`;
29
+ }
30
+ function prefixToParts(prefix) {
31
+ const raw = prefix.replace(/^\//, "");
32
+ return raw.replace(new RegExp(`^${SIDE_ID}/?`), "").split("/").filter(Boolean).map(toCamel);
33
+ }
34
+ function bindCrud(leaf, base) {
35
+ const proto = BaseService.prototype;
36
+ for (const name of [
37
+ "request",
38
+ "page",
39
+ "list",
40
+ "info",
41
+ "add",
42
+ "update",
43
+ "delete",
44
+ "restore"
45
+ ]) {
46
+ const fn = proto[name];
47
+ if (typeof fn === "function") {
48
+ leaf[name] = fn.bind(base);
49
+ }
50
+ }
51
+ }
52
+ function bindApis(leaf, base, apis) {
53
+ leaf.permission ||= {};
54
+ for (const api of apis) {
55
+ const name = methodName(api.path);
56
+ if (!isValidName(name) || /[-:]/g.test(name))
57
+ continue;
58
+ const method = (api.method || "get").toLowerCase();
59
+ leaf[name] = function(data) {
60
+ return this.request({
61
+ url: api.path.startsWith("/") ? api.path : `/${api.path}`,
62
+ method,
63
+ [method === "post" ? "data" : "params"]: data
64
+ });
65
+ }.bind(base);
66
+ leaf.permission[name] = api.perms?.[0] || resolvePermCode(`/${leaf.namespace}`, name);
67
+ }
68
+ }
69
+ function createLeaf(namespace, apis = []) {
70
+ const ns = namespace.replace(/^\//, "");
71
+ const base = new BaseService(ns);
72
+ const leaf = base;
73
+ leaf.namespace = ns;
74
+ leaf.permission = {};
75
+ leaf._permission = {};
76
+ bindCrud(leaf, base);
77
+ bindApis(leaf, base, apis);
78
+ return leaf;
79
+ }
80
+ function attachLeaf(tree, prefix, apis = []) {
81
+ const raw = prefix.replace(/^\//, "");
82
+ const arr = prefixToParts(prefix);
83
+ if (!arr.length)
84
+ return;
85
+ let node = tree;
86
+ for (let i = 0;i < arr.length; i++) {
87
+ const key = arr[i];
88
+ const isLast = i === arr.length - 1;
89
+ if (!isLast) {
90
+ const cur = node[key];
91
+ if (!cur || typeof cur !== "object" || "namespace" in cur) {
92
+ node[key] = {};
93
+ }
94
+ node = node[key];
95
+ continue;
96
+ }
97
+ const leaf = createLeaf(raw, apis);
98
+ node[key] = leaf;
99
+ return leaf;
100
+ }
101
+ return;
102
+ }
103
+ function buildFromEps(map) {
104
+ const root = getOrCreateRoot();
105
+ const list = Object.values(map).flat();
106
+ for (const e of list) {
107
+ if (!e?.prefix)
108
+ continue;
109
+ const leaf = attachLeaf(root, e.prefix, e.api || []);
110
+ if (leaf) {
111
+ const op = e.pageQueryOp;
112
+ if (op) {
113
+ leaf.search = {
114
+ fieldEq: op.fieldEq,
115
+ fieldLike: op.fieldLike,
116
+ fieldArray: op.fieldArray,
117
+ fieldRange: op.fieldRange,
118
+ keyWordLikeFields: op.keyWordLikeFields
119
+ };
120
+ }
121
+ }
122
+ }
123
+ }
124
+ function normalizeEpsMap(input) {
125
+ if (!input || typeof input !== "object")
126
+ return {};
127
+ const m = input;
128
+ if ("code" in m && "data" in m && m.data && typeof m.data === "object" && !Array.isArray(m.data)) {
129
+ return m.data;
130
+ }
131
+ return input;
132
+ }
133
+ function countPrefixedEntities(map) {
134
+ return Object.values(map).flat().filter((e) => e && typeof e === "object" && Boolean(e.prefix)).length;
135
+ }
136
+ const SERVICE_ROOT_KEY = "__vome_admin_service__";
137
+ const EPS_PROMISE_KEY = "__vome_admin_eps__";
138
+ function createServiceRoot() {
139
+ const root = new BaseService;
140
+ return {
141
+ request: root.request.bind(root)
142
+ };
143
+ }
144
+ function getOrCreateRoot() {
145
+ const g = globalThis;
146
+ if (!g[SERVICE_ROOT_KEY]) {
147
+ g[SERVICE_ROOT_KEY] = createServiceRoot();
148
+ }
149
+ return g[SERVICE_ROOT_KEY];
150
+ }
151
+ function resetServiceModules() {
152
+ const root = getOrCreateRoot();
153
+ for (const key of Object.keys(root)) {
154
+ if (key === "request")
155
+ continue;
156
+ delete root[key];
157
+ }
158
+ }
159
+ export const service = new Proxy({}, {
160
+ get(_t, prop, _r) {
161
+ const root = getOrCreateRoot();
162
+ const val = Reflect.get(root, prop, root);
163
+ return typeof val === "function" ? val.bind(root) : val;
164
+ },
165
+ set(_t, prop, value) {
166
+ return Reflect.set(getOrCreateRoot(), prop, value);
167
+ },
168
+ has(_t, prop) {
169
+ return Reflect.has(getOrCreateRoot(), prop);
170
+ },
171
+ ownKeys() {
172
+ return Reflect.ownKeys(getOrCreateRoot());
173
+ },
174
+ getOwnPropertyDescriptor(_t, prop) {
175
+ const desc = Reflect.getOwnPropertyDescriptor(getOrCreateRoot(), prop);
176
+ if (desc)
177
+ desc.configurable = true;
178
+ return desc;
179
+ }
180
+ });
181
+ export async function createEps(force = false) {
182
+ const g = globalThis;
183
+ if (!force && g[EPS_PROMISE_KEY])
184
+ return g[EPS_PROMISE_KEY];
185
+ const run = (async () => {
186
+ const raw = await loadEps(force) || {};
187
+ const map = normalizeEpsMap(raw);
188
+ const n = countPrefixedEntities(map);
189
+ if (!n) {
190
+ throw new Error("[vome-eps] empty or invalid — enable vome.eps and check GET /admin/base/open/eps (expect module map with prefix)");
191
+ }
192
+ resetServiceModules();
193
+ buildFromEps(map);
194
+ const root = getOrCreateRoot();
195
+ const base = root.base;
196
+ if (!base || typeof base !== "object") {
197
+ throw new Error("[vome-eps] mount failed: service.base missing after EPS apply");
198
+ }
199
+ return root;
200
+ })();
201
+ g[EPS_PROMISE_KEY] = run;
202
+ try {
203
+ return await run;
204
+ } catch (e) {
205
+ g[EPS_PROMISE_KEY] = null;
206
+ throw e;
207
+ }
208
+ }
209
+ if (undefined) {}
210
+ export function setServicePerms(perms, isSuper = false) {
211
+ const list = perms || [];
212
+ const root = getOrCreateRoot();
213
+ function deep(d) {
214
+ if (!d || typeof d !== "object")
215
+ return;
216
+ const obj = d;
217
+ if (obj.permission && obj.namespace) {
218
+ obj._permission = {};
219
+ for (const key of Object.keys(obj.permission)) {
220
+ if (isSuper) {
221
+ obj._permission[key] = true;
222
+ continue;
223
+ }
224
+ const code = obj.permission[key];
225
+ obj._permission[key] = list.includes(code) || list.some((p) => p.replace(/:/g, "/").includes(`${obj.namespace.replace(/^admin\//, "")}/${key}`));
226
+ }
227
+ return;
228
+ }
229
+ for (const k of Object.keys(obj)) {
230
+ if (k === "request")
231
+ continue;
232
+ deep(obj[k]);
233
+ }
234
+ }
235
+ deep(root);
236
+ }
237
+ export function resolveService(path) {
238
+ const parts = path.replace(/^\//, "").split(".").filter(Boolean);
239
+ let cur = getOrCreateRoot();
240
+ for (const p of parts) {
241
+ if (!cur || typeof cur !== "object")
242
+ return;
243
+ cur = cur[p];
244
+ }
245
+ if (cur && typeof cur === "object" && "namespace" in cur) {
246
+ return cur;
247
+ }
248
+ return;
249
+ }
250
+ export function serviceOf(prefix) {
251
+ const raw = prefix.replace(/\/$/, "");
252
+ const path = prefixToParts(raw).join(".");
253
+ const hit = resolveService(path);
254
+ if (!hit) {
255
+ throw new Error(`[vome-eps] service missing: ${prefix} (await createEps first)`);
256
+ }
257
+ return hit;
258
+ }
259
+ export function createEpsService(prefix) {
260
+ return serviceOf(prefix);
261
+ }
262
+
263
+ export { BaseService };
@@ -1 +1 @@
1
- const _0x1568f6=_0x23a2;(function(_0x34f54e,_0x23400c){const _0x55e822=_0x23a2,_0x33ffab=_0x34f54e();while(!![]){try{const _0x63e1cf=-parseInt(_0x55e822(0x112))/0x1*(-parseInt(_0x55e822(0x118))/0x2)+-parseInt(_0x55e822(0x116))/0x3*(-parseInt(_0x55e822(0x10e))/0x4)+parseInt(_0x55e822(0x117))/0x5+-parseInt(_0x55e822(0x111))/0x6+-parseInt(_0x55e822(0x11d))/0x7*(parseInt(_0x55e822(0x10d))/0x8)+-parseInt(_0x55e822(0x11a))/0x9+parseInt(_0x55e822(0x119))/0xa;if(_0x63e1cf===_0x23400c)break;else _0x33ffab['push'](_0x33ffab['shift']());}catch(_0x5b9037){_0x33ffab['push'](_0x33ffab['shift']());}}}(_0x55b8,0xb685d));import{defineStore}from'pinia';import{nextTick}from'vue';const FOLD_KEY=_0x1568f6(0x11c);function _0x23a2(_0x4f0b58,_0x4320e9){_0x4f0b58=_0x4f0b58-0x10d;const _0x55b81f=_0x55b8();let _0x23a251=_0x55b81f[_0x4f0b58];if(_0x23a2['ILPFDd']===undefined){var _0x513a4d=function(_0x55618a){const _0x3f4a89='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x53c122='',_0x44a050='';for(let _0x4fccb9=0x0,_0x4d8f3f,_0x38a3e1,_0x158d9d=0x0;_0x38a3e1=_0x55618a['charAt'](_0x158d9d++);~_0x38a3e1&&(_0x4d8f3f=_0x4fccb9%0x4?_0x4d8f3f*0x40+_0x38a3e1:_0x38a3e1,_0x4fccb9++%0x4)?_0x53c122+=String['fromCharCode'](0xff&_0x4d8f3f>>(-0x2*_0x4fccb9&0x6)):0x0){_0x38a3e1=_0x3f4a89['indexOf'](_0x38a3e1);}for(let _0x2cf09c=0x0,_0x12ef53=_0x53c122['length'];_0x2cf09c<_0x12ef53;_0x2cf09c++){_0x44a050+='%'+('00'+_0x53c122['charCodeAt'](_0x2cf09c)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x44a050);};_0x23a2['cFhXNt']=_0x513a4d,_0x23a2['Mztpfo']={},_0x23a2['ILPFDd']=!![];}const _0x317e64=_0x55b81f[0x0],_0x43b872=_0x4f0b58+_0x317e64,_0x33db3f=_0x23a2['Mztpfo'][_0x43b872];return!_0x33db3f?(_0x23a251=_0x23a2['cFhXNt'](_0x23a251),_0x23a2['Mztpfo'][_0x43b872]=_0x23a251):_0x23a251=_0x33db3f,_0x23a251;}function _0x55b8(){const _0x44b659=['mtaWnZaXohjeverWDq','Bw9IAwXLt3bLBG','yxbW','z2v0sxrLBq','mteXu0HKuLPO','mtqWmZy0menir01msq','mLPPrePgBG','mZmWnJmXmgPnzfr3qG','odeXntq5ognmswjQsa','DMLLD0fSAxzL','DM9Tzv9Hzg1PBL9ZAwrLyMfYx2zVBgq','nJaZmZC5vgD2AwXW','ohjQtvPLBW','mtaXmJCYqLjevffV','C2v0sxrLBq','C2LKzwjHCKzVBgq','ndKXnZy2nKDpzMvRsG'];_0x55b8=function(){return _0x44b659;};return _0x55b8();}export const useAppStore=defineStore(_0x1568f6(0x114),{'state':()=>({'sidebarFold':localStorage[_0x1568f6(0x115)](FOLD_KEY)==='1','mobileOpen':![],'viewAlive':!![]}),'actions':{'toggleSidebarFold'(){const _0x32b65a=_0x1568f6;this['sidebarFold']=!this['sidebarFold'],localStorage[_0x32b65a(0x10f)](FOLD_KEY,this[_0x32b65a(0x110)]?'1':'0');},'setMobileOpen'(_0x53c122){const _0x19d883=_0x1568f6;this[_0x19d883(0x113)]=_0x53c122;},async 'reloadView'(){const _0xf01b3c=_0x1568f6;this[_0xf01b3c(0x11b)]=![],await nextTick(),this[_0xf01b3c(0x11b)]=!![];}}});
1
+ function _0x1ae9(){const _0x530bfe=['nJK0nZC2ywXsq2Dv','mtq5mdm1nuTzwNH5AG','mtGXmtG1mgP0D2DywG','nKffEwHJAG','mZa4nZqWotzlr2fVtKy','nJC5ywzftxfl','z2v0sxrLBq','Bw9IAwXLt3bLBG','m1zVt2LOCa','C2LKzwjHCKzVBgq','DM9Tzv9Hzg1PBL9ZAwrLyMfYx2zVBgq','mti2otyZzKPyCvD2','nZeWu0TjqvPN','mJKZntjHtuPqrK0','mtyZndK2tvjwrKfi','DMLLD0fSAxzL'];_0x1ae9=function(){return _0x530bfe;};return _0x1ae9();}const _0x299a9d=_0x3121;(function(_0x551953,_0x3142fb){const _0x20d348=_0x3121,_0x668ac6=_0x551953();while(!![]){try{const _0xf73f6a=parseInt(_0x20d348(0xc1))/0x1+parseInt(_0x20d348(0xbf))/0x2*(-parseInt(_0x20d348(0xc7))/0x3)+parseInt(_0x20d348(0xbc))/0x4+-parseInt(_0x20d348(0xc0))/0x5*(parseInt(_0x20d348(0xc2))/0x6)+parseInt(_0x20d348(0xc4))/0x7*(-parseInt(_0x20d348(0xbd))/0x8)+parseInt(_0x20d348(0xba))/0x9*(-parseInt(_0x20d348(0xbb))/0xa)+parseInt(_0x20d348(0xc3))/0xb;if(_0xf73f6a===_0x3142fb)break;else _0x668ac6['push'](_0x668ac6['shift']());}catch(_0x3ea0fd){_0x668ac6['push'](_0x668ac6['shift']());}}}(_0x1ae9,0xf347f));import{defineStore}from'pinia';import{nextTick}from'vue';function _0x3121(_0x2f5c56,_0x5d2ee8){_0x2f5c56=_0x2f5c56-0xb8;const _0x1ae92f=_0x1ae9();let _0x3121c9=_0x1ae92f[_0x2f5c56];if(_0x3121['fDTETZ']===undefined){var _0x28e3e1=function(_0x148ded){const _0x3a326e='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3edebf='',_0x5efe8e='';for(let _0x5b08de=0x0,_0x2760af,_0x2fdd32,_0x288eb9=0x0;_0x2fdd32=_0x148ded['charAt'](_0x288eb9++);~_0x2fdd32&&(_0x2760af=_0x5b08de%0x4?_0x2760af*0x40+_0x2fdd32:_0x2fdd32,_0x5b08de++%0x4)?_0x3edebf+=String['fromCharCode'](0xff&_0x2760af>>(-0x2*_0x5b08de&0x6)):0x0){_0x2fdd32=_0x3a326e['indexOf'](_0x2fdd32);}for(let _0x432d4=0x0,_0x17ba01=_0x3edebf['length'];_0x432d4<_0x17ba01;_0x432d4++){_0x5efe8e+='%'+('00'+_0x3edebf['charCodeAt'](_0x432d4)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x5efe8e);};_0x3121['ihlIfg']=_0x28e3e1,_0x3121['TYUbPK']={},_0x3121['fDTETZ']=!![];}const _0x115f67=_0x1ae92f[0x0],_0x481b7f=_0x2f5c56+_0x115f67,_0x11da85=_0x3121['TYUbPK'][_0x481b7f];return!_0x11da85?(_0x3121c9=_0x3121['ihlIfg'](_0x3121c9),_0x3121['TYUbPK'][_0x481b7f]=_0x3121c9):_0x3121c9=_0x11da85,_0x3121c9;}const FOLD_KEY=_0x299a9d(0xb9);export const useAppStore=defineStore('app',{'state':()=>({'sidebarFold':localStorage[_0x299a9d(0xc5)](FOLD_KEY)==='1','mobileOpen':![],'viewAlive':!![]}),'actions':{'toggleSidebarFold'(){const _0x12283f=_0x299a9d;this[_0x12283f(0xb8)]=!this[_0x12283f(0xb8)],localStorage['setItem'](FOLD_KEY,this[_0x12283f(0xb8)]?'1':'0');},'setMobileOpen'(_0x3edebf){const _0x44fcd9=_0x299a9d;this[_0x44fcd9(0xc6)]=_0x3edebf;},async 'reloadView'(){const _0x1345d6=_0x299a9d;this[_0x1345d6(0xbe)]=![],await nextTick(),this[_0x1345d6(0xbe)]=!![];}}});
@@ -1 +1 @@
1
- (function(_0x2f9a73,_0xe8e7fa){const _0x2cb709=_0x1795,_0xadbfd5=_0x2f9a73();while(!![]){try{const _0x428c33=parseInt(_0x2cb709(0xf5))/0x1*(parseInt(_0x2cb709(0xdb))/0x2)+parseInt(_0x2cb709(0xf4))/0x3+parseInt(_0x2cb709(0xf3))/0x4*(parseInt(_0x2cb709(0xda))/0x5)+-parseInt(_0x2cb709(0xf2))/0x6*(-parseInt(_0x2cb709(0xdd))/0x7)+parseInt(_0x2cb709(0xec))/0x8+parseInt(_0x2cb709(0xee))/0x9+-parseInt(_0x2cb709(0xe4))/0xa*(parseInt(_0x2cb709(0xed))/0xb);if(_0x428c33===_0xe8e7fa)break;else _0xadbfd5['push'](_0xadbfd5['shift']());}catch(_0x37af46){_0xadbfd5['push'](_0xadbfd5['shift']());}}}(_0x3415,0x8396a));import{defineStore}from'pinia';function _0x3415(){const _0x544920=['mtjqqKriD0q','mtjwt05WveS','mJiZnJa4mfrovePMrq','munmDKH3CG','ota3mJK1wgrcr29Y','ntm0mta2CuHzrffq','y29TCg9Uzw50tMfTzq','mtK5ntaXnfnjywviuG','zMLUza','zNvSBfbHDgG','Cgf0Aa','BMfTzq','zMLSDgvY','C29Tzq','mtbRA0XIq2G','DgL0Bgu','Bwv0yq','ChvZAa','A2vLCefSAxzL','BgLZDa','y2fJAgvZ','C3rYAw5N','ntm3oti4oe5qywfhqG','mZm2odu1ntneueTPt0K','nZiXodKZnM5puMvsua','Aw5JBhvKzxm','zMLUzeLUzgv4','ChvIBgLJ'];_0x3415=function(){return _0x544920;};return _0x3415();}function _0x1795(_0xac20db,_0x595098){_0xac20db=_0xac20db-0xda;const _0x341508=_0x3415();let _0x1795f4=_0x341508[_0xac20db];if(_0x1795['XUzrHr']===undefined){var _0x5a7be1=function(_0x31f940){const _0xb43def='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x75feec='',_0x558875='';for(let _0x5e9196=0x0,_0x326ac1,_0x30d6b3,_0x2ac7a4=0x0;_0x30d6b3=_0x31f940['charAt'](_0x2ac7a4++);~_0x30d6b3&&(_0x326ac1=_0x5e9196%0x4?_0x326ac1*0x40+_0x30d6b3:_0x30d6b3,_0x5e9196++%0x4)?_0x75feec+=String['fromCharCode'](0xff&_0x326ac1>>(-0x2*_0x5e9196&0x6)):0x0){_0x30d6b3=_0xb43def['indexOf'](_0x30d6b3);}for(let _0x459819=0x0,_0x5120cf=_0x75feec['length'];_0x459819<_0x5120cf;_0x459819++){_0x558875+='%'+('00'+_0x75feec['charCodeAt'](_0x459819)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x558875);};_0x1795['WFQFjs']=_0x5a7be1,_0x1795['jCbDhy']={},_0x1795['XUzrHr']=!![];}const _0x24c430=_0x341508[0x0],_0x57d300=_0xac20db+_0x24c430,_0x54f555=_0x1795['jCbDhy'][_0x57d300];return!_0x54f555?(_0x1795f4=_0x1795['WFQFjs'](_0x1795f4),_0x1795['jCbDhy'][_0x57d300]=_0x1795f4):_0x1795f4=_0x54f555,_0x1795f4;}export const useTagsStore=defineStore('tags',{'state':()=>({'list':[],'caches':[]}),'actions':{'add'(_0x75feec){const _0x54bc8a=_0x1795;if(_0x75feec['meta'][_0x54bc8a(0xf1)]||_0x75feec[_0x54bc8a(0xe0)]==='/login')return;const _0x558875=String(_0x75feec[_0x54bc8a(0xe6)][_0x54bc8a(0xe5)]||_0x75feec[_0x54bc8a(0xe1)]||_0x75feec[_0x54bc8a(0xe0)]),_0x5e9196=typeof _0x75feec['meta']['componentName']===_0x54bc8a(0xeb)?_0x75feec[_0x54bc8a(0xe6)]['componentName']:undefined,_0x326ac1=_0x75feec['meta'][_0x54bc8a(0xe8)]!==![];_0x5e9196&&_0x326ac1&&this['addCache'](_0x5e9196);const _0x30d6b3=this[_0x54bc8a(0xe9)][_0x54bc8a(0xde)](_0x2ac7a4=>_0x2ac7a4[_0x54bc8a(0xe0)]===_0x75feec['path']);if(_0x30d6b3){_0x30d6b3[_0x54bc8a(0xdf)]=_0x75feec[_0x54bc8a(0xdf)],_0x30d6b3[_0x54bc8a(0xe5)]=_0x558875,_0x30d6b3['componentName']=_0x5e9196,_0x30d6b3[_0x54bc8a(0xe8)]=_0x326ac1;return;}this[_0x54bc8a(0xe9)][_0x54bc8a(0xe7)]({'path':_0x75feec[_0x54bc8a(0xe0)],'fullPath':_0x75feec['fullPath'],'title':_0x558875,'name':_0x75feec[_0x54bc8a(0xe1)],'componentName':_0x5e9196,'keepAlive':_0x326ac1});},'addCache'(_0x459819){const _0x2dc9d1=_0x1795;if(!_0x459819||this[_0x2dc9d1(0xea)][_0x2dc9d1(0xef)](_0x459819))return;this[_0x2dc9d1(0xea)][_0x2dc9d1(0xe7)](_0x459819);},'removeCache'(_0x5120cf){const _0x5e8401=_0x1795;if(!_0x5120cf)return;this[_0x5e8401(0xea)]=this[_0x5e8401(0xea)][_0x5e8401(0xe2)](_0x375b53=>_0x375b53!==_0x5120cf);},'remove'(_0x16df92){const _0x568102=_0x1795,_0x2e6da8=this['list'][_0x568102(0xf0)](_0x5e6896=>_0x5e6896[_0x568102(0xe0)]===_0x16df92);if(_0x2e6da8<0x0)return;const [_0x3480ae]=this[_0x568102(0xe9)]['splice'](_0x2e6da8,0x1),_0x198fed=_0x3480ae?.[_0x568102(0xdc)]&&this[_0x568102(0xe9)][_0x568102(0xe3)](_0x303104=>_0x303104['componentName']===_0x3480ae[_0x568102(0xdc)]);_0x3480ae?.['componentName']&&!_0x198fed&&this['removeCache'](_0x3480ae[_0x568102(0xdc)]);},'closeOthers'(_0x239011){const _0x3533d2=_0x1795,_0x28baf1=this[_0x3533d2(0xe9)]['filter'](_0x10f114=>_0x10f114['path']===_0x239011||_0x10f114[_0x3533d2(0xe0)]==='/');this[_0x3533d2(0xe9)]=_0x28baf1,this[_0x3533d2(0xea)]=_0x28baf1[_0x3533d2(0xe2)](_0x27428d=>_0x27428d['keepAlive']&&_0x27428d['componentName'])['map'](_0x498835=>_0x498835[_0x3533d2(0xdc)])['filter']((_0xb6c7e4,_0x58a2de,_0x286716)=>_0x286716['indexOf'](_0xb6c7e4)===_0x58a2de);},'clear'(){const _0x2d4900=_0x1795;this[_0x2d4900(0xe9)]=this[_0x2d4900(0xe9)][_0x2d4900(0xe2)](_0x440a9b=>_0x440a9b[_0x2d4900(0xe0)]==='/'),this[_0x2d4900(0xea)]=[];}}});
1
+ function _0x5234(_0x21bfe3,_0x15cc6d){_0x21bfe3=_0x21bfe3-0x189;const _0x1ca35a=_0x1ca3();let _0x5234cf=_0x1ca35a[_0x21bfe3];if(_0x5234['UTlPDZ']===undefined){var _0x3534c7=function(_0x15ad0c){const _0x3641df='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x5d7e39='',_0x3e2da4='';for(let _0x27f58c=0x0,_0x39bea9,_0x4ba4ee,_0x10557f=0x0;_0x4ba4ee=_0x15ad0c['charAt'](_0x10557f++);~_0x4ba4ee&&(_0x39bea9=_0x27f58c%0x4?_0x39bea9*0x40+_0x4ba4ee:_0x4ba4ee,_0x27f58c++%0x4)?_0x5d7e39+=String['fromCharCode'](0xff&_0x39bea9>>(-0x2*_0x27f58c&0x6)):0x0){_0x4ba4ee=_0x3641df['indexOf'](_0x4ba4ee);}for(let _0x34e0f7=0x0,_0xef68b2=_0x5d7e39['length'];_0x34e0f7<_0xef68b2;_0x34e0f7++){_0x3e2da4+='%'+('00'+_0x5d7e39['charCodeAt'](_0x34e0f7)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3e2da4);};_0x5234['PAidWi']=_0x3534c7,_0x5234['Bgbpbh']={},_0x5234['UTlPDZ']=!![];}const _0x67646e=_0x1ca35a[0x0],_0x398ac7=_0x21bfe3+_0x67646e,_0x589f29=_0x5234['Bgbpbh'][_0x398ac7];return!_0x589f29?(_0x5234cf=_0x5234['PAidWi'](_0x5234cf),_0x5234['Bgbpbh'][_0x398ac7]=_0x5234cf):_0x5234cf=_0x589f29,_0x5234cf;}const _0x322d34=_0x5234;(function(_0x3df6b5,_0xed5708){const _0x2cd1ba=_0x5234,_0xe1f3a9=_0x3df6b5();while(!![]){try{const _0x42be5b=parseInt(_0x2cd1ba(0x194))/0x1*(parseInt(_0x2cd1ba(0x1a2))/0x2)+parseInt(_0x2cd1ba(0x192))/0x3+parseInt(_0x2cd1ba(0x1a7))/0x4+-parseInt(_0x2cd1ba(0x18c))/0x5+parseInt(_0x2cd1ba(0x191))/0x6*(-parseInt(_0x2cd1ba(0x1a0))/0x7)+-parseInt(_0x2cd1ba(0x199))/0x8*(-parseInt(_0x2cd1ba(0x19e))/0x9)+parseInt(_0x2cd1ba(0x195))/0xa*(-parseInt(_0x2cd1ba(0x18f))/0xb);if(_0x42be5b===_0xed5708)break;else _0xe1f3a9['push'](_0xe1f3a9['shift']());}catch(_0x2b12d6){_0xe1f3a9['push'](_0xe1f3a9['shift']());}}}(_0x1ca3,0x43f09));function _0x1ca3(){const _0x556b00=['zNvSBfbHDgG','BgLZDa','odHfwe5bqwO','ChvZAa','C3rYAw5N','Aw5JBhvKzxm','BwfW','mty5ntC4ChLOCNLn','Bwv0yq','mta5mdCXmNbtB1nLzG','y29TCg9Uzw50tMfTzq','mtr1sgz2zgu','DgfNCW','DgL0Bgu','zMLSDgvY','y2fJAgvZ','nZm0nJG4zuDTsNv2','C3bSAwnL','ywrKq2fJAgu','Cgf0Aa','zMLUza','nde0nZqWC2TyB0Pt','A2vLCefSAxzL','BMfTzq','mJjsve1eELC','zMLUzeLUzgv4','nNLqyM52wG','mtuWotKZnKDsvhHoyq','ChvIBgLJ','mZa3nZfNwwrVvvm','mJK2mJK5mhD2zuXKDW','Aw5KzxHpzG'];_0x1ca3=function(){return _0x556b00;};return _0x1ca3();}import{defineStore}from'pinia';export const useTagsStore=defineStore(_0x322d34(0x1a3),{'state':()=>({'list':[],'caches':[]}),'actions':{'add'(_0x5d7e39){const _0x37c2db=_0x322d34;if(_0x5d7e39['meta'][_0x37c2db(0x193)]||_0x5d7e39[_0x37c2db(0x18a)]==='/login')return;const _0x3e2da4=String(_0x5d7e39[_0x37c2db(0x19f)][_0x37c2db(0x1a4)]||_0x5d7e39[_0x37c2db(0x18e)]||_0x5d7e39[_0x37c2db(0x18a)]),_0x27f58c=typeof _0x5d7e39[_0x37c2db(0x19f)][_0x37c2db(0x1a1)]===_0x37c2db(0x19b)?_0x5d7e39['meta']['componentName']:undefined,_0x39bea9=_0x5d7e39[_0x37c2db(0x19f)]['keepAlive']!==![];_0x27f58c&&_0x39bea9&&this[_0x37c2db(0x189)](_0x27f58c);const _0x4ba4ee=this[_0x37c2db(0x198)][_0x37c2db(0x18b)](_0x10557f=>_0x10557f[_0x37c2db(0x18a)]===_0x5d7e39[_0x37c2db(0x18a)]);if(_0x4ba4ee){_0x4ba4ee[_0x37c2db(0x197)]=_0x5d7e39['fullPath'],_0x4ba4ee[_0x37c2db(0x1a4)]=_0x3e2da4,_0x4ba4ee[_0x37c2db(0x1a1)]=_0x27f58c,_0x4ba4ee[_0x37c2db(0x18d)]=_0x39bea9;return;}this[_0x37c2db(0x198)][_0x37c2db(0x19a)]({'path':_0x5d7e39['path'],'fullPath':_0x5d7e39[_0x37c2db(0x197)],'title':_0x3e2da4,'name':_0x5d7e39[_0x37c2db(0x18e)],'componentName':_0x27f58c,'keepAlive':_0x39bea9});},'addCache'(_0x34e0f7){const _0x2132bd=_0x322d34;if(!_0x34e0f7||this[_0x2132bd(0x1a6)][_0x2132bd(0x19c)](_0x34e0f7))return;this['caches'][_0x2132bd(0x19a)](_0x34e0f7);},'removeCache'(_0xef68b2){const _0x2fba10=_0x322d34;if(!_0xef68b2)return;this[_0x2fba10(0x1a6)]=this[_0x2fba10(0x1a6)]['filter'](_0x193634=>_0x193634!==_0xef68b2);},'remove'(_0x221ba6){const _0x527b79=_0x322d34,_0x17e3d0=this[_0x527b79(0x198)][_0x527b79(0x190)](_0x4cadc2=>_0x4cadc2[_0x527b79(0x18a)]===_0x221ba6);if(_0x17e3d0<0x0)return;const [_0x5df98b]=this['list'][_0x527b79(0x1a8)](_0x17e3d0,0x1),_0x984ec8=_0x5df98b?.[_0x527b79(0x1a1)]&&this[_0x527b79(0x198)]['some'](_0x24964f=>_0x24964f[_0x527b79(0x1a1)]===_0x5df98b[_0x527b79(0x1a1)]);_0x5df98b?.[_0x527b79(0x1a1)]&&!_0x984ec8&&this['removeCache'](_0x5df98b[_0x527b79(0x1a1)]);},'closeOthers'(_0x48451e){const _0x1362dd=_0x322d34,_0xb2f57=this[_0x1362dd(0x198)][_0x1362dd(0x1a5)](_0x5225d3=>_0x5225d3[_0x1362dd(0x18a)]===_0x48451e||_0x5225d3[_0x1362dd(0x18a)]==='/');this['list']=_0xb2f57,this[_0x1362dd(0x1a6)]=_0xb2f57[_0x1362dd(0x1a5)](_0x4e5a5a=>_0x4e5a5a[_0x1362dd(0x18d)]&&_0x4e5a5a[_0x1362dd(0x1a1)])[_0x1362dd(0x19d)](_0x57052c=>_0x57052c[_0x1362dd(0x1a1)])[_0x1362dd(0x1a5)]((_0x4af5a0,_0x4972c2,_0x59295b)=>_0x59295b[_0x1362dd(0x196)](_0x4af5a0)===_0x4972c2);},'clear'(){const _0x1daeab=_0x322d34;this[_0x1daeab(0x198)]=this[_0x1daeab(0x198)]['filter'](_0x182535=>_0x182535[_0x1daeab(0x18a)]==='/'),this[_0x1daeab(0x1a6)]=[];}}});
@@ -1 +1,64 @@
1
- const _0x30e587=_0x46f7;(function(_0x464f57,_0x1a3b67){const _0x582476=_0x46f7,_0x2cc5ee=_0x464f57();while(!![]){try{const _0x26eab8=parseInt(_0x582476(0x110))/0x1*(parseInt(_0x582476(0x106))/0x2)+-parseInt(_0x582476(0x109))/0x3+-parseInt(_0x582476(0x103))/0x4+-parseInt(_0x582476(0x113))/0x5*(parseInt(_0x582476(0x10e))/0x6)+-parseInt(_0x582476(0x114))/0x7*(-parseInt(_0x582476(0x101))/0x8)+parseInt(_0x582476(0x107))/0x9+-parseInt(_0x582476(0x10a))/0xa;if(_0x26eab8===_0x1a3b67)break;else _0x2cc5ee['push'](_0x2cc5ee['shift']());}catch(_0x20c3ee){_0x2cc5ee['push'](_0x2cc5ee['shift']());}}}(_0x52d8,0x552da));import{defineStore}from'pinia';function _0x46f7(_0x343e69,_0x470e9d){_0x343e69=_0x343e69-0x101;const _0x52d8eb=_0x52d8();let _0x46f70e=_0x52d8eb[_0x343e69];if(_0x46f7['ThZYXh']===undefined){var _0x3c2713=function(_0x43f4be){const _0x376190='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x5c22cc='',_0x549de4='';for(let _0x407ccc=0x0,_0x53e677,_0x53109b,_0x1645bd=0x0;_0x53109b=_0x43f4be['charAt'](_0x1645bd++);~_0x53109b&&(_0x53e677=_0x407ccc%0x4?_0x53e677*0x40+_0x53109b:_0x53109b,_0x407ccc++%0x4)?_0x5c22cc+=String['fromCharCode'](0xff&_0x53e677>>(-0x2*_0x407ccc&0x6)):0x0){_0x53109b=_0x376190['indexOf'](_0x53109b);}for(let _0x2bf9ba=0x0,_0x1a6159=_0x5c22cc['length'];_0x2bf9ba<_0x1a6159;_0x2bf9ba++){_0x549de4+='%'+('00'+_0x5c22cc['charCodeAt'](_0x2bf9ba)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x549de4);};_0x46f7['ptJXoa']=_0x3c2713,_0x46f7['VoLTra']={},_0x46f7['ThZYXh']=!![];}const _0x504f7c=_0x52d8eb[0x0],_0x132e81=_0x343e69+_0x504f7c,_0x5e177c=_0x46f7['VoLTra'][_0x132e81];return!_0x5e177c?(_0x46f70e=_0x46f7['ptJXoa'](_0x46f70e),_0x46f7['VoLTra'][_0x132e81]=_0x46f70e):_0x46f70e=_0x5e177c,_0x46f70e;}import{api,clearTokens}from'../api/client';import{filterShowMenus}from'../lib/menu';import{setServicePerms}from'../service';function _0x52d8(){const _0x23dbf9=['nda2nJKZveDiq1PT','ywrTAw5jza','odH5zfnezwO','BwvUDxm','nZC3otKYturivwfc','DxnLCG','Bg9HzgvK','mK5Vwe12qq','mtC1otK5nxDAqxv1zW','ywrTAw4J','mZm4nZz1q1zLBvq','ndq3nJy2mgftww9wzG','AxnbCNjHEq','DxnLCM5HBwu','CgvYBxm','mteXntiYv1fHv2nt','AxntDxbLCG','nda5mZmZy0TzCwnx','C29Tzq','Aw5JBhvKzxm','nJvvrhzLBxq'];_0x52d8=function(){return _0x23dbf9;};return _0x52d8();}export const useUserStore=defineStore(_0x30e587(0x104),{'state':()=>({'adminId':0x0,'username':'','isSuper':![],'perms':[],'menus':[],'loaded':![]}),'getters':{'navMenus'(_0x5c22cc){return filterShowMenus(_0x5c22cc['menus']);}},'actions':{async 'load'(){const _0x121afe=_0x30e587,[_0x549de4,_0x407ccc]=await Promise['all']([api['me']({'toast':![]}),api[_0x121afe(0x10d)]({'toast':![]})]);this[_0x121afe(0x115)]=_0x549de4[_0x121afe(0x115)],this[_0x121afe(0x10c)]=_0x549de4[_0x121afe(0x10c)]||_0x121afe(0x108)+_0x549de4[_0x121afe(0x115)],this[_0x121afe(0x10f)]=_0x407ccc[_0x121afe(0x10f)],this[_0x121afe(0x10d)]=Array[_0x121afe(0x10b)](_0x407ccc[_0x121afe(0x10d)])?_0x407ccc[_0x121afe(0x10d)]:[],this[_0x121afe(0x102)]=Array[_0x121afe(0x10b)](_0x407ccc[_0x121afe(0x102)])?_0x407ccc['menus']:[],this[_0x121afe(0x105)]=!![],setServicePerms(this[_0x121afe(0x10d)],this[_0x121afe(0x10f)]);},async 'reloadMenus'(){const _0xf86f66=_0x30e587,_0x53e677=await api['perms']({'toast':![]});this[_0xf86f66(0x10f)]=_0x53e677[_0xf86f66(0x10f)],this[_0xf86f66(0x10d)]=Array[_0xf86f66(0x10b)](_0x53e677[_0xf86f66(0x10d)])?_0x53e677[_0xf86f66(0x10d)]:[],this[_0xf86f66(0x102)]=Array['isArray'](_0x53e677[_0xf86f66(0x102)])?_0x53e677[_0xf86f66(0x102)]:[],setServicePerms(this[_0xf86f66(0x10d)],this['isSuper']);},'hasPerm'(_0x53109b){const _0x56c700=_0x30e587;if(this[_0x56c700(0x10f)])return!![];const _0x1645bd=Array[_0x56c700(0x10b)](_0x53109b)?_0x53109b:[_0x53109b];return _0x1645bd[_0x56c700(0x111)](_0x2bf9ba=>this[_0x56c700(0x10d)][_0x56c700(0x112)](_0x2bf9ba));},'logout'(){clearTokens(),this['$reset']();}}});
1
+ import { defineStore } from "pinia";
2
+ import { api, clearTokens } from "../api/client";
3
+ import { filterShowMenus } from "../lib/menu";
4
+ import { setServicePerms } from "../service";
5
+ let loadFlight = null;
6
+ export const useUserStore = defineStore("user", {
7
+ state: () => ({
8
+ adminId: 0,
9
+ username: "",
10
+ isSuper: false,
11
+ perms: [],
12
+ menus: [],
13
+ loaded: false
14
+ }),
15
+ getters: {
16
+ navMenus(state) {
17
+ return filterShowMenus(state.menus);
18
+ }
19
+ },
20
+ actions: {
21
+ async load() {
22
+ if (this.loaded)
23
+ return;
24
+ if (loadFlight)
25
+ return loadFlight;
26
+ loadFlight = (async () => {
27
+ try {
28
+ const [me, authz] = await Promise.all([
29
+ api.me({ toast: false }),
30
+ api.perms({ toast: false })
31
+ ]);
32
+ this.adminId = me.adminId;
33
+ this.username = me.username || `admin#${me.adminId}`;
34
+ this.isSuper = authz.isSuper;
35
+ this.perms = Array.isArray(authz.perms) ? authz.perms : [];
36
+ this.menus = Array.isArray(authz.menus) ? authz.menus : [];
37
+ this.loaded = true;
38
+ setServicePerms(this.perms, this.isSuper);
39
+ } finally {
40
+ loadFlight = null;
41
+ }
42
+ })();
43
+ return loadFlight;
44
+ },
45
+ async reloadMenus() {
46
+ const authz = await api.perms({ toast: false });
47
+ this.isSuper = authz.isSuper;
48
+ this.perms = Array.isArray(authz.perms) ? authz.perms : [];
49
+ this.menus = Array.isArray(authz.menus) ? authz.menus : [];
50
+ setServicePerms(this.perms, this.isSuper);
51
+ },
52
+ hasPerm(code) {
53
+ if (this.isSuper)
54
+ return true;
55
+ const codes = Array.isArray(code) ? code : [code];
56
+ return codes.some((c) => this.perms.includes(c));
57
+ },
58
+ logout() {
59
+ clearTokens();
60
+ loadFlight = null;
61
+ this.$reset();
62
+ }
63
+ }
64
+ });