@arkxos/arkos-core 0.1.0
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.
- package/README.md +36 -0
- package/ark_dist/ark-meta.json +45 -0
- package/ark_dist/css/370.fbd21c4a.css +65 -0
- package/ark_dist/index.html +23 -0
- package/ark_dist/js/370.b7feb826.js +3 -0
- package/ark_dist/js/370.b7feb826.js.LICENSE.txt +16 -0
- package/ark_dist/js/370.b7feb826.js.map +1 -0
- package/ark_dist/js/app.87081276.js +1 -0
- package/ark_proxy/entry.js +48 -0
- package/ark_proxy_es/entry.js +18 -0
- package/package.json +114 -0
- package/scripts/check.js +13 -0
- package/scripts/meta.js +21 -0
- package/scripts/prepublishOnly.js +28 -0
- package/src/App.vue +25 -0
- package/src/access/tokenStorage.ts +10 -0
- package/src/api/index.js +13 -0
- package/src/api/model/auth.js +88 -0
- package/src/api/model/common.js +49 -0
- package/src/api/model/demo.js +56 -0
- package/src/api/model/system.js +114 -0
- package/src/api/systemApi.js +16 -0
- package/src/assets/logo.png +0 -0
- package/src/components/HelloWorld.vue +40 -0
- package/src/components/index.ts +12 -0
- package/src/configs/subApp.ts +9 -0
- package/src/core/api/http.ts +490 -0
- package/src/core/apitest/axios_config.js +10 -0
- package/src/core/apitest/index.js +10 -0
- package/src/core/apitest/mock/user.js +10 -0
- package/src/core/config/index.js +84 -0
- package/src/core/config/myConfig.js +14 -0
- package/src/core/i18n/i18nBuilder.ts +41 -0
- package/src/core/puzzle/readme.txt +4 -0
- package/src/core/router/router.js +80 -0
- package/src/core/system.ts +312 -0
- package/src/directive/authDirective.ts +61 -0
- package/src/directive/index.ts +16 -0
- package/src/entrance/libProperties.ts +57 -0
- package/src/entrance/libTypes.ts +47 -0
- package/src/enums/LanguageEnum.ts +5 -0
- package/src/hooks/message.ts +81 -0
- package/src/lang/en_US.ts +28 -0
- package/src/lang/index.ts +73 -0
- package/src/lang/zh_CN.ts +27 -0
- package/src/loadApp.ts +4 -0
- package/src/main.ts +16 -0
- package/src/plugins/access.ts +88 -0
- package/src/plugins/accessPlugin.ts +76 -0
- package/src/plugins/acl/index.js +24 -0
- package/src/plugins/priv.ts +23 -0
- package/src/shims-vue.d.ts +6 -0
- package/src/store/index.ts +22 -0
- package/src/store/modules/systemStore.ts +31 -0
- package/src/types/axios.d.ts +13 -0
- package/src/types/func.ts +14 -0
- package/src/types/global.d.ts +108 -0
- package/src/types/layout.d.ts +59 -0
- package/src/types/mitt.d.ts +42 -0
- package/src/types/pinia.d.ts +94 -0
- package/src/types/views.d.ts +27 -0
- package/src/utils/mitt.ts +8 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("ArkLibProxy"),require("ArkMicro"),require("ElementPlus"),require("Pinia"),require("Vue"),require("VueI18n"),require("VueRouter"),require("axios"),require("piniaPluginPersistedstate")):"function"==typeof define&&define.amd?define(["ArkLibProxy","ArkMicro","ElementPlus","Pinia","Vue","VueI18n","VueRouter","axios","piniaPluginPersistedstate"],r):"object"==typeof exports?exports["@arkxos/arkos-core"]=r(require("ArkLibProxy"),require("ArkMicro"),require("ElementPlus"),require("Pinia"),require("Vue"),require("VueI18n"),require("VueRouter"),require("axios"),require("piniaPluginPersistedstate")):e["@arkxos/arkos-core"]=r(e.ArkLibProxy,e.ArkMicro,e.ElementPlus,e.Pinia,e.Vue,e.VueI18n,e.VueRouter,e.axios,e.piniaPluginPersistedstate)}(self,(function(e,r,t,n,o,i,u,a,s){return function(){"use strict";var c,f,l={8655:function(r){r.exports=e},9562:function(e){e.exports=r},6842:function(e){e.exports=t},7713:function(e){e.exports=n},2740:function(e){e.exports=o},5425:function(e){e.exports=i},7088:function(e){e.exports=u},3300:function(e){e.exports=a},1275:function(e){e.exports=s}},d={};function p(e){var r=d[e];if(void 0!==r)return r.exports;var t=d[e]={exports:{}};return l[e].call(t.exports,t,t.exports,p),t.exports}p.m=l,p.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return p.d(r,{a:r}),r},p.d=function(e,r){for(var t in r)p.o(r,t)&&!p.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},p.f={},p.e=function(e){return Promise.all(Object.keys(p.f).reduce((function(r,t){return p.f[t](e,r),r}),[]))},p.u=function(e){return"js/"+e+".b7feb826.js"},p.miniCssF=function(e){return"css/"+e+".fbd21c4a.css"},p.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),p.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},c={},f="@arkxos/arkos-core:",p.l=function(e,r,t,n){if(c[e])c[e].push(r);else{var o,i;if(void 0!==t)for(var u=document.getElementsByTagName("script"),a=0;a<u.length;a++){var s=u[a];if(s.getAttribute("src")==e||s.getAttribute("data-webpack")==f+t){o=s;break}}o||(i=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,p.nc&&o.setAttribute("nonce",p.nc),o.setAttribute("data-webpack",f+t),o.src=e),c[e]=[r];var l=function(r,t){o.onerror=o.onload=null,clearTimeout(d);var n=c[e];if(delete c[e],o.parentNode&&o.parentNode.removeChild(o),n&&n.forEach((function(e){return e(t)})),r)return r(t)},d=setTimeout(l.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=l.bind(null,o.onerror),o.onload=l.bind(null,o.onload),i&&document.head.appendChild(o)}},p.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},p.p=window.ArkConfig.cdnHost+"/@arkxos/arkos-core@0.1.0/ark_dist/",function(){if("undefined"!=typeof document){var e={143:0};p.f.miniCss=function(r,t){e[r]?t.push(e[r]):0!==e[r]&&{370:1}[r]&&t.push(e[r]=function(e){return new Promise((function(r,t){var n=p.miniCssF(e),o=p.p+n;if(function(e,r){for(var t=document.getElementsByTagName("link"),n=0;n<t.length;n++){var o=(u=t[n]).getAttribute("data-href")||u.getAttribute("href");if("stylesheet"===u.rel&&(o===e||o===r))return u}var i=document.getElementsByTagName("style");for(n=0;n<i.length;n++){var u;if((o=(u=i[n]).getAttribute("data-href"))===e||o===r)return u}}(n,o))return r();!function(e,r,t,n,o){var i=document.createElement("link");i.rel="stylesheet",i.type="text/css",p.nc&&(i.nonce=p.nc),i.onerror=i.onload=function(t){if(i.onerror=i.onload=null,"load"===t.type)n();else{var u=t&&t.type,a=t&&t.target&&t.target.href||r,s=new Error("Loading CSS chunk "+e+" failed.\n("+u+": "+a+")");s.name="ChunkLoadError",s.code="CSS_CHUNK_LOAD_FAILED",s.type=u,s.request=a,i.parentNode&&i.parentNode.removeChild(i),o(s)}},i.href=r,document.head.appendChild(i)}(e,o,0,r,t)}))}(r).then((function(){e[r]=0}),(function(t){throw delete e[r],t})))}}}(),function(){var e={143:0};p.f.j=function(r,t){var n=p.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else{var o=new Promise((function(t,o){n=e[r]=[t,o]}));t.push(n[2]=o);var i=p.p+p.u(r),u=new Error;p.l(i,(function(t){if(p.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var o=t&&("load"===t.type?"missing":t.type),i=t&&t.target&&t.target.src;u.message="Loading chunk "+r+" failed.\n("+o+": "+i+")",u.name="ChunkLoadError",u.type=o,u.request=i,n[1](u)}}),"chunk-"+r,r)}};var r=function(r,t){var n,o,i=t[0],u=t[1],a=t[2],s=0;if(i.some((function(r){return 0!==e[r]}))){for(n in u)p.o(u,n)&&(p.m[n]=u[n]);a&&a(p)}for(r&&r(t);s<i.length;s++)o=i[s],p.o(e,o)&&e[o]&&e[o][0](),e[o]=0},t=self["helJsonp_@arkxos/arkos-core_1748878811696"]=self["helJsonp_@arkxos/arkos-core_1748878811696"]||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))}();var m={};return function(){p.r(m);var e=p(8655);(async function(){const r=await p.e(370).then(p.bind(p,6370));(0,e.libReady)("@arkxos/arkos-core",r.default)})().catch(console.error)}(),m}()}));
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
(function (global, factory) {
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@arkxio/ark-lib-proxy')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', '@arkxio/ark-lib-proxy'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@arkxos/arkos-core"] = {}, global.arkLibProxy));
|
|
5
|
+
})(this, (function (exports, arkLibProxy) { 'use strict';
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
|--------------------------------------------------------------------------
|
|
9
|
+
|
|
|
10
|
+
| 对应 package.json/appGroupName
|
|
11
|
+
|
|
|
12
|
+
|--------------------------------------------------------------------------
|
|
13
|
+
*/
|
|
14
|
+
const LIB_NAME = '@arkxos/arkos-core';
|
|
15
|
+
|
|
16
|
+
const lib = arkLibProxy.exposeLib(LIB_NAME);
|
|
17
|
+
// suport writing: import { regs, num, myMod } from 'hel-tpl-remote-lib';
|
|
18
|
+
const { system, installPlugin, access, accessPlugin, router, store, systemStore, request, http, globalHeaders, config, api, getToken, setToken, removeToken, LanguageEnum, i18n, i18nBuilder, emitter,
|
|
19
|
+
// message
|
|
20
|
+
useMessage, useMessageBox } = lib;
|
|
21
|
+
|
|
22
|
+
exports.LanguageEnum = LanguageEnum;
|
|
23
|
+
exports.access = access;
|
|
24
|
+
exports.accessPlugin = accessPlugin;
|
|
25
|
+
exports.api = api;
|
|
26
|
+
exports.config = config;
|
|
27
|
+
exports["default"] = lib;
|
|
28
|
+
exports.emitter = emitter;
|
|
29
|
+
exports.getToken = getToken;
|
|
30
|
+
exports.globalHeaders = globalHeaders;
|
|
31
|
+
exports.http = http;
|
|
32
|
+
exports.i18n = i18n;
|
|
33
|
+
exports.i18nBuilder = i18nBuilder;
|
|
34
|
+
exports.installPlugin = installPlugin;
|
|
35
|
+
exports.lib = lib;
|
|
36
|
+
exports.removeToken = removeToken;
|
|
37
|
+
exports.request = request;
|
|
38
|
+
exports.router = router;
|
|
39
|
+
exports.setToken = setToken;
|
|
40
|
+
exports.store = store;
|
|
41
|
+
exports.system = system;
|
|
42
|
+
exports.systemStore = systemStore;
|
|
43
|
+
exports.useMessage = useMessage;
|
|
44
|
+
exports.useMessageBox = useMessageBox;
|
|
45
|
+
|
|
46
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
47
|
+
|
|
48
|
+
}));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { exposeLib } from '@arkxio/ark-lib-proxy';
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
|--------------------------------------------------------------------------
|
|
5
|
+
|
|
|
6
|
+
| 对应 package.json/appGroupName
|
|
7
|
+
|
|
|
8
|
+
|--------------------------------------------------------------------------
|
|
9
|
+
*/
|
|
10
|
+
const LIB_NAME = '@arkxos/arkos-core';
|
|
11
|
+
|
|
12
|
+
const lib = exposeLib(LIB_NAME);
|
|
13
|
+
// suport writing: import { regs, num, myMod } from 'hel-tpl-remote-lib';
|
|
14
|
+
const { system, installPlugin, access, accessPlugin, router, store, systemStore, request, http, globalHeaders, config, api, getToken, setToken, removeToken, LanguageEnum, i18n, i18nBuilder, emitter,
|
|
15
|
+
// message
|
|
16
|
+
useMessage, useMessageBox } = lib;
|
|
17
|
+
|
|
18
|
+
export { LanguageEnum, access, accessPlugin, api, config, lib as default, emitter, getToken, globalHeaders, http, i18n, i18nBuilder, installPlugin, lib, removeToken, request, router, setToken, store, system, systemStore, useMessage, useMessageBox };
|
package/package.json
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@arkxos/arkos-core",
|
|
3
|
+
"appGroupName": "@arkxos/arkos-core",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"main": "ark_proxy/entry.js",
|
|
6
|
+
"module": "ark_proxy_es/entry.js",
|
|
7
|
+
"types": "src/entrance/libTypes.ts",
|
|
8
|
+
"unpkg": "ark_dist/entry.js",
|
|
9
|
+
"files": [
|
|
10
|
+
"ark_dist",
|
|
11
|
+
"ark_proxy",
|
|
12
|
+
"ark_proxy_es",
|
|
13
|
+
"scripts",
|
|
14
|
+
"README.md",
|
|
15
|
+
"src"
|
|
16
|
+
],
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@arkxio/ark-iso": "0.1.1",
|
|
19
|
+
"@arkxos/arkos-util": "^0.1.0",
|
|
20
|
+
"core-js": "3.8.3",
|
|
21
|
+
"js-cookie": "3.0.1",
|
|
22
|
+
"dayjs": "1.11.9",
|
|
23
|
+
"file-saver": "2.0.5",
|
|
24
|
+
"@babel/runtime": "7.20.1",
|
|
25
|
+
"@element-plus/icons-vue": "2.3.1",
|
|
26
|
+
"@tinymce/tinymce-vue": "5.0.0",
|
|
27
|
+
"codemirror": "5.65.5",
|
|
28
|
+
"commander": "11.0.0",
|
|
29
|
+
"cropperjs": "1.5.13",
|
|
30
|
+
"cross-env": "7.0.3",
|
|
31
|
+
"crypto-js": "4.1.1",
|
|
32
|
+
"echarts": "5.4.1",
|
|
33
|
+
"loadjs": "4.2.0",
|
|
34
|
+
"lodash": "4.17.21",
|
|
35
|
+
"minireset.css": "0.0.7",
|
|
36
|
+
"mockjs": "1.1.0",
|
|
37
|
+
"moment": "2.29.4",
|
|
38
|
+
"nprogress": "0.2.0",
|
|
39
|
+
"process": "0.11.10",
|
|
40
|
+
"qrcodejs2": "0.0.2",
|
|
41
|
+
"sortablejs": "1.15.0",
|
|
42
|
+
"tinymce": "6.3.2",
|
|
43
|
+
"vue-simple-acl": "2.0.2",
|
|
44
|
+
"xgplayer": "2.32.2",
|
|
45
|
+
"xgplayer-hls": "2.5.2",
|
|
46
|
+
"@vueuse/core": "10.7.0",
|
|
47
|
+
"qs": "^6.10.1",
|
|
48
|
+
"mitt": "3.0.1"
|
|
49
|
+
},
|
|
50
|
+
"arkDependencies": {
|
|
51
|
+
"@arkxos/arkos-util": "1.0.200"
|
|
52
|
+
},
|
|
53
|
+
"peerDependencies": {
|
|
54
|
+
"@arkxio/ark-lib-proxy": "0.1.1",
|
|
55
|
+
"@arkxio/ark-micro": "0.1.1",
|
|
56
|
+
"vue-router": "4.4.5",
|
|
57
|
+
"vue-i18n": "9.8.0",
|
|
58
|
+
"axios": "^1.8.0",
|
|
59
|
+
"core-js": "3.8.3",
|
|
60
|
+
"vue": "3.5.12",
|
|
61
|
+
"pinia": "2.2.4",
|
|
62
|
+
"pinia-plugin-persistedstate": "^3.2.1",
|
|
63
|
+
"element-plus": "^2.8.5"
|
|
64
|
+
},
|
|
65
|
+
"devDependencies": {
|
|
66
|
+
"@arkxio/ark-dev-utils": "0.1.1",
|
|
67
|
+
"@rollup/plugin-typescript": "9.0.1",
|
|
68
|
+
"@types/jest": "27.0.1",
|
|
69
|
+
"@typescript-eslint/eslint-plugin": "5.4.0",
|
|
70
|
+
"@typescript-eslint/parser": "5.4.0",
|
|
71
|
+
"@vue/cli-plugin-babel": "~5.0.0",
|
|
72
|
+
"@vue/cli-plugin-eslint": "~5.0.0",
|
|
73
|
+
"@vue/cli-plugin-typescript": "~5.0.0",
|
|
74
|
+
"@vue/cli-plugin-unit-jest": "~5.0.0",
|
|
75
|
+
"@vue/cli-service": "~5.0.0",
|
|
76
|
+
"@vue/eslint-config-standard": "6.1.0",
|
|
77
|
+
"@vue/eslint-config-typescript": "9.1.0",
|
|
78
|
+
"@vue/test-utils": "2.4.6",
|
|
79
|
+
"@vue/vue3-jest": "27.0.0-alpha.1",
|
|
80
|
+
"babel-jest": "27.0.6",
|
|
81
|
+
"chalk": "4.0.0",
|
|
82
|
+
"cross-env": "7.0.3",
|
|
83
|
+
"eslint": "7.32.0",
|
|
84
|
+
"eslint-plugin-import": "2.25.3",
|
|
85
|
+
"eslint-plugin-node": "11.1.0",
|
|
86
|
+
"eslint-plugin-promise": "5.1.0",
|
|
87
|
+
"eslint-plugin-vue": "8.0.3",
|
|
88
|
+
"jest": "27.0.5",
|
|
89
|
+
"rollup": "2.79.1",
|
|
90
|
+
"rollup-plugin-terser": "7.0.2",
|
|
91
|
+
"ts-jest": "27.0.4",
|
|
92
|
+
"typescript": "5.6.2",
|
|
93
|
+
"vue-cli-plugin-vite": "~1.5.0"
|
|
94
|
+
},
|
|
95
|
+
"publishConfig": {
|
|
96
|
+
"access": "public",
|
|
97
|
+
"registry": "https://registry.npmjs.org/"
|
|
98
|
+
},
|
|
99
|
+
"scripts": {
|
|
100
|
+
"start": "cross-env PORT=7004 vue-cli-service serve",
|
|
101
|
+
"start:vite": "node ./bin/vite",
|
|
102
|
+
"build": "npm run check_name && npm run build_dist && npm run build_meta && npm run build_proxy",
|
|
103
|
+
"build_dist": "vue-cli-service build",
|
|
104
|
+
"check_name": "node ./scripts/check.js",
|
|
105
|
+
"build_proxy": "npm run build_proxy_umd && npm run build_proxy_es && cp ./ark_proxy/entry.js ./ark_dist",
|
|
106
|
+
"build_proxy_umd": "rollup -c",
|
|
107
|
+
"build_proxy_es": "cross-env BUILD_ENV=es rollup -c",
|
|
108
|
+
"build_cust": "npm run set_home_page \"npm run build && npm run build_meta\"",
|
|
109
|
+
"set_home_page": "cross-env-shell HEL_APP_HOME_PAGE=http://127.0.0.1:9001",
|
|
110
|
+
"build_meta": "node scripts/meta.js",
|
|
111
|
+
"test:unit": "vue-cli-service test:unit",
|
|
112
|
+
"lint": "vue-cli-service lint"
|
|
113
|
+
}
|
|
114
|
+
}
|
package/scripts/check.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
|--------------------------------------------------------------------------
|
|
3
|
+
|
|
|
4
|
+
| 此脚本在流水线上会被触发,用于校验组名是否和应用里的组名保持一致
|
|
5
|
+
|
|
|
6
|
+
|--------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
const path = require('path');
|
|
9
|
+
const arkDevUtils = require('@arkxio/ark-dev-utils');
|
|
10
|
+
const pkg = require('../package.json');
|
|
11
|
+
|
|
12
|
+
const fileFullPath = path.join(__dirname, '../src/configs/subApp');
|
|
13
|
+
arkDevUtils.check(pkg, { fileFullPath, checkEnv: false });
|
package/scripts/meta.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
|--------------------------------------------------------------------------
|
|
3
|
+
|
|
|
4
|
+
| 生成meta
|
|
5
|
+
|
|
|
6
|
+
|--------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
const process = require('process');
|
|
9
|
+
const path = require('path');
|
|
10
|
+
const arkDevUtils = require('@arkxio/ark-dev-utils');
|
|
11
|
+
const packageJson = require('../package.json');
|
|
12
|
+
const appInfo = require('../appInfo');
|
|
13
|
+
|
|
14
|
+
// arkDevUtils.extractArkMetaJson({
|
|
15
|
+
// subApp: appInfo,
|
|
16
|
+
// buildDirFullPath: path.join(__dirname, '../ark_dist'),
|
|
17
|
+
// packageJson,
|
|
18
|
+
// }).catch(err => {
|
|
19
|
+
// console.error(err);
|
|
20
|
+
// process.exit(-1);
|
|
21
|
+
// });
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*
|
|
2
|
+
|--------------------------------------------------------------------------
|
|
3
|
+
| npm publush 前检查根目录下 package.json 的版本号是否和 ark_dist/ark-meta.json 一致
|
|
4
|
+
|--------------------------------------------------------------------------
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
const chalk = require("chalk");
|
|
8
|
+
const pkg = require("../package.json");
|
|
9
|
+
const fs = require("fs");
|
|
10
|
+
const path = require("path");
|
|
11
|
+
const helDistPath = path.resolve(__dirname, "../ark_dist/ark-meta.json");
|
|
12
|
+
const existHelMeata = fs.existsSync(helDistPath);
|
|
13
|
+
|
|
14
|
+
// 检查是否执行npm run build 打包命令
|
|
15
|
+
if (!existHelMeata) {
|
|
16
|
+
console.log(chalk.red("Run the 'npm run build' command first.\n"));
|
|
17
|
+
process.exit(1);
|
|
18
|
+
}
|
|
19
|
+
const { app } = JSON.parse(fs.readFileSync(helDistPath, "utf-8"));
|
|
20
|
+
// 检查根目录下 package.json 的版本号是否和 ark_dist/ark-meta.json 一致
|
|
21
|
+
if (app?.build_version !== pkg.version) {
|
|
22
|
+
console.log(
|
|
23
|
+
chalk.red(
|
|
24
|
+
"The package.json version number and the ark_dist/ark-meta.json version number must be the same.\n"
|
|
25
|
+
)
|
|
26
|
+
);
|
|
27
|
+
process.exit(1);
|
|
28
|
+
}
|
package/src/App.vue
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<HelloWorld msg="Welcome to Your Vue.js + TypeScript + hel-micro App"/>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script lang="ts">
|
|
6
|
+
import { defineComponent } from 'vue'
|
|
7
|
+
import HelloWorld from './components/HelloWorld.vue'
|
|
8
|
+
|
|
9
|
+
export default defineComponent({
|
|
10
|
+
name: 'App',
|
|
11
|
+
components: {
|
|
12
|
+
HelloWorld
|
|
13
|
+
}
|
|
14
|
+
})
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<style>
|
|
18
|
+
#app {
|
|
19
|
+
font-family: Avenir, Helvetica, Arial, sans-serif;
|
|
20
|
+
-webkit-font-smoothing: antialiased;
|
|
21
|
+
-moz-osx-font-smoothing: grayscale;
|
|
22
|
+
text-align: center;
|
|
23
|
+
color: #2c3e50;
|
|
24
|
+
}
|
|
25
|
+
</style>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { tool } from '@arkxos/arkos-util'
|
|
2
|
+
|
|
3
|
+
const TokenKey = 'Ark-Token';
|
|
4
|
+
|
|
5
|
+
// const tokenStorage = useStorage<null | string>(TokenKey, null);
|
|
6
|
+
|
|
7
|
+
export const getToken = () => tool.cookie.get(TokenKey);
|
|
8
|
+
|
|
9
|
+
export const setToken = (access_token: string, config?: any) => tool.cookie.set(TokenKey, access_token, config);
|
|
10
|
+
export const removeToken = () => tool.cookie.set(TokenKey, '');
|
package/src/api/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description 自动import导入所有 api 模块
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
const files = require.context('./model', false, /\.js$/)
|
|
6
|
+
const modules = {}
|
|
7
|
+
files.keys().forEach((key) => {
|
|
8
|
+
modules[key.replace(/(\.\/|\.js)/g, '')] = files(key).default
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
...modules
|
|
13
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import http from '../../core/api/http'
|
|
2
|
+
import config from '../../core/config'
|
|
3
|
+
import * as CryptoJS from 'crypto-js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* https://www.ietf.org/rfc/rfc6749.txt
|
|
7
|
+
* OAuth 协议 4.3.1 要求格式为 form 而不是 JSON 注意!
|
|
8
|
+
*/
|
|
9
|
+
const FORM_CONTENT_TYPE = 'application/x-www-form-urlencoded';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
*加密处理
|
|
13
|
+
*/
|
|
14
|
+
export function encryption(src, keyWord) {
|
|
15
|
+
const key = CryptoJS.enc.Utf8.parse(keyWord);
|
|
16
|
+
// 加密
|
|
17
|
+
const encrypted = CryptoJS.AES.encrypt(src, key, {
|
|
18
|
+
iv: key,
|
|
19
|
+
mode: CryptoJS.mode.CFB,
|
|
20
|
+
padding: CryptoJS.pad.NoPadding,
|
|
21
|
+
});
|
|
22
|
+
return encrypted.toString();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default {
|
|
26
|
+
token: {
|
|
27
|
+
url: '/auth/oauth2/token',
|
|
28
|
+
name: '登录获取TOKEN',
|
|
29
|
+
post: async function (data = {}) {
|
|
30
|
+
const basicAuth = 'Basic ' + window.btoa('arkos:rapidark');
|
|
31
|
+
const headers = Object.assign({
|
|
32
|
+
skipToken: true,
|
|
33
|
+
Authorization: basicAuth,
|
|
34
|
+
'Content-Type': FORM_CONTENT_TYPE,
|
|
35
|
+
isEncrypt: false
|
|
36
|
+
}, window.Arkos.api?.login?.headers || {})
|
|
37
|
+
|
|
38
|
+
window.Arkos.api?.login?.beforePost(data)
|
|
39
|
+
|
|
40
|
+
data.password = encryption(data.password, 'welcome-2-arkxos')
|
|
41
|
+
|
|
42
|
+
return await http.post(this.url, data, {
|
|
43
|
+
headers: headers
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
logout: {
|
|
48
|
+
url: '/auth/logout',
|
|
49
|
+
name: '登录获取TOKEN',
|
|
50
|
+
post: async function (data = {}) {
|
|
51
|
+
return await http.delete(this.url, data, {
|
|
52
|
+
headers: {
|
|
53
|
+
skipToken: true
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
register: {
|
|
59
|
+
url: '/auth/register',
|
|
60
|
+
name: '注册',
|
|
61
|
+
post: async function (data = {}) {
|
|
62
|
+
return await http.post(this.url, data, {
|
|
63
|
+
headers: {
|
|
64
|
+
skipToken: true
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
account: {
|
|
70
|
+
url: '/admin/user/currentUserInfo',
|
|
71
|
+
name: '获取账户信息',
|
|
72
|
+
post: async function (data = {}) {
|
|
73
|
+
return await http.get(this.url, data).catch(e => console.log(e));
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
// 获取验证码
|
|
77
|
+
getCodeImg: {
|
|
78
|
+
url: window.Arkos.api.captcha.url || '/code',
|
|
79
|
+
name: '获取账户信息',
|
|
80
|
+
post: async function (data = {}) {
|
|
81
|
+
return await http.get(this.url, data, {
|
|
82
|
+
headers: {
|
|
83
|
+
skipToken: true
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import http from '../../core/api/http'
|
|
2
|
+
import config from '../../core/config'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
upload: {
|
|
6
|
+
url: '/upload',
|
|
7
|
+
name: '文件上传',
|
|
8
|
+
post: async function (data, config = {}) {
|
|
9
|
+
return await http.post(this.url, data, config);
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
uploadFile: {
|
|
13
|
+
url: '/uploadFile',
|
|
14
|
+
name: '附件上传',
|
|
15
|
+
post: async function (data, config = {}) {
|
|
16
|
+
return await http.post(this.url, data, config);
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
exportFile: {
|
|
20
|
+
url: '/fileExport',
|
|
21
|
+
name: '导出附件',
|
|
22
|
+
get: async function (data, config = {}) {
|
|
23
|
+
return await http.get(this.url, data, config);
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
importFile: {
|
|
27
|
+
url: '/fileImport',
|
|
28
|
+
name: '导入附件',
|
|
29
|
+
post: async function (data, config = {}) {
|
|
30
|
+
return await http.post(this.url, data, config);
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
file: {
|
|
34
|
+
menu: {
|
|
35
|
+
url: '/file/menu',
|
|
36
|
+
name: '获取文件分类',
|
|
37
|
+
get: async function () {
|
|
38
|
+
return await http.get(this.url);
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
list: {
|
|
42
|
+
url: '/file/list',
|
|
43
|
+
name: '获取文件列表',
|
|
44
|
+
get: async function (params) {
|
|
45
|
+
return await http.get(this.url, params);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import http from '../../core/api/http'
|
|
2
|
+
import config from '../../core/config'
|
|
3
|
+
|
|
4
|
+
console.log('=======config==========', config)
|
|
5
|
+
export default {
|
|
6
|
+
ver: {
|
|
7
|
+
url: '/demo/ver',
|
|
8
|
+
name: '获取最新版本号',
|
|
9
|
+
get: async function (params) {
|
|
10
|
+
return await http.get(this.url, params);
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
post: {
|
|
14
|
+
url: '/demo/post',
|
|
15
|
+
name: '分页列表',
|
|
16
|
+
post: async function (data) {
|
|
17
|
+
return await http.post(this.url, data, {
|
|
18
|
+
headers: {
|
|
19
|
+
// 'response-status': 401
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
page: {
|
|
25
|
+
url: '/demo/page',
|
|
26
|
+
name: '分页列表',
|
|
27
|
+
get: async function (params) {
|
|
28
|
+
return await http.get(this.url, params);
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
list: {
|
|
32
|
+
url: '/demo/list',
|
|
33
|
+
name: '数据列表',
|
|
34
|
+
get: async function (params) {
|
|
35
|
+
return await http.get(this.url, params);
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
menu: {
|
|
39
|
+
url: '/demo/menu',
|
|
40
|
+
name: '普通用户菜单',
|
|
41
|
+
get: async function () {
|
|
42
|
+
return await http.get(this.url);
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
status: {
|
|
46
|
+
url: '/demo/status',
|
|
47
|
+
name: '模拟无权限',
|
|
48
|
+
get: async function (code) {
|
|
49
|
+
return await http.get(this.url, {}, {
|
|
50
|
+
headers: {
|
|
51
|
+
'response-status': code
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import http from '../../core/api/http'
|
|
2
|
+
import config from '../../core/config'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
menu: {
|
|
6
|
+
myMenus: {
|
|
7
|
+
url: '/admin/current/user/routers',
|
|
8
|
+
name: '获取我的菜单',
|
|
9
|
+
get: async function () {
|
|
10
|
+
return await http.get(this.url);
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
list: {
|
|
14
|
+
url: '/system/menu/list',
|
|
15
|
+
name: '获取菜单',
|
|
16
|
+
get: async function () {
|
|
17
|
+
return await http.get(this.url);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
dic: {
|
|
22
|
+
tree: {
|
|
23
|
+
url: '/system/dic/tree',
|
|
24
|
+
name: '获取字典树',
|
|
25
|
+
get: async function () {
|
|
26
|
+
return await http.get(this.url);
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
list: {
|
|
30
|
+
url: '/system/dic/list',
|
|
31
|
+
name: '字典明细',
|
|
32
|
+
get: async function (params) {
|
|
33
|
+
return await http.get(this.url, params);
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
get: {
|
|
37
|
+
url: '/system/dic/get',
|
|
38
|
+
name: '获取字典数据',
|
|
39
|
+
get: async function (params) {
|
|
40
|
+
return await http.get(this.url, params);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
role: {
|
|
45
|
+
list: {
|
|
46
|
+
url: '/system/role/list2',
|
|
47
|
+
name: '获取角色列表',
|
|
48
|
+
get: async function (params) {
|
|
49
|
+
return await http.get(this.url, params);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
dept: {
|
|
54
|
+
list: {
|
|
55
|
+
url: '/system/dept/list',
|
|
56
|
+
name: '获取部门列表',
|
|
57
|
+
get: async function (params) {
|
|
58
|
+
return await http.get(this.url, params);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
user: {
|
|
63
|
+
list: {
|
|
64
|
+
url: '/system/user/list',
|
|
65
|
+
name: '获取用户列表',
|
|
66
|
+
get: async function (params) {
|
|
67
|
+
return await http.get(this.url, params);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
app: {
|
|
72
|
+
list: {
|
|
73
|
+
url: '/system/app/list',
|
|
74
|
+
name: '应用列表',
|
|
75
|
+
get: async function () {
|
|
76
|
+
return await http.get(this.url);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
log: {
|
|
81
|
+
list: {
|
|
82
|
+
url: '/system/log/list',
|
|
83
|
+
name: '日志列表',
|
|
84
|
+
get: async function (params) {
|
|
85
|
+
return await http.get(this.url, params);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
table: {
|
|
90
|
+
list: {
|
|
91
|
+
url: '/system/table/list',
|
|
92
|
+
name: '表格列管理列表',
|
|
93
|
+
get: async function (params) {
|
|
94
|
+
return await http.get(this.url, params);
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
info: {
|
|
98
|
+
url: '/system/table/info',
|
|
99
|
+
name: '表格列管理详情',
|
|
100
|
+
get: async function (params) {
|
|
101
|
+
return await http.get(this.url, params);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
tasks: {
|
|
106
|
+
list: {
|
|
107
|
+
url: '/system/tasks/list',
|
|
108
|
+
name: '系统任务管理',
|
|
109
|
+
get: async function (params) {
|
|
110
|
+
return await http.get(this.url, params);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import api from './index'
|
|
2
|
+
|
|
3
|
+
const systemApi = {
|
|
4
|
+
async getMenu () {
|
|
5
|
+
const menu = await api.system.menu.myMenus.get()
|
|
6
|
+
if (menu.code == 200) {
|
|
7
|
+
if (menu.data.menu.length !== 0) {
|
|
8
|
+
console.log('request menus', menu.data.menu)
|
|
9
|
+
return menu.data.menu
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
return [];
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default systemApi
|
|
Binary file
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="hello">
|
|
3
|
+
<img alt="Vue logo" src="../assets/logo.png">
|
|
4
|
+
<h1>{{ msg }}</h1>
|
|
5
|
+
<h3>hel-micro</h3>
|
|
6
|
+
<p>
|
|
7
|
+
A module federation SDK which is unrelated to tool chain for module consumer.
|
|
8
|
+
checkout the <a href="https://tnfe.github.io/hel/" target="_blank" rel="noopener">hel-micro documentation</a>.
|
|
9
|
+
</p>
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script lang="ts">
|
|
14
|
+
import { defineComponent } from 'vue'
|
|
15
|
+
|
|
16
|
+
export default defineComponent({
|
|
17
|
+
name: 'HelloWorld',
|
|
18
|
+
props: {
|
|
19
|
+
msg: String
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
|
25
|
+
<style scoped>
|
|
26
|
+
h3 {
|
|
27
|
+
margin: 40px 0 0;
|
|
28
|
+
}
|
|
29
|
+
ul {
|
|
30
|
+
list-style-type: none;
|
|
31
|
+
padding: 0;
|
|
32
|
+
}
|
|
33
|
+
li {
|
|
34
|
+
display: inline-block;
|
|
35
|
+
margin: 0 10px;
|
|
36
|
+
}
|
|
37
|
+
a {
|
|
38
|
+
color: #42b983;
|
|
39
|
+
}
|
|
40
|
+
</style>
|