Merge pull request 'fix: 登录表单兼容旧版本 chrome' (#2) from hotfix/frontend_error into main
Reviewed-on: #2
This commit was merged in pull request #2.
This commit is contained in:
@@ -13,15 +13,6 @@
|
|||||||
/>
|
/>
|
||||||
<title><%= VITE_APP_TITLE %></title>
|
<title><%= VITE_APP_TITLE %></title>
|
||||||
<link rel="icon" href="/favicon.svg" />
|
<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>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
|
|||||||
@@ -1,14 +1,9 @@
|
|||||||
import {
|
import './polyfills';
|
||||||
initPreferences,
|
|
||||||
preferences,
|
|
||||||
updatePreferences,
|
|
||||||
} from '@easyflow/preferences';
|
|
||||||
import { unmountGlobalLoading } from '@easyflow/utils';
|
|
||||||
|
|
||||||
import {
|
import {initPreferences, preferences, updatePreferences,} from '@easyflow/preferences';
|
||||||
normalizeBrandAssetPreferences,
|
import {unmountGlobalLoading} from '@easyflow/utils';
|
||||||
overridesPreferences,
|
|
||||||
} from './preferences';
|
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