@ibiz-template/core 0.0.1-alpha.33 → 0.0.1-alpha.34
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/dist/system/index.system.js +1 -1
- package/out/environment/environment.d.ts.map +1 -1
- package/out/environment/environment.js +1 -0
- package/out/ibizsys.d.ts +8 -1
- package/out/ibizsys.d.ts.map +1 -1
- package/out/ibizsys.js +8 -1
- package/out/interface/i-environment/i-environment.d.ts +9 -0
- package/out/interface/i-environment/i-environment.d.ts.map +1 -1
- package/out/utils/index.d.ts +1 -0
- package/out/utils/index.d.ts.map +1 -1
- package/out/utils/index.js +1 -0
- package/out/utils/logger/logger.d.ts +3 -0
- package/out/utils/logger/logger.d.ts.map +1 -0
- package/out/utils/logger/logger.js +2 -0
- package/package.json +3 -2
- package/src/environment/environment.ts +1 -0
- package/src/ibizsys.ts +9 -1
- package/src/interface/i-environment/i-environment.ts +10 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/logger/logger.ts +3 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["axios","lodash-es","qx-util","qs","pluralize"],(function(t){"use strict";var e,n,r,o,i,s;return{setters:[function(t){e=t.default},function(t){n=t.debounce},function(t){r=t.getCookie,o=t.notNilEmpty},function(t){i=t.stringify},function(t){s=t.default}],execute:function(){t({debounceAndMerge:function(t,e,r,o){var i,s=n((function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return i=void 0,t.apply(void 0,v([],b(e),!1))}),r,o);return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t;return i&&(r=e(i,r)),i=r,s.apply(void 0,v([],b(r),!1))}},getToken:m,install:function(){if(window.ibiz)throw new Error("ibiz 已经存在, 无需重复安装");window.ibiz=new x,window.___fc=new E,new g},isOverlap:function(t,e){return Array.from(new Set(v(v([],b(t),!1),b(e),!1))).length!==t.length+e.length},plural:k,pluralLower:function(t){return k(t).toLowerCase()}});var a,c,u=t("CoreConst",function(){function t(){}return t.DEFAULT_MODEL_SERVICE_TAG="default",t.TOKEN="access_token",t}()),l=t("HttpStatusMessageConst",{200:"服务器成功返回请求的数据。",201:"新建或修改数据成功。",202:"一个请求已经进入后台排队(异步任务)。",204:"删除数据成功。",400:"发出的请求有错误,服务器没有进行新建或修改数据的操作。",401:"用户没有权限(令牌、用户名、密码错误)。",403:"用户得到授权,但是访问是被禁止的。",404:"发出的请求针对的是不存在的记录,服务器没有进行操作。",406:"请求的格式不可得。",410:"请求的资源被永久删除,且不会再得到的。",422:"当创建一个对象时,发生一个验证错误。",500:"服务器发生错误,请检查服务器。",502:"网关错误。",503:"服务不可用,服务器暂时过载或维护。",504:"网关超时。"});t("LoginMode",a),function(t){t.DEFAULT="DEFAULT",t.CUSTOM="CUSTOM",t.CAS="CAS"}(a||t("LoginMode",a={})),t("MenuPermissionMode",c),function(t){t.MIXIN="MIXIN",t.RESOURCE="RESOURCE",t.RT="RT"}(c||t("MenuPermissionMode",c={}));t("IBizContext",(function(t,e){if(void 0===t&&(t={}),e){var n=this;Object.defineProperty(this,"_context",{enumerable:!1,value:{}});var r={};Object.keys(e).forEach((function(t){r[t]={enumerable:!0,set:function(e){n._context[t]=null==e?null:e},get:function(){return void 0!==n._context[t]?n._context[t]:e[t]}}})),Object.defineProperties(this,r)}Object.assign(this,t)}));var h=t("Environment",{dev:!1,jsCdn:"https://cdn.jsdelivr.net",baseUrl:"",remoteModelUrl:"/remotemodel",assetsUrl:"./assets",dcSystem:"",ExportFile:"/ibizutil/download",UploadFile:"/ibizutil/upload",casLoginUrl:"",loginMode:a.DEFAULT,menuPermissionMode:c.MIXIN,enablePermission:!0}),f=t("HttpError",(function(t){this.name="HttpError";var e=t.response;this.response=t.response,e?(e.data?this.message=e.data.message:this.message=e.statusText,this.message||(this.message=l[e.status]),this.message||(this.message="网络异常,请稍后重试!"),this.status=e.status):(this.message=t.message,this.status=500)})),p=(t("RuntimeError",(function(t){this.message=t,this.name="Runtime Error"})),function(){return p=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},p.apply(this,arguments)});function d(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))}function y(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}function b(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s}function v(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}function m(){return r(u.TOKEN)}var g=t("Interceptor",function(){function t(){this.init()}return t.prototype.init=function(){e.interceptors.request.use((function(t){t.headers||(t.headers={}),t.headers.Authorization="Bearer ".concat(m());var e=ibiz.orgData;return e&&(e.systemid&&(t.headers.srfsystemid=e.systemid),e.orgid&&(t.headers.srforgid=e.orgid)),t}))},t}());function w(t,e,n,r,o){var i="".concat(t,"-").concat(e);return n&&(i+="-".concat(n)),r&&(i+="__".concat(r)),o&&(i+="--".concat(o)),i}t("Namespace",function(){function t(t,e){this.block=t,this.namespace=e||"ibiz"}return t.prototype.b=function(t){return void 0===t&&(t=""),w(this.namespace,this.block,t,"","")},t.prototype.e=function(t){return t?w(this.namespace,this.block,"",t,""):""},t.prototype.m=function(t){return t?w(this.namespace,this.block,"","",t):""},t.prototype.be=function(t,e){return t&&e?w(this.namespace,this.block,t,e,""):""},t.prototype.em=function(t,e){return t&&e?w(this.namespace,this.block,"",t,e):""},t.prototype.bm=function(t,e){return t&&e?w(this.namespace,this.block,t,"",e):""},t.prototype.bem=function(t,e,n){return t&&e&&n?w(this.namespace,this.block,t,e,n):""},t.prototype.is=function(t,e){return t&&e?"".concat("is-").concat(t):""},t.prototype.cssVar=function(t){var e={};for(var n in t)t[n]&&(e[this.cssVarName(n)]=t[n]);return e},t.prototype.cssVarBlock=function(t){var e={};for(var n in t)t[n]&&(e[this.cssVarBlockName(n)]=t[n]);return e},t.prototype.cssVarName=function(t){return"--".concat(this.namespace,"-").concat(t)},t.prototype.cssVarBlockName=function(t){return"--".concat(this.namespace,"-").concat(this.block,"-").concat(t)},t}()),t("HttpResponse",(function(t,e,n){this.local=!0,this.ok=!1,this.headers={},this.config={},this.data=t,this.status=e||200,this.statusText=n||"",this.status>=200&&this.status<300&&(this.ok=!0)}));var P=t("Net",function(){function t(t){this._prefix="",t&&(this._prefix=t)}return Object.defineProperty(t.prototype,"prefix",{get:function(){return this._prefix||ibiz.env.baseUrl},enumerable:!1,configurable:!0}),t.prototype.post=function(t,n,r,o){return void 0===r&&(r={}),void 0===o&&(o={}),d(this,void 0,void 0,(function(){var i,s;return y(this,(function(a){switch(a.label){case 0:t=this.handleAppPresetParam(t,r),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,e({method:"post",url:t,data:n,headers:p({"Content-Type":"application/json;charset=UTF-8",Accept:"application/json"},o)})];case 2:return i=a.sent(),[2,this.doResponseResult(i)];case 3:throw s=a.sent(),new f(s);case 4:return[2]}}))}))},t.prototype.get=function(t,n,r,o){return void 0===n&&(n={}),void 0===r&&(r={}),void 0===o&&(o={}),d(this,void 0,void 0,(function(){var i,s;return y(this,(function(a){switch(a.label){case 0:t=this.attachUrlParam(t,n),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,e.get(t,p({headers:r},o))];case 2:return i=a.sent(),[2,this.doResponseResult(i)];case 3:throw s=a.sent(),new f(s);case 4:return[2]}}))}))},t.prototype.delete=function(t,n,r){return void 0===r&&(r={}),d(this,void 0,void 0,(function(){var o,i;return y(this,(function(s){switch(s.label){case 0:t=this.handleAppPresetParam(t,n),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,e.delete(t,{headers:r})];case 2:return o=s.sent(),[2,this.doResponseResult(o)];case 3:throw i=s.sent(),new f(i);case 4:return[2]}}))}))},t.prototype.put=function(t,n,r,o){return void 0===r&&(r={}),void 0===o&&(o={}),d(this,void 0,void 0,(function(){var i,s;return y(this,(function(a){switch(a.label){case 0:t=this.handleAppPresetParam(t,r),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,e.put(t,n,{headers:o})];case 2:return i=a.sent(),[2,this.doResponseResult(i)];case 3:throw s=a.sent(),new f(s);case 4:return[2]}}))}))},t.prototype.getModel=function(t,n){return void 0===n&&(n={}),d(this,void 0,void 0,(function(){var r,o;return y(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,e.get(t,{headers:n})];case 1:return r=i.sent(),[2,this.doResponseResult(r)];case 2:throw o=i.sent(),new f(o);case 3:return[2]}}))}))},t.prototype.doResponseResult=function(t){var e=t;return e.status>=200&&e.status<=299&&(e.ok=!0),e},t.prototype.handleAppPresetParam=function(t,e){if(e){var n=Object.keys(e),r={};return n.forEach((function(t){t.startsWith("srf")&&o(e[t])&&(r[t]=e[t])})),this.attachUrlParam(t,e)}return t},t.prototype.attachUrlParam=function(t,e){t=this.attachUrl(t);var n=i(e);return o(n)&&(t=t.endsWith("?")||-1!==t.indexOf("?")&&t.endsWith("&")?"".concat(t).concat(n):-1===t.indexOf("?")||t.endsWith("&")?"".concat(t,"?").concat(n):"".concat(t,"&").concat(n)),t},t.prototype.attachUrl=function(t){return"".concat(this.prefix).concat(t)},t}());function k(t){return s(t)}t("UrlHelper",function(){function t(){}return Object.defineProperty(t,"routeBase",{get:function(){return"".concat(this.appBase,"/#")},enumerable:!1,configurable:!0}),Object.defineProperty(t,"appBase",{get:function(){var t=window.location,e=t.origin,n=t.pathname;return"".concat(e).concat(n).replace(/\/$/,"")},enumerable:!1,configurable:!0}),Object.defineProperty(t,"routePath",{get:function(){return window.location.hash.replace("#","")},enumerable:!1,configurable:!0}),Object.defineProperty(t,"fullPath",{get:function(){return window.location.href},enumerable:!1,configurable:!0}),t}());var x=t("IBizSys",(function(){this.env=h,this.net=new P})),E=t("FactoryCenter",(function(){}))}}}));
|
|
1
|
+
System.register(["axios","lodash-es","qx-util","qs","pluralize"],(function(e){"use strict";var t,n,o,r,i,s;return{setters:[function(e){t=e.default},function(e){n=e.debounce},function(e){o=e.getCookie,r=e.notNilEmpty},function(e){i=e.stringify},function(e){s=e.default}],execute:function(){function a(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}e({debounceAndMerge:function(e,t,o,r){var i,s=n((function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return i=void 0,e.apply(void 0,b([],g(t),!1))}),o,r);return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var o=e;return i&&(o=t(i,o)),i=o,s.apply(void 0,b([],g(o),!1))}},getToken:w,install:function(){if(window.ibiz)throw new Error("ibiz 已经存在, 无需重复安装");window.ibiz=new A,window.___fc=new C,new x},isOverlap:function(e,t){return Array.from(new Set(b(b([],g(e),!1),g(t),!1))).length!==e.length+t.length},plural:P,pluralLower:function(e){return P(e).toLowerCase()}});var c,u,l=e("CoreConst",function(){function e(){}return e.DEFAULT_MODEL_SERVICE_TAG="default",e.TOKEN="access_token",e}()),f=e("HttpStatusMessageConst",{200:"服务器成功返回请求的数据。",201:"新建或修改数据成功。",202:"一个请求已经进入后台排队(异步任务)。",204:"删除数据成功。",400:"发出的请求有错误,服务器没有进行新建或修改数据的操作。",401:"用户没有权限(令牌、用户名、密码错误)。",403:"用户得到授权,但是访问是被禁止的。",404:"发出的请求针对的是不存在的记录,服务器没有进行操作。",406:"请求的格式不可得。",410:"请求的资源被永久删除,且不会再得到的。",422:"当创建一个对象时,发生一个验证错误。",500:"服务器发生错误,请检查服务器。",502:"网关错误。",503:"服务不可用,服务器暂时过载或维护。",504:"网关超时。"});e("LoginMode",c),function(e){e.DEFAULT="DEFAULT",e.CUSTOM="CUSTOM",e.CAS="CAS"}(c||e("LoginMode",c={})),e("MenuPermissionMode",u),function(e){e.MIXIN="MIXIN",e.RESOURCE="RESOURCE",e.RT="RT"}(u||e("MenuPermissionMode",u={}));e("IBizContext",(function(e,t){if(void 0===e&&(e={}),t){var n=this;Object.defineProperty(this,"_context",{enumerable:!1,value:{}});var o={};Object.keys(t).forEach((function(e){o[e]={enumerable:!0,set:function(t){n._context[e]=null==t?null:t},get:function(){return void 0!==n._context[e]?n._context[e]:t[e]}}})),Object.defineProperties(this,o)}Object.assign(this,e)}));var p=e("Environment",{dev:!1,logLevel:"ERROR",jsCdn:"https://cdn.jsdelivr.net",baseUrl:"",remoteModelUrl:"/remotemodel",assetsUrl:"./assets",dcSystem:"",ExportFile:"/ibizutil/download",UploadFile:"/ibizutil/upload",casLoginUrl:"",loginMode:c.DEFAULT,menuPermissionMode:u.MIXIN,enablePermission:!0}),h=e("HttpError",(function(e){this.name="HttpError";var t=e.response;this.response=e.response,t?(t.data?this.message=t.data.message:this.message=t.statusText,this.message||(this.message=f[t.status]),this.message||(this.message="网络异常,请稍后重试!"),this.status=t.status):(this.message=e.message,this.status=500)})),d=(e("RuntimeError",(function(e){this.message=e,this.name="Runtime Error"})),function(){return d=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},d.apply(this,arguments)});function y(e,t,n,o){return new(n||(n=Promise))((function(r,i){function s(e){try{c(o.next(e))}catch(e){i(e)}}function a(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((o=o.apply(e,t||[])).next())}))}function v(e,t){var n,o,r,i,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,o=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){s.label=i[1];break}if(6===i[0]&&s.label<r[1]){s.label=r[1],r=i;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(i);break}r[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}function g(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)s.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return s}function b(e,t,n){if(n||2===arguments.length)for(var o,r=0,i=t.length;r<i;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}function w(){return o(l.TOKEN)}var m,E,R,x=e("Interceptor",function(){function e(){this.init()}return e.prototype.init=function(){t.interceptors.request.use((function(e){e.headers||(e.headers={}),e.headers.Authorization="Bearer ".concat(w());var t=ibiz.orgData;return t&&(t.systemid&&(e.headers.srfsystemid=t.systemid),t.orgid&&(e.headers.srforgid=t.orgid)),e}))},e}()),O="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},L={exports:{}};E=O,R=function(){var e=function(){},t="undefined",n=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),o=["trace","debug","info","warn","error"];function r(e,t){var n=e[t];if("function"==typeof n.bind)return n.bind(e);try{return Function.prototype.bind.call(n,e)}catch(t){return function(){return Function.prototype.apply.apply(n,[e,arguments])}}}function i(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function s(o){return"debug"===o&&(o="log"),typeof console!==t&&("trace"===o&&n?i:void 0!==console[o]?r(console,o):void 0!==console.log?r(console,"log"):e)}function a(t,n){for(var r=0;r<o.length;r++){var i=o[r];this[i]=r<t?e:this.methodFactory(i,t,n)}this.log=this.debug}function c(e,n,o){return function(){typeof console!==t&&(a.call(this,n,o),this[e].apply(this,arguments))}}function u(e,t,n){return s(e)||c.apply(this,arguments)}function l(e,n,r){var i,s=this;n=null==n?"WARN":n;var c="loglevel";function l(){var e;if(typeof window!==t&&c){try{e=window.localStorage[c]}catch(e){}if(typeof e===t)try{var n=window.document.cookie,o=n.indexOf(encodeURIComponent(c)+"=");-1!==o&&(e=/^([^;]+)/.exec(n.slice(o))[1])}catch(e){}return void 0===s.levels[e]&&(e=void 0),e}}"string"==typeof e?c+=":"+e:"symbol"==typeof e&&(c=void 0),s.name=e,s.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},s.methodFactory=r||u,s.getLevel=function(){return i},s.setLevel=function(n,r){if("string"==typeof n&&void 0!==s.levels[n.toUpperCase()]&&(n=s.levels[n.toUpperCase()]),!("number"==typeof n&&n>=0&&n<=s.levels.SILENT))throw"log.setLevel() called with invalid level: "+n;if(i=n,!1!==r&&function(e){var n=(o[e]||"silent").toUpperCase();if(typeof window!==t&&c){try{return void(window.localStorage[c]=n)}catch(e){}try{window.document.cookie=encodeURIComponent(c)+"="+n+";"}catch(e){}}}(n),a.call(s,n,e),typeof console===t&&n<s.levels.SILENT)return"No console available for logging"},s.setDefaultLevel=function(e){n=e,l()||s.setLevel(e,!1)},s.resetLevel=function(){s.setLevel(n,!1),function(){if(typeof window!==t&&c){try{return void window.localStorage.removeItem(c)}catch(e){}try{window.document.cookie=encodeURIComponent(c)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(e){}}}()},s.enableAll=function(e){s.setLevel(s.levels.TRACE,e)},s.disableAll=function(e){s.setLevel(s.levels.SILENT,e)};var f=l();null==f&&(f=n),s.setLevel(f,!1)}var f=new l,p={};f.getLogger=function(e){if("symbol"!=typeof e&&"string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=p[e];return t||(t=p[e]=new l(e,f.getLevel(),f.methodFactory)),t};var h=typeof window!==t?window.log:void 0;return f.noConflict=function(){return typeof window!==t&&window.log===f&&(window.log=h),f},f.getLoggers=function(){return p},f.default=f,f},(m=L).exports?m.exports=R():E.log=R();var T=a({__proto__:null,default:L.exports},[L.exports]);e("Logger",T);function U(e,t,n,o,r){var i="".concat(e,"-").concat(t);return n&&(i+="-".concat(n)),o&&(i+="__".concat(o)),r&&(i+="--".concat(r)),i}e("Namespace",function(){function e(e,t){this.block=e,this.namespace=t||"ibiz"}return e.prototype.b=function(e){return void 0===e&&(e=""),U(this.namespace,this.block,e,"","")},e.prototype.e=function(e){return e?U(this.namespace,this.block,"",e,""):""},e.prototype.m=function(e){return e?U(this.namespace,this.block,"","",e):""},e.prototype.be=function(e,t){return e&&t?U(this.namespace,this.block,e,t,""):""},e.prototype.em=function(e,t){return e&&t?U(this.namespace,this.block,"",e,t):""},e.prototype.bm=function(e,t){return e&&t?U(this.namespace,this.block,e,"",t):""},e.prototype.bem=function(e,t,n){return e&&t&&n?U(this.namespace,this.block,e,t,n):""},e.prototype.is=function(e,t){return e&&t?"".concat("is-").concat(e):""},e.prototype.cssVar=function(e){var t={};for(var n in e)e[n]&&(t[this.cssVarName(n)]=e[n]);return t},e.prototype.cssVarBlock=function(e){var t={};for(var n in e)e[n]&&(t[this.cssVarBlockName(n)]=e[n]);return t},e.prototype.cssVarName=function(e){return"--".concat(this.namespace,"-").concat(e)},e.prototype.cssVarBlockName=function(e){return"--".concat(this.namespace,"-").concat(this.block,"-").concat(e)},e}()),e("HttpResponse",(function(e,t,n){this.local=!0,this.ok=!1,this.headers={},this.config={},this.data=e,this.status=t||200,this.statusText=n||"",this.status>=200&&this.status<300&&(this.ok=!0)}));var k=e("Net",function(){function e(e){this._prefix="",e&&(this._prefix=e)}return Object.defineProperty(e.prototype,"prefix",{get:function(){return this._prefix||ibiz.env.baseUrl},enumerable:!1,configurable:!0}),e.prototype.post=function(e,n,o,r){return void 0===o&&(o={}),void 0===r&&(r={}),y(this,void 0,void 0,(function(){var i,s;return v(this,(function(a){switch(a.label){case 0:e=this.handleAppPresetParam(e,o),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,t({method:"post",url:e,data:n,headers:d({"Content-Type":"application/json;charset=UTF-8",Accept:"application/json"},r)})];case 2:return i=a.sent(),[2,this.doResponseResult(i)];case 3:throw s=a.sent(),new h(s);case 4:return[2]}}))}))},e.prototype.get=function(e,n,o,r){return void 0===n&&(n={}),void 0===o&&(o={}),void 0===r&&(r={}),y(this,void 0,void 0,(function(){var i,s;return v(this,(function(a){switch(a.label){case 0:e=this.attachUrlParam(e,n),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,t.get(e,d({headers:o},r))];case 2:return i=a.sent(),[2,this.doResponseResult(i)];case 3:throw s=a.sent(),new h(s);case 4:return[2]}}))}))},e.prototype.delete=function(e,n,o){return void 0===o&&(o={}),y(this,void 0,void 0,(function(){var r,i;return v(this,(function(s){switch(s.label){case 0:e=this.handleAppPresetParam(e,n),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,t.delete(e,{headers:o})];case 2:return r=s.sent(),[2,this.doResponseResult(r)];case 3:throw i=s.sent(),new h(i);case 4:return[2]}}))}))},e.prototype.put=function(e,n,o,r){return void 0===o&&(o={}),void 0===r&&(r={}),y(this,void 0,void 0,(function(){var i,s;return v(this,(function(a){switch(a.label){case 0:e=this.handleAppPresetParam(e,o),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,t.put(e,n,{headers:r})];case 2:return i=a.sent(),[2,this.doResponseResult(i)];case 3:throw s=a.sent(),new h(s);case 4:return[2]}}))}))},e.prototype.getModel=function(e,n){return void 0===n&&(n={}),y(this,void 0,void 0,(function(){var o,r;return v(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,t.get(e,{headers:n})];case 1:return o=i.sent(),[2,this.doResponseResult(o)];case 2:throw r=i.sent(),new h(r);case 3:return[2]}}))}))},e.prototype.doResponseResult=function(e){var t=e;return t.status>=200&&t.status<=299&&(t.ok=!0),t},e.prototype.handleAppPresetParam=function(e,t){if(t){var n=Object.keys(t),o={};return n.forEach((function(e){e.startsWith("srf")&&r(t[e])&&(o[e]=t[e])})),this.attachUrlParam(e,t)}return e},e.prototype.attachUrlParam=function(e,t){e=this.attachUrl(e);var n=i(t);return r(n)&&(e=e.endsWith("?")||-1!==e.indexOf("?")&&e.endsWith("&")?"".concat(e).concat(n):-1===e.indexOf("?")||e.endsWith("&")?"".concat(e,"?").concat(n):"".concat(e,"&").concat(n)),e},e.prototype.attachUrl=function(e){return"".concat(this.prefix).concat(e)},e}());function P(e){return s(e)}e("UrlHelper",function(){function e(){}return Object.defineProperty(e,"routeBase",{get:function(){return"".concat(this.appBase,"/#")},enumerable:!1,configurable:!0}),Object.defineProperty(e,"appBase",{get:function(){var e=window.location,t=e.origin,n=e.pathname;return"".concat(t).concat(n).replace(/\/$/,"")},enumerable:!1,configurable:!0}),Object.defineProperty(e,"routePath",{get:function(){return window.location.hash.replace("#","")},enumerable:!1,configurable:!0}),Object.defineProperty(e,"fullPath",{get:function(){return window.location.href},enumerable:!1,configurable:!0}),e}());var A=e("IBizSys",(function(){this.env=p,this.log=T,this.net=new k})),C=e("FactoryCenter",(function(){}))}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../src/environment/environment.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../src/environment/environment.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,YAczB,CAAC"}
|
package/out/ibizsys.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OrgData } from './interface';
|
|
2
|
-
import { Net } from './utils';
|
|
2
|
+
import { Logger, Net } from './utils';
|
|
3
3
|
/**
|
|
4
4
|
* 全局对象
|
|
5
5
|
*
|
|
@@ -16,6 +16,13 @@ export declare class IBizSys {
|
|
|
16
16
|
* @date 2022-07-19 18:07:04
|
|
17
17
|
*/
|
|
18
18
|
env: import("./interface").IEnvironment;
|
|
19
|
+
/**
|
|
20
|
+
* 日志对象
|
|
21
|
+
*
|
|
22
|
+
* @author chitanda
|
|
23
|
+
* @date 2022-10-25 20:10:22
|
|
24
|
+
*/
|
|
25
|
+
log: Logger.RootLogger;
|
|
19
26
|
/**
|
|
20
27
|
* 网络请求工具类
|
|
21
28
|
*
|
package/out/ibizsys.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ibizsys.d.ts","sourceRoot":"","sources":["../src/ibizsys.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"ibizsys.d.ts","sourceRoot":"","sources":["../src/ibizsys.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAEtC;;;;;;;GAOG;AACH,qBAAa,OAAO;IAClB;;;;;OAKG;IACH,GAAG,qCAAe;IAElB;;;;;OAKG;IACH,GAAG,oBAAU;IAEb;;;;;;OAMG;IACH,GAAG,EAAE,GAAG,CAAa;IAErB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC;CACjB"}
|
package/out/ibizsys.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Environment } from './environment/environment';
|
|
2
|
-
import { Net } from './utils';
|
|
2
|
+
import { Logger, Net } from './utils';
|
|
3
3
|
/**
|
|
4
4
|
* 全局对象
|
|
5
5
|
*
|
|
@@ -17,6 +17,13 @@ export class IBizSys {
|
|
|
17
17
|
* @date 2022-07-19 18:07:04
|
|
18
18
|
*/
|
|
19
19
|
this.env = Environment;
|
|
20
|
+
/**
|
|
21
|
+
* 日志对象
|
|
22
|
+
*
|
|
23
|
+
* @author chitanda
|
|
24
|
+
* @date 2022-10-25 20:10:22
|
|
25
|
+
*/
|
|
26
|
+
this.log = Logger;
|
|
20
27
|
/**
|
|
21
28
|
* 网络请求工具类
|
|
22
29
|
*
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { LogLevelDesc } from 'loglevel';
|
|
1
2
|
import { LoginMode, MenuPermissionMode } from '../../constant';
|
|
2
3
|
/**
|
|
3
4
|
* 配置参数
|
|
@@ -25,6 +26,14 @@ export interface IEnvironment {
|
|
|
25
26
|
* @type {boolean}
|
|
26
27
|
*/
|
|
27
28
|
dev: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* 日志级别
|
|
31
|
+
*
|
|
32
|
+
* @author chitanda
|
|
33
|
+
* @date 2022-10-25 20:10:55
|
|
34
|
+
* @type {LogLevelDesc}
|
|
35
|
+
*/
|
|
36
|
+
logLevel: LogLevelDesc;
|
|
28
37
|
/**
|
|
29
38
|
* js 静态文件 cdn 地址
|
|
30
39
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i-environment.d.ts","sourceRoot":"","sources":["../../../src/interface/i-environment/i-environment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAE/D;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;;;OAOG;IACH,GAAG,EAAE,OAAO,CAAC;IAEb;;;;;;;OAOG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;;;OAMG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;;;;OAMG;IACH,SAAS,EAAE,SAAS,CAAC;IAErB;;;;;;OAMG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;;;OAMG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;;;;;OAMG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;;;;OAMG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;;;OAMG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;;OAMG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;;OAMG;IACH,gBAAgB,EAAE,OAAO,CAAC;IAE1B;;;;;;OAMG;IACH,kBAAkB,EAAE,kBAAkB,CAAC;CACxC"}
|
|
1
|
+
{"version":3,"file":"i-environment.d.ts","sourceRoot":"","sources":["../../../src/interface/i-environment/i-environment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAE/D;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;;;OAOG;IACH,GAAG,EAAE,OAAO,CAAC;IAEb;;;;;;OAMG;IACH,QAAQ,EAAE,YAAY,CAAC;IAEvB;;;;;;;OAOG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;;;OAMG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;;;;OAMG;IACH,SAAS,EAAE,SAAS,CAAC;IAErB;;;;;;OAMG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;;;OAMG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;;;;;OAMG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;;;;OAMG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;;;OAMG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;;OAMG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;;OAMG;IACH,gBAAgB,EAAE,OAAO,CAAC;IAE1B;;;;;;OAMG;IACH,kBAAkB,EAAE,kBAAkB,CAAC;CACxC"}
|
package/out/utils/index.d.ts
CHANGED
package/out/utils/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACtD,cAAc,aAAa,CAAC;AAC5B,cAAc,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACtD,cAAc,aAAa,CAAC;AAC5B,cAAc,yBAAyB,CAAC"}
|
package/out/utils/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/utils/logger/logger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AAEnC,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/core",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.34",
|
|
4
4
|
"description": "核心包",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "out/index.js",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"axios": "^1.1.3",
|
|
33
|
+
"loglevel": "^1.8.0",
|
|
33
34
|
"pluralize": "^8.0.0",
|
|
34
35
|
"qs": "^6.11.0"
|
|
35
36
|
},
|
|
@@ -43,5 +44,5 @@
|
|
|
43
44
|
"lodash-es": "^4.17.21",
|
|
44
45
|
"qx-util": "^0.4.1"
|
|
45
46
|
},
|
|
46
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "6939c8852468dbe9b514f26d1ed28ad04802a09f"
|
|
47
48
|
}
|
package/src/ibizsys.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Environment } from './environment/environment';
|
|
2
2
|
import { OrgData } from './interface';
|
|
3
|
-
import { Net } from './utils';
|
|
3
|
+
import { Logger, Net } from './utils';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* 全局对象
|
|
@@ -19,6 +19,14 @@ export class IBizSys {
|
|
|
19
19
|
*/
|
|
20
20
|
env = Environment;
|
|
21
21
|
|
|
22
|
+
/**
|
|
23
|
+
* 日志对象
|
|
24
|
+
*
|
|
25
|
+
* @author chitanda
|
|
26
|
+
* @date 2022-10-25 20:10:22
|
|
27
|
+
*/
|
|
28
|
+
log = Logger;
|
|
29
|
+
|
|
22
30
|
/**
|
|
23
31
|
* 网络请求工具类
|
|
24
32
|
*
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { LogLevelDesc } from 'loglevel';
|
|
1
2
|
import { LoginMode, MenuPermissionMode } from '../../constant';
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -28,6 +29,15 @@ export interface IEnvironment {
|
|
|
28
29
|
*/
|
|
29
30
|
dev: boolean;
|
|
30
31
|
|
|
32
|
+
/**
|
|
33
|
+
* 日志级别
|
|
34
|
+
*
|
|
35
|
+
* @author chitanda
|
|
36
|
+
* @date 2022-10-25 20:10:55
|
|
37
|
+
* @type {LogLevelDesc}
|
|
38
|
+
*/
|
|
39
|
+
logLevel: LogLevelDesc;
|
|
40
|
+
|
|
31
41
|
/**
|
|
32
42
|
* js 静态文件 cdn 地址
|
|
33
43
|
*
|
package/src/utils/index.ts
CHANGED