Merge branch 'hotfix/frontend_error' into develop
This commit is contained in:
@@ -13,15 +13,6 @@
|
||||
/>
|
||||
<title><%= VITE_APP_TITLE %></title>
|
||||
<link rel="icon" href="/favicon.svg" />
|
||||
<script>
|
||||
var _hmt = _hmt || [];
|
||||
(function () {
|
||||
var hm = document.createElement('script');
|
||||
hm.src = 'https://hm.baidu.com/hm.js?42639a1503843c26bc4d8b35185616d9';
|
||||
var s = document.getElementsByTagName('script')[0];
|
||||
s.parentNode.insertBefore(hm, s);
|
||||
})();
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
import {
|
||||
initPreferences,
|
||||
preferences,
|
||||
updatePreferences,
|
||||
} from '@easyflow/preferences';
|
||||
import { unmountGlobalLoading } from '@easyflow/utils';
|
||||
import './polyfills';
|
||||
|
||||
import {
|
||||
normalizeBrandAssetPreferences,
|
||||
overridesPreferences,
|
||||
} from './preferences';
|
||||
import {initPreferences, preferences, updatePreferences,} from '@easyflow/preferences';
|
||||
import {unmountGlobalLoading} from '@easyflow/utils';
|
||||
|
||||
import {normalizeBrandAssetPreferences, overridesPreferences,} from './preferences';
|
||||
|
||||
/**
|
||||
* 应用初始化完成之后再进行页面加载渲染
|
||||
|
||||
62
easyflow-ui-admin/app/src/polyfills.ts
Normal file
62
easyflow-ui-admin/app/src/polyfills.ts
Normal file
@@ -0,0 +1,62 @@
|
||||
const objectConstructor = Object as ObjectConstructor & {
|
||||
hasOwn?: (object: unknown, property: PropertyKey) => boolean;
|
||||
};
|
||||
|
||||
if (typeof objectConstructor.hasOwn !== 'function') {
|
||||
Object.defineProperty(Object, 'hasOwn', {
|
||||
configurable: true,
|
||||
value(object: unknown, property: PropertyKey) {
|
||||
if (object === null || object === undefined) {
|
||||
throw new TypeError('Cannot convert undefined or null to object');
|
||||
}
|
||||
return Object.prototype.hasOwnProperty.call(Object(object), property);
|
||||
},
|
||||
writable: true,
|
||||
});
|
||||
}
|
||||
|
||||
const arrayPrototype = Array.prototype as unknown[] & {
|
||||
toReversed?: () => unknown[];
|
||||
toSorted?: (compareFn?: (left: unknown, right: unknown) => number) => unknown[];
|
||||
toSpliced?: (
|
||||
start: number,
|
||||
deleteCount?: number,
|
||||
...items: unknown[]
|
||||
) => unknown[];
|
||||
};
|
||||
|
||||
if (typeof arrayPrototype.toReversed !== 'function') {
|
||||
Object.defineProperty(Array.prototype, 'toReversed', {
|
||||
configurable: true,
|
||||
value() {
|
||||
return Array.prototype.slice.call(this).reverse();
|
||||
},
|
||||
writable: true,
|
||||
});
|
||||
}
|
||||
|
||||
if (typeof arrayPrototype.toSorted !== 'function') {
|
||||
Object.defineProperty(Array.prototype, 'toSorted', {
|
||||
configurable: true,
|
||||
value(compareFn?: (left: unknown, right: unknown) => number) {
|
||||
return Array.prototype.slice.call(this).sort(compareFn);
|
||||
},
|
||||
writable: true,
|
||||
});
|
||||
}
|
||||
|
||||
if (typeof arrayPrototype.toSpliced !== 'function') {
|
||||
Object.defineProperty(Array.prototype, 'toSpliced', {
|
||||
configurable: true,
|
||||
value(start: number, deleteCount?: number, ...items: unknown[]) {
|
||||
const copy = Array.prototype.slice.call(this);
|
||||
if (arguments.length === 1) {
|
||||
copy.splice(start);
|
||||
} else {
|
||||
copy.splice(start, deleteCount as number, ...items);
|
||||
}
|
||||
return copy;
|
||||
},
|
||||
writable: true,
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user