@yysports/tools 0.0.1
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/LICENSE +21 -0
- package/README.md +40 -0
- package/dist/CurrentUser/index.d.ts +35 -0
- package/dist/CurrentUser/index.js +168 -0
- package/dist/Track/index.d.ts +24 -0
- package/dist/Track/index.js +275 -0
- package/dist/Utils/common.d.ts +20 -0
- package/dist/Utils/common.js +55 -0
- package/dist/Utils/file.d.ts +10 -0
- package/dist/Utils/file.js +30 -0
- package/dist/Utils/index.d.ts +4 -0
- package/dist/Utils/index.js +4 -0
- package/dist/Utils/url.d.ts +1 -0
- package/dist/Utils/url.js +29 -0
- package/dist/Utils/wx.d.ts +11 -0
- package/dist/Utils/wx.js +25 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +6 -0
- package/dist/interfaces/currentUser.interface.d.ts +21 -0
- package/dist/interfaces/currentUser.interface.js +1 -0
- package/dist/interfaces/track.interface.d.ts +35 -0
- package/dist/interfaces/track.interface.js +16 -0
- package/lib/CurrentUser/index.d.ts +35 -0
- package/lib/CurrentUser/index.js +130 -0
- package/lib/Track/index.d.ts +24 -0
- package/lib/Track/index.js +209 -0
- package/lib/Utils/common.d.ts +20 -0
- package/lib/Utils/common.js +66 -0
- package/lib/Utils/file.d.ts +10 -0
- package/lib/Utils/file.js +50 -0
- package/lib/Utils/index.d.ts +4 -0
- package/lib/Utils/index.js +29 -0
- package/lib/Utils/url.d.ts +1 -0
- package/lib/Utils/url.js +45 -0
- package/lib/Utils/wx.d.ts +11 -0
- package/lib/Utils/wx.js +46 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.js +50 -0
- package/lib/interfaces/currentUser.interface.d.ts +21 -0
- package/lib/interfaces/currentUser.interface.js +17 -0
- package/lib/interfaces/track.interface.d.ts +35 -0
- package/lib/interfaces/track.interface.js +35 -0
- package/package.json +99 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const promisify: (fn: (...params: any[]) => void, ...args: any[]) => Promise<unknown>;
|
|
2
|
+
/**
|
|
3
|
+
* 将数组内某个字段的值转换为对象组
|
|
4
|
+
* @param array
|
|
5
|
+
* @param key
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export declare function arrayToObj(array: any[], key: string): any;
|
|
9
|
+
/**
|
|
10
|
+
* 检测当前浏览器内核版本是否大于等于指定的Chrome内核版本
|
|
11
|
+
* @param minVersion 指定的Chrome内核版本
|
|
12
|
+
* @returns 是否大于等于指定版本
|
|
13
|
+
*/
|
|
14
|
+
export declare function checkChromeVersion(minVersion: number): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* 生成随机字符串
|
|
17
|
+
* @param length 字符串长度
|
|
18
|
+
* @returns 随机字符串
|
|
19
|
+
*/
|
|
20
|
+
export declare function generateRandomString(length: number): string;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/Utils/common.ts
|
|
20
|
+
var common_exports = {};
|
|
21
|
+
__export(common_exports, {
|
|
22
|
+
arrayToObj: () => arrayToObj,
|
|
23
|
+
checkChromeVersion: () => checkChromeVersion,
|
|
24
|
+
generateRandomString: () => generateRandomString,
|
|
25
|
+
promisify: () => promisify
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(common_exports);
|
|
28
|
+
var promisify = (fn, ...args) => {
|
|
29
|
+
return new Promise((resolve) => {
|
|
30
|
+
if (args.length > 0) {
|
|
31
|
+
fn(...args, resolve);
|
|
32
|
+
} else {
|
|
33
|
+
fn(resolve);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
function arrayToObj(array, key) {
|
|
38
|
+
return array.reduce((obj, item) => {
|
|
39
|
+
obj[item[key]] = item;
|
|
40
|
+
return obj;
|
|
41
|
+
}, {});
|
|
42
|
+
}
|
|
43
|
+
function checkChromeVersion(minVersion) {
|
|
44
|
+
const ua = navigator.userAgent.toLowerCase();
|
|
45
|
+
const chromeVersion = ua.match(/chrom(e|ium)\/([0-9]+)\./);
|
|
46
|
+
if (chromeVersion && chromeVersion[2]) {
|
|
47
|
+
return parseInt(chromeVersion[2], 10) >= minVersion;
|
|
48
|
+
}
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
function generateRandomString(length) {
|
|
52
|
+
let result = "";
|
|
53
|
+
const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
54
|
+
const charactersLength = characters.length;
|
|
55
|
+
for (let i = 0; i < length; i++) {
|
|
56
|
+
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
|
57
|
+
}
|
|
58
|
+
return result;
|
|
59
|
+
}
|
|
60
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
61
|
+
0 && (module.exports = {
|
|
62
|
+
arrayToObj,
|
|
63
|
+
checkChromeVersion,
|
|
64
|
+
generateRandomString,
|
|
65
|
+
promisify
|
|
66
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { compressAccuratelyConfig } from 'image-conversion';
|
|
2
|
+
export declare const downloadFile: (href: string, fileName?: string) => void;
|
|
3
|
+
export declare const compressImg: (file: Blob, config?: number | compressAccuratelyConfig | undefined) => Promise<Blob>;
|
|
4
|
+
/**
|
|
5
|
+
* 检查文件类型
|
|
6
|
+
* @param file File 文件对象
|
|
7
|
+
* @param accept string 文件类型,使用“,”分割,如:image/png,image/jpeg
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
export declare const checkFileType: (file: File, accept: string) => boolean;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/Utils/file.ts
|
|
20
|
+
var file_exports = {};
|
|
21
|
+
__export(file_exports, {
|
|
22
|
+
checkFileType: () => checkFileType,
|
|
23
|
+
compressImg: () => compressImg,
|
|
24
|
+
downloadFile: () => downloadFile
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(file_exports);
|
|
27
|
+
var import_image_conversion = require("image-conversion");
|
|
28
|
+
var downloadFile = (href, fileName) => {
|
|
29
|
+
const aEle = document.createElement("a");
|
|
30
|
+
aEle.target = "_blank";
|
|
31
|
+
aEle.href = href;
|
|
32
|
+
aEle.download = fileName || "";
|
|
33
|
+
aEle.click();
|
|
34
|
+
aEle.remove();
|
|
35
|
+
};
|
|
36
|
+
var compressImg = (file, config) => (0, import_image_conversion.compressAccurately)(file, config);
|
|
37
|
+
var checkFileType = (file, accept) => {
|
|
38
|
+
if (accept) {
|
|
39
|
+
const acceptList = accept.split(",").map((item) => item.trim().toLowerCase());
|
|
40
|
+
const fileType = file.type.toLowerCase();
|
|
41
|
+
return acceptList.includes(fileType);
|
|
42
|
+
}
|
|
43
|
+
return true;
|
|
44
|
+
};
|
|
45
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
46
|
+
0 && (module.exports = {
|
|
47
|
+
checkFileType,
|
|
48
|
+
compressImg,
|
|
49
|
+
downloadFile
|
|
50
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
|
|
16
|
+
// src/Utils/index.ts
|
|
17
|
+
var Utils_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(Utils_exports);
|
|
19
|
+
__reExport(Utils_exports, require("./common"), module.exports);
|
|
20
|
+
__reExport(Utils_exports, require("./file"), module.exports);
|
|
21
|
+
__reExport(Utils_exports, require("./url"), module.exports);
|
|
22
|
+
__reExport(Utils_exports, require("./wx"), module.exports);
|
|
23
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
24
|
+
0 && (module.exports = {
|
|
25
|
+
...require("./common"),
|
|
26
|
+
...require("./file"),
|
|
27
|
+
...require("./url"),
|
|
28
|
+
...require("./wx")
|
|
29
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getUrlParams: (str?: string) => any;
|
package/lib/Utils/url.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/Utils/url.ts
|
|
20
|
+
var url_exports = {};
|
|
21
|
+
__export(url_exports, {
|
|
22
|
+
getUrlParams: () => getUrlParams
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(url_exports);
|
|
25
|
+
var getUrlParams = (str) => {
|
|
26
|
+
let paramsStr = location.search;
|
|
27
|
+
if (typeof str === "string") {
|
|
28
|
+
if (str.startsWith("http")) {
|
|
29
|
+
const url = new URL(str);
|
|
30
|
+
paramsStr = url.search;
|
|
31
|
+
} else {
|
|
32
|
+
paramsStr = str;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
const searchParams = new URLSearchParams(paramsStr);
|
|
36
|
+
const params = {};
|
|
37
|
+
for (let v of searchParams.entries()) {
|
|
38
|
+
params[v[0]] = v[1];
|
|
39
|
+
}
|
|
40
|
+
return params;
|
|
41
|
+
};
|
|
42
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
43
|
+
0 && (module.exports = {
|
|
44
|
+
getUrlParams
|
|
45
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const isWechat: boolean;
|
|
2
|
+
export interface WxSDKOption {
|
|
3
|
+
debug?: boolean;
|
|
4
|
+
appId: string;
|
|
5
|
+
timestamp: string;
|
|
6
|
+
nonceStr: string;
|
|
7
|
+
signature: string;
|
|
8
|
+
jsApiList: string[];
|
|
9
|
+
openTagList?: string[];
|
|
10
|
+
}
|
|
11
|
+
export declare const wxSDK: (option: WxSDKOption) => Promise<unknown>;
|
package/lib/Utils/wx.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/Utils/wx.ts
|
|
20
|
+
var wx_exports = {};
|
|
21
|
+
__export(wx_exports, {
|
|
22
|
+
isWechat: () => isWechat,
|
|
23
|
+
wxSDK: () => wxSDK
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(wx_exports);
|
|
26
|
+
var isWechat = navigator.userAgent.toLowerCase().includes("micromessenger");
|
|
27
|
+
var wxSDK = (option) => {
|
|
28
|
+
return new Promise((resolve, reject) => {
|
|
29
|
+
const { ...configOption } = option;
|
|
30
|
+
wx.config({ ...configOption });
|
|
31
|
+
wx.ready(function() {
|
|
32
|
+
resolve({ success: true });
|
|
33
|
+
});
|
|
34
|
+
wx.error(function(res) {
|
|
35
|
+
reject({
|
|
36
|
+
success: false,
|
|
37
|
+
message: res
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
43
|
+
0 && (module.exports = {
|
|
44
|
+
isWechat,
|
|
45
|
+
wxSDK
|
|
46
|
+
});
|
package/lib/index.d.ts
ADDED
package/lib/index.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/index.ts
|
|
31
|
+
var src_exports = {};
|
|
32
|
+
__export(src_exports, {
|
|
33
|
+
CurrentUser: () => import_CurrentUser.default,
|
|
34
|
+
Track: () => import_Track.default,
|
|
35
|
+
Utils: () => Utils
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(src_exports);
|
|
38
|
+
var import_CurrentUser = __toESM(require("./CurrentUser"));
|
|
39
|
+
var import_Track = __toESM(require("./Track"));
|
|
40
|
+
var Utils = __toESM(require("./Utils"));
|
|
41
|
+
__reExport(src_exports, require("./interfaces/currentUser.interface"), module.exports);
|
|
42
|
+
__reExport(src_exports, require("./interfaces/track.interface"), module.exports);
|
|
43
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
+
0 && (module.exports = {
|
|
45
|
+
CurrentUser,
|
|
46
|
+
Track,
|
|
47
|
+
Utils,
|
|
48
|
+
...require("./interfaces/currentUser.interface"),
|
|
49
|
+
...require("./interfaces/track.interface")
|
|
50
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type LocalRouteItemType = {
|
|
2
|
+
access?: string;
|
|
3
|
+
name?: string;
|
|
4
|
+
parentPath?: string;
|
|
5
|
+
path?: string;
|
|
6
|
+
routes?: LocalRouteItemType[];
|
|
7
|
+
};
|
|
8
|
+
export type AuthMenuItemType = {
|
|
9
|
+
logAction: any;
|
|
10
|
+
name: string;
|
|
11
|
+
meta?: {
|
|
12
|
+
title: string;
|
|
13
|
+
};
|
|
14
|
+
permission?: string;
|
|
15
|
+
children?: AuthMenuItemType[];
|
|
16
|
+
path?: string;
|
|
17
|
+
builtIn?: boolean;
|
|
18
|
+
};
|
|
19
|
+
export type MenuNameMapType = {
|
|
20
|
+
[key: string]: string;
|
|
21
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
|
|
15
|
+
// src/interfaces/currentUser.interface.ts
|
|
16
|
+
var currentUser_interface_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(currentUser_interface_exports);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface TrackConfig {
|
|
2
|
+
appId: string;
|
|
3
|
+
serverUrl?: string;
|
|
4
|
+
debug?: boolean;
|
|
5
|
+
autoReportError?: boolean;
|
|
6
|
+
userProfile?: UserProfile;
|
|
7
|
+
base?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare enum TrackTypeEnum {
|
|
10
|
+
error = "\u9519\u8BEF\u4FE1\u606F",
|
|
11
|
+
visit = "\u9875\u9762\u8BBF\u95EE",
|
|
12
|
+
event = "\u7528\u6237\u89E6\u53D1",
|
|
13
|
+
api = "\u63A5\u53E3\u89E6\u53D1"
|
|
14
|
+
}
|
|
15
|
+
export type TrackType = keyof typeof TrackTypeEnum;
|
|
16
|
+
export interface UserProfile {
|
|
17
|
+
userId: string;
|
|
18
|
+
userName: string;
|
|
19
|
+
}
|
|
20
|
+
export interface SystemProfile {
|
|
21
|
+
IMEI: string;
|
|
22
|
+
innerHeight: number;
|
|
23
|
+
innerWidth: number;
|
|
24
|
+
href: string;
|
|
25
|
+
systemTime: Date;
|
|
26
|
+
}
|
|
27
|
+
export interface CustomizeProfile {
|
|
28
|
+
content: string;
|
|
29
|
+
module: string;
|
|
30
|
+
[key: string]: any;
|
|
31
|
+
}
|
|
32
|
+
export interface ErrorProfile {
|
|
33
|
+
fileName: string;
|
|
34
|
+
message: string;
|
|
35
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/interfaces/track.interface.ts
|
|
20
|
+
var track_interface_exports = {};
|
|
21
|
+
__export(track_interface_exports, {
|
|
22
|
+
TrackTypeEnum: () => TrackTypeEnum
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(track_interface_exports);
|
|
25
|
+
var TrackTypeEnum = /* @__PURE__ */ ((TrackTypeEnum2) => {
|
|
26
|
+
TrackTypeEnum2["error"] = "错误信息";
|
|
27
|
+
TrackTypeEnum2["visit"] = "页面访问";
|
|
28
|
+
TrackTypeEnum2["event"] = "用户触发";
|
|
29
|
+
TrackTypeEnum2["api"] = "接口触发";
|
|
30
|
+
return TrackTypeEnum2;
|
|
31
|
+
})(TrackTypeEnum || {});
|
|
32
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
33
|
+
0 && (module.exports = {
|
|
34
|
+
TrackTypeEnum
|
|
35
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@yysports/tools",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "[](https://npmjs.org/package/antd-mix) [](https://npmjs.org/package/antd-mix)",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"main": "lib/index.js",
|
|
7
|
+
"module": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"lib"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "father build",
|
|
15
|
+
"build:watch": "father dev",
|
|
16
|
+
"dev": "dumi dev",
|
|
17
|
+
"docs:build": "dumi build",
|
|
18
|
+
"doctor": "father doctor",
|
|
19
|
+
"lint": "npm run lint:es && npm run lint:css",
|
|
20
|
+
"lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
|
|
21
|
+
"lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
|
|
22
|
+
"prepare": "husky install && dumi setup",
|
|
23
|
+
"prepublishOnly": "father doctor && npm run build",
|
|
24
|
+
"release": "npm run build && npm publish --registry https://registry.npmjs.org",
|
|
25
|
+
"start": "npm run dev"
|
|
26
|
+
},
|
|
27
|
+
"commitlint": {
|
|
28
|
+
"extends": [
|
|
29
|
+
"@commitlint/config-conventional"
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"lint-staged": {
|
|
33
|
+
"*.{md,json}": [
|
|
34
|
+
"prettier --write --no-error-on-unmatched-pattern"
|
|
35
|
+
],
|
|
36
|
+
"*.{css,less}": [
|
|
37
|
+
"stylelint --fix",
|
|
38
|
+
"prettier --write"
|
|
39
|
+
],
|
|
40
|
+
"*.{js,jsx}": [
|
|
41
|
+
"eslint --fix",
|
|
42
|
+
"prettier --write"
|
|
43
|
+
],
|
|
44
|
+
"*.{ts,tsx}": [
|
|
45
|
+
"eslint --fix",
|
|
46
|
+
"prettier --parser=typescript --write"
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"image-conversion": "^2.1.1",
|
|
51
|
+
"js-cookie": "^3.0.5",
|
|
52
|
+
"pako": "^2.1.0"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@ant-design/pro-components": "^2.7.10",
|
|
56
|
+
"@commitlint/cli": "^19.3.0",
|
|
57
|
+
"@commitlint/config-conventional": "^19.2.2",
|
|
58
|
+
"@types/js-cookie": "^3.0.6",
|
|
59
|
+
"@types/pako": "^2.0.3",
|
|
60
|
+
"@types/react": "^18.3.3",
|
|
61
|
+
"@types/react-dom": "^18.3.0",
|
|
62
|
+
"@umijs/lint": "^4.2.15",
|
|
63
|
+
"antd": "^5.18.3",
|
|
64
|
+
"dumi": "^2.3.8",
|
|
65
|
+
"eslint": "^9.5.0",
|
|
66
|
+
"father": "^4.4.4",
|
|
67
|
+
"husky": "^9.0.11",
|
|
68
|
+
"lint-staged": "^15.2.7",
|
|
69
|
+
"prettier": "^3.3.2",
|
|
70
|
+
"prettier-plugin-organize-imports": "^3.2.4",
|
|
71
|
+
"prettier-plugin-packagejson": "^2.5.0",
|
|
72
|
+
"react": "^18.3.1",
|
|
73
|
+
"react-dom": "^18.3.1",
|
|
74
|
+
"stylelint": "^16.6.1"
|
|
75
|
+
},
|
|
76
|
+
"peerDependencies": {
|
|
77
|
+
"react": ">=16.9.0",
|
|
78
|
+
"react-dom": ">=16.9.0"
|
|
79
|
+
},
|
|
80
|
+
"publishConfig": {
|
|
81
|
+
"access": "public"
|
|
82
|
+
},
|
|
83
|
+
"authors": [
|
|
84
|
+
"daiwenyu <wenyu.dai@qq.com> (https://github.com/daiwenyu)"
|
|
85
|
+
],
|
|
86
|
+
"directories": {
|
|
87
|
+
"doc": "docs",
|
|
88
|
+
"lib": "lib"
|
|
89
|
+
},
|
|
90
|
+
"repository": {
|
|
91
|
+
"type": "git",
|
|
92
|
+
"url": "git+https://github.com/daiwenyu/antd-mix.git"
|
|
93
|
+
},
|
|
94
|
+
"author": "",
|
|
95
|
+
"bugs": {
|
|
96
|
+
"url": "https://github.com/daiwenyu/antd-mix/issues"
|
|
97
|
+
},
|
|
98
|
+
"homepage": "https://github.com/daiwenyu/antd-mix#readme"
|
|
99
|
+
}
|