component-shipinlv 0.0.18 → 0.0.19
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/lib/Tool.d.ts +1 -1
- package/dist/lib/Tool.js +11 -13
- package/package.json +1 -1
package/dist/lib/Tool.d.ts
CHANGED
@@ -163,7 +163,7 @@ declare const Tool: {
|
|
163
163
|
setTimeOffset(serverTime: number): void;
|
164
164
|
getTime(): number;
|
165
165
|
h5Pay(query: Pay.H5PayQuery): void;
|
166
|
-
notification(type: "
|
166
|
+
notification(type: "success" | "info" | "warning" | "error", message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
|
167
167
|
notificationSuccess(message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
|
168
168
|
notificationError(message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
|
169
169
|
notificationWarning(message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
|
package/dist/lib/Tool.js
CHANGED
@@ -21,15 +21,13 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
21
|
var packageJson = require("../../package.json");
|
22
22
|
var store = {
|
23
23
|
key: function key() {
|
24
|
-
|
25
|
-
var WebBaseConfig = ((_window = window) === null || _window === void 0 ? void 0 : _window.WebBaseConfig) || {};
|
26
|
-
return "__".concat(WebBaseConfig.webKind, "-").concat(WebBaseConfig.productName, "__");
|
24
|
+
return "_shipinlv_";
|
27
25
|
},
|
28
26
|
get: function get(name) {
|
29
27
|
var getData;
|
30
28
|
try {
|
31
|
-
var
|
32
|
-
getData = (
|
29
|
+
var _window;
|
30
|
+
getData = (_window = window) === null || _window === void 0 ? void 0 : _window.localStorage.getItem(this.key() + name);
|
33
31
|
if (getData) {
|
34
32
|
getData = JSON.parse(getData);
|
35
33
|
}
|
@@ -50,8 +48,8 @@ var store = {
|
|
50
48
|
value: value
|
51
49
|
};
|
52
50
|
try {
|
53
|
-
var
|
54
|
-
(
|
51
|
+
var _window2;
|
52
|
+
(_window2 = window) === null || _window2 === void 0 || _window2.localStorage.setItem(this.key() + name, JSON.stringify(saveData));
|
55
53
|
} catch (e) {
|
56
54
|
console.error('LocalStorage set Error:', e);
|
57
55
|
}
|
@@ -323,18 +321,18 @@ var Tool = _objectSpread(_objectSpread({
|
|
323
321
|
},
|
324
322
|
//参数:变量名,url为空则表从当前页面的url中取
|
325
323
|
getQuery: function getQuery(name) {
|
326
|
-
var
|
324
|
+
var _window3, _document;
|
327
325
|
var url = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
328
|
-
var u = arguments[1] || ((
|
326
|
+
var u = arguments[1] || ((_window3 = window) === null || _window3 === void 0 || (_window3 = _window3.location) === null || _window3 === void 0 ? void 0 : _window3.search.replace('?', '')) || ((_document = document) === null || _document === void 0 || (_document = _document.location) === null || _document === void 0 ? void 0 : _document.hash.replace('#', '')),
|
329
327
|
reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)'),
|
330
328
|
r = u.substr(u.indexOf('?') + 1).match(reg);
|
331
329
|
return r != null ? decodeURIComponent(r[2]) : '';
|
332
330
|
},
|
333
331
|
getQueryAll: function getQueryAll() {
|
334
|
-
var
|
332
|
+
var _window4, _document2;
|
335
333
|
var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
336
334
|
var theRequest = {};
|
337
|
-
var str = url || ((
|
335
|
+
var str = url || ((_window4 = window) === null || _window4 === void 0 || (_window4 = _window4.location) === null || _window4 === void 0 ? void 0 : _window4.search.replace('?', '')) || ((_document2 = document) === null || _document2 === void 0 || (_document2 = _document2.location) === null || _document2 === void 0 ? void 0 : _document2.hash.replace('#', ''));
|
338
336
|
if (url.indexOf('?') !== -1) {
|
339
337
|
str = url.substr(url.indexOf('?') + 1);
|
340
338
|
}
|
@@ -1051,8 +1049,8 @@ var Tool = _objectSpread(_objectSpread({
|
|
1051
1049
|
return PostMessage('login');
|
1052
1050
|
},
|
1053
1051
|
getObjectURL: function getObjectURL(file) {
|
1054
|
-
var
|
1055
|
-
var url = ((
|
1052
|
+
var _window5, _window6;
|
1053
|
+
var url = ((_window5 = window) === null || _window5 === void 0 ? void 0 : _window5.URL) || ((_window6 = window) === null || _window6 === void 0 ? void 0 : _window6.webkitURL);
|
1056
1054
|
return url.createObjectURL(file);
|
1057
1055
|
},
|
1058
1056
|
// file
|