youtil 3.0.3 → 3.0.5
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/cjs/index.d.ts +1 -0
- package/cjs/index.js +1 -0
- package/cjs/other.d.ts +14 -0
- package/cjs/other.js +86 -0
- package/cjs/request.js +5 -2
- package/cjs/string.d.ts +42 -0
- package/cjs/string.js +108 -0
- package/docs/404.html +4 -4
- package/docs/api/functions/copyToClipboard/index.html +5 -5
- package/docs/api/functions/createEnum/index.html +5 -5
- package/docs/api/functions/decodeHtml/index.html +5 -5
- package/docs/api/functions/deepCopy/index.html +5 -5
- package/docs/api/functions/delParam/index.html +5 -5
- package/docs/api/functions/encodeHtml/index.html +5 -5
- package/docs/api/functions/formatDate/index.html +5 -5
- package/docs/api/functions/formatJson/index.html +17 -0
- package/docs/api/functions/getIdCardLastChar/index.html +16 -0
- package/docs/api/functions/getParam/index.html +6 -6
- package/docs/api/functions/getParamInt/index.html +5 -5
- package/docs/api/functions/getParams/index.html +6 -6
- package/docs/api/functions/getRandom/index.html +21 -0
- package/docs/api/functions/getRandomStr/index.html +16 -0
- package/docs/api/functions/hideLoading/index.html +5 -5
- package/docs/api/functions/initWindowMessage/index.html +5 -5
- package/docs/api/functions/parseDate/index.html +5 -5
- package/docs/api/functions/request/index.html +5 -5
- package/docs/api/functions/setParam/index.html +5 -5
- package/docs/api/functions/showLoading/index.html +5 -5
- package/docs/api/functions/sleep/index.html +6 -6
- package/docs/api/functions/toHump/index.html +18 -0
- package/docs/api/functions/toUnderline/index.html +16 -0
- package/docs/api/functions/toUrlParams/index.html +5 -5
- package/docs/api/functions/validateIdCard/index.html +16 -0
- package/docs/api/globals/index.html +5 -5
- package/docs/api/index.html +4 -4
- package/docs/api/interfaces/IRequestOptions/index.html +5 -5
- package/docs/api/interfaces/IShowLoadingConfig/index.html +5 -5
- package/docs/api/variables/Request/index.html +5 -5
- package/docs/api/variables/keyCodes/index.html +16 -0
- package/docs/assets/js/00078de9.10589ab0.js +1 -0
- package/docs/assets/js/04050071.a8002edc.js +1 -0
- package/docs/assets/js/08f709b9.20175186.js +1 -0
- package/docs/assets/js/094cfbf1.059dc44b.js +1 -0
- package/docs/assets/js/0c2147ef.2bfcc843.js +1 -0
- package/docs/assets/js/1501a739.9c46a1a0.js +1 -0
- package/docs/assets/js/1608b181.ee556934.js +1 -0
- package/docs/assets/js/1774.902f2e94.js +1 -0
- package/docs/assets/js/17896441.7fc5704e.js +1 -0
- package/docs/assets/js/194adc5f.096b8bfb.js +1 -0
- package/docs/assets/js/1be78505.71fee479.js +1 -0
- package/docs/assets/js/26a70007.2f9f1f09.js +1 -0
- package/docs/assets/js/2ac048f8.1f1f0188.js +1 -0
- package/docs/assets/js/2e314e38.bd93e1d2.js +1 -0
- package/docs/assets/js/{3b14ef11.8a4e53d0.js → 3b14ef11.f58d4bf4.js} +1 -1
- package/docs/assets/js/3ec39cd5.55864cc1.js +1 -0
- package/docs/assets/js/4638.9d9de9b8.js +2 -0
- package/docs/assets/js/479af78b.79861c79.js +1 -0
- package/docs/assets/js/5888.a314615c.js +2 -0
- package/docs/assets/js/66592e46.2632f241.js +1 -0
- package/docs/assets/js/{6bc50bd8.04bc4173.js → 6bc50bd8.c3b8079b.js} +1 -1
- package/docs/assets/js/7830.006c8eaa.js +1 -0
- package/docs/assets/js/7891b53e.f1a0b9c7.js +1 -0
- package/docs/assets/js/8b76e124.7c5e5eb2.js +1 -0
- package/docs/assets/js/901a7e9f.918395a0.js +1 -0
- package/docs/assets/js/9104954f.5585963d.js +1 -0
- package/docs/assets/js/92b7d874.503e9b92.js +1 -0
- package/docs/assets/js/9334cb7c.a3af00d3.js +1 -0
- package/docs/assets/js/935f2afb.6c90f018.js +1 -0
- package/docs/assets/js/969412eb.49b9b427.js +1 -0
- package/docs/assets/js/9be94766.21974141.js +1 -0
- package/docs/assets/js/9dd5329b.a634d68f.js +1 -0
- package/docs/assets/js/a0c44371.f387576d.js +1 -0
- package/docs/assets/js/ab2af742.1ab27925.js +1 -0
- package/docs/assets/js/b01f3e06.7955089a.js +1 -0
- package/docs/assets/js/ba6f0f15.a19814c2.js +1 -0
- package/docs/assets/js/ccb851b4.69f9aa12.js +1 -0
- package/docs/assets/js/d4323bca.58cb2228.js +1 -0
- package/docs/assets/js/d9f162ad.0b37af81.js +1 -0
- package/docs/assets/js/e2aa7f69.620e7b98.js +1 -0
- package/docs/assets/js/ef3f9d02.479dddf7.js +1 -0
- package/docs/assets/js/f4c916b9.107e0062.js +1 -0
- package/docs/assets/js/f7d87c57.b1f858d9.js +1 -0
- package/docs/assets/js/f97ec998.c74cdecd.js +1 -0
- package/docs/assets/js/f9953324.47131b26.js +1 -0
- package/docs/assets/js/{fc1c80db.a4a27e53.js → fc1c80db.e33d9024.js} +1 -1
- package/docs/assets/js/fdb649b1.5d0fff7c.js +1 -0
- package/docs/assets/js/main.98944413.js +2 -0
- package/docs/assets/js/runtime~main.91fe50fb.js +1 -0
- package/docs/demos/IcePkgDemo_doc_01_request_0/index.html +4 -4
- package/docs/demos/IcePkgDemo_doc_01_request_1/index.html +4 -4
- package/docs/demos/IcePkgDemo_doc_02_time_0/index.html +4 -4
- package/docs/demos/IcePkgDemo_doc_03_loading_0/index.html +4 -4
- package/docs/index.html +4 -4
- package/docs/loading/index.html +18 -18
- package/docs/request/index.html +32 -32
- package/docs/sitemap.xml +1 -1
- package/docs/time/index.html +18 -18
- package/es/index.mjs +1 -1
- package/esm/index.d.ts +1 -0
- package/esm/index.js +1 -0
- package/esm/other.d.ts +14 -0
- package/esm/other.js +85 -0
- package/esm/request.js +5 -2
- package/esm/string.d.ts +42 -0
- package/esm/string.js +106 -0
- package/package.json +1 -1
- package/umd/index.js +1 -1
- package/docs/assets/js/00078de9.8ef2d3f7.js +0 -1
- package/docs/assets/js/04050071.b97a3fb6.js +0 -1
- package/docs/assets/js/08f709b9.821aecb5.js +0 -1
- package/docs/assets/js/094cfbf1.723acfad.js +0 -1
- package/docs/assets/js/0c2147ef.5d631a86.js +0 -1
- package/docs/assets/js/1501a739.c696939c.js +0 -1
- package/docs/assets/js/1608b181.a9675760.js +0 -1
- package/docs/assets/js/17896441.6674ffec.js +0 -1
- package/docs/assets/js/194adc5f.57366992.js +0 -1
- package/docs/assets/js/1be78505.537008e6.js +0 -1
- package/docs/assets/js/2ac048f8.e05a6f25.js +0 -1
- package/docs/assets/js/2e314e38.7eb894e2.js +0 -1
- package/docs/assets/js/3ec39cd5.3e1ed37e.js +0 -1
- package/docs/assets/js/638.7a9f2ae8.js +0 -2
- package/docs/assets/js/66592e46.34825410.js +0 -1
- package/docs/assets/js/774.fa0d167d.js +0 -1
- package/docs/assets/js/7891b53e.a5f85ad9.js +0 -1
- package/docs/assets/js/830.d8724ce6.js +0 -1
- package/docs/assets/js/888.800281f1.js +0 -2
- package/docs/assets/js/8b76e124.68a54c9e.js +0 -1
- package/docs/assets/js/9104954f.ca7e3c49.js +0 -1
- package/docs/assets/js/92b7d874.e1a080ff.js +0 -1
- package/docs/assets/js/9334cb7c.66a7cdf1.js +0 -1
- package/docs/assets/js/935f2afb.a8948813.js +0 -1
- package/docs/assets/js/969412eb.8aa1e268.js +0 -1
- package/docs/assets/js/9be94766.62446f40.js +0 -1
- package/docs/assets/js/9dd5329b.6021b0dd.js +0 -1
- package/docs/assets/js/ab2af742.4d5a6a91.js +0 -1
- package/docs/assets/js/ba6f0f15.fe4f680c.js +0 -1
- package/docs/assets/js/ccb851b4.77e66cf9.js +0 -1
- package/docs/assets/js/d4323bca.c5953448.js +0 -1
- package/docs/assets/js/e2aa7f69.b5afb674.js +0 -1
- package/docs/assets/js/ef3f9d02.841c2fab.js +0 -1
- package/docs/assets/js/f7d87c57.cd1443f2.js +0 -1
- package/docs/assets/js/f97ec998.f42fc9cd.js +0 -1
- package/docs/assets/js/fdb649b1.c7a470c8.js +0 -1
- package/docs/assets/js/main.22cdf971.js +0 -2
- package/docs/assets/js/runtime~main.24bf2862.js +0 -1
- /package/docs/assets/js/{638.7a9f2ae8.js.LICENSE.txt → 4638.9d9de9b8.js.LICENSE.txt} +0 -0
- /package/docs/assets/js/{888.800281f1.js.LICENSE.txt → 5888.a314615c.js.LICENSE.txt} +0 -0
- /package/docs/assets/js/{main.22cdf971.js.LICENSE.txt → main.98944413.js.LICENSE.txt} +0 -0
package/docs/sitemap.xml
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1"><url><loc>https://your-docusaurus-test-site.com/demos/IcePkgDemo_doc_01_request_0</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/demos/IcePkgDemo_doc_01_request_1</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/demos/IcePkgDemo_doc_02_time_0</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/demos/IcePkgDemo_doc_03_loading_0</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/functions/copyToClipboard</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/functions/createEnum</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/functions/decodeHtml</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/functions/deepCopy</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/functions/delParam</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/functions/encodeHtml</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/functions/formatDate</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/functions/getParam</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/functions/getParamInt</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/functions/getParams</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/functions/hideLoading</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/functions/initWindowMessage</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/functions/parseDate</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/functions/request</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/functions/setParam</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/functions/showLoading</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/functions/sleep</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/functions/toUrlParams</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/globals</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/interfaces/IRequestOptions</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/interfaces/IShowLoadingConfig</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/variables/Request</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/loading</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/request</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/time</loc><changefreq>weekly</changefreq><priority>0.5</priority></url></urlset>
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1"><url><loc>https://your-docusaurus-test-site.com/demos/IcePkgDemo_doc_01_request_0</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/demos/IcePkgDemo_doc_01_request_1</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/demos/IcePkgDemo_doc_02_time_0</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/demos/IcePkgDemo_doc_03_loading_0</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/functions/copyToClipboard</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/functions/createEnum</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/functions/decodeHtml</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/functions/deepCopy</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/functions/delParam</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/functions/encodeHtml</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/functions/formatDate</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/functions/formatJson</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/functions/getIdCardLastChar</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/functions/getParam</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/functions/getParamInt</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/functions/getParams</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/functions/getRandom</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/functions/getRandomStr</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/functions/hideLoading</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/functions/initWindowMessage</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/functions/parseDate</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/functions/request</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/functions/setParam</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/functions/showLoading</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/functions/sleep</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/functions/toHump</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/functions/toUnderline</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/functions/toUrlParams</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/functions/validateIdCard</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/globals</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/interfaces/IRequestOptions</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/interfaces/IShowLoadingConfig</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/variables/keyCodes</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/api/variables/Request</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/loading</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/request</loc><changefreq>weekly</changefreq><priority>0.5</priority></url><url><loc>https://your-docusaurus-test-site.com/time</loc><changefreq>weekly</changefreq><priority>0.5</priority></url></urlset>
|
package/docs/time/index.html
CHANGED
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
<meta charset="UTF-8">
|
|
5
5
|
<meta name="generator" content="Docusaurus v2.4.3">
|
|
6
6
|
<title data-rh="true">测试 | youtil文档</title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:url" content="https://your-docusaurus-test-site.com/time"><meta data-rh="true" name="docusaurus_locale" content="zh-Hans"><meta data-rh="true" name="docsearch:language" content="zh-Hans"><meta data-rh="true" name="docusaurus_version" content="current"><meta data-rh="true" name="docusaurus_tag" content="docs-default-current"><meta data-rh="true" name="docsearch:version" content="current"><meta data-rh="true" name="docsearch:docusaurus_tag" content="docs-default-current"><meta data-rh="true" property="og:title" content="测试 | youtil文档"><link data-rh="true" rel="icon" href="https://img.alicdn.com/imgextra/i2/O1CN01jUf9ZP1aKwVvEc58W_!!6000000003312-73-tps-160-160.ico"><link data-rh="true" rel="canonical" href="https://your-docusaurus-test-site.com/time"><link data-rh="true" rel="alternate" href="https://your-docusaurus-test-site.com/time" hreflang="zh-Hans"><link data-rh="true" rel="alternate" href="https://your-docusaurus-test-site.com/time" hreflang="x-default"><link rel="stylesheet" href="/assets/css/styles.077146e6.css">
|
|
7
|
-
<link rel="preload" href="/assets/js/runtime~main.
|
|
8
|
-
<link rel="preload" href="/assets/js/main.
|
|
7
|
+
<link rel="preload" href="/assets/js/runtime~main.91fe50fb.js" as="script">
|
|
8
|
+
<link rel="preload" href="/assets/js/main.98944413.js" as="script">
|
|
9
9
|
</head>
|
|
10
10
|
<body class="navigation-with-keyboard">
|
|
11
11
|
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"light")}()</script><div id="__docusaurus">
|
|
12
|
-
<div role="region" aria-label="跳到主要内容"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">跳到主要内容</a></div><nav aria-label="主导航" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><a class="navbar__brand" href="/"><div class="navbar__logo"><img src="/static/1.jpg" alt="" class="themedImage_ToTc themedImage--light_HNdA"><img src="/static/1.jpg" alt="" class="themedImage_ToTc themedImage--dark_i4oU"></div><b class="navbar__title text--truncate">youtil (油梯)</b></a></div><div class="navbar__items navbar__items--right"><div class="toggle_vylO colorModeToggle_DEke"><button class="clean-btn toggleButton_gllP toggleButtonDisabled_aARS" type="button" disabled="" title="切换浅色/暗黑模式(当前为浅色模式)" aria-label="切换浅色/暗黑模式(当前为浅色模式)" aria-live="polite"><svg viewBox="0 0 24 24" width="24" height="24" class="lightToggleIcon_pyhR"><path fill="currentColor" d="M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"></path></svg><svg viewBox="0 0 24 24" width="24" height="24" class="darkToggleIcon_wfgR"><path fill="currentColor" d="M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"></path></svg></button></div><div class="searchBox_ZlJk"></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="回到顶部" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="文档侧边栏" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/">首页</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/request">request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" href="/time">测试</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/loading">loading</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/api/">README</a><button aria-label="打开/收起侧边栏菜单「README」" type="button" class="clean-btn menu__caret"></button></div></li></ul></nav></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="页面路径"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="主页面" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">测试</span><meta itemprop="position" content="1"></li></ul></nav><div class="theme-doc-markdown markdown"><h1>测试</h1><div><div class="container_jJsY unfoldContainer_TzKO"><div class="preview_yMOi"></div><div class="__react_component_tooltip
|
|
13
|
-
.
|
|
12
|
+
<div role="region" aria-label="跳到主要内容"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">跳到主要内容</a></div><nav aria-label="主导航" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><a class="navbar__brand" href="/"><div class="navbar__logo"><img src="/static/1.jpg" alt="" class="themedImage_ToTc themedImage--light_HNdA"><img src="/static/1.jpg" alt="" class="themedImage_ToTc themedImage--dark_i4oU"></div><b class="navbar__title text--truncate">youtil (油梯)</b></a></div><div class="navbar__items navbar__items--right"><div class="toggle_vylO colorModeToggle_DEke"><button class="clean-btn toggleButton_gllP toggleButtonDisabled_aARS" type="button" disabled="" title="切换浅色/暗黑模式(当前为浅色模式)" aria-label="切换浅色/暗黑模式(当前为浅色模式)" aria-live="polite"><svg viewBox="0 0 24 24" width="24" height="24" class="lightToggleIcon_pyhR"><path fill="currentColor" d="M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"></path></svg><svg viewBox="0 0 24 24" width="24" height="24" class="darkToggleIcon_wfgR"><path fill="currentColor" d="M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"></path></svg></button></div><div class="searchBox_ZlJk"></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="回到顶部" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="文档侧边栏" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/">首页</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/request">request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" href="/time">测试</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/loading">loading</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/api/">README</a><button aria-label="打开/收起侧边栏菜单「README」" type="button" class="clean-btn menu__caret"></button></div></li></ul></nav></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="页面路径"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="主页面" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">测试</span><meta itemprop="position" content="1"></li></ul></nav><div class="theme-doc-markdown markdown"><h1>测试</h1><div><div class="container_jJsY unfoldContainer_TzKO"><div class="preview_yMOi"></div><div class="__react_component_tooltip tdf7acefc-75d6-4ee9-bc79-3fd3c5b28a68 place-top type-dark" id="tdf7acefc-75d6-4ee9-bc79-3fd3c5b28a68" data-id="tooltip"><style aria-hidden="true">
|
|
13
|
+
.tdf7acefc-75d6-4ee9-bc79-3fd3c5b28a68 {
|
|
14
14
|
color: #fff;
|
|
15
15
|
background: #222;
|
|
16
16
|
border: 1px solid transparent;
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
padding: 8px 21px;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
.
|
|
21
|
+
.tdf7acefc-75d6-4ee9-bc79-3fd3c5b28a68.place-top {
|
|
22
22
|
margin-top: -10px;
|
|
23
23
|
}
|
|
24
|
-
.
|
|
24
|
+
.tdf7acefc-75d6-4ee9-bc79-3fd3c5b28a68.place-top::before {
|
|
25
25
|
content: "";
|
|
26
26
|
background-color: inherit;
|
|
27
27
|
position: absolute;
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
width: 20px;
|
|
30
30
|
height: 12px;
|
|
31
31
|
}
|
|
32
|
-
.
|
|
32
|
+
.tdf7acefc-75d6-4ee9-bc79-3fd3c5b28a68.place-top::after {
|
|
33
33
|
content: "";
|
|
34
34
|
position: absolute;
|
|
35
35
|
width: 10px;
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
transform: rotate(135deg);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
.
|
|
47
|
+
.tdf7acefc-75d6-4ee9-bc79-3fd3c5b28a68.place-bottom {
|
|
48
48
|
margin-top: 10px;
|
|
49
49
|
}
|
|
50
|
-
.
|
|
50
|
+
.tdf7acefc-75d6-4ee9-bc79-3fd3c5b28a68.place-bottom::before {
|
|
51
51
|
content: "";
|
|
52
52
|
background-color: inherit;
|
|
53
53
|
position: absolute;
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
width: 18px;
|
|
56
56
|
height: 10px;
|
|
57
57
|
}
|
|
58
|
-
.
|
|
58
|
+
.tdf7acefc-75d6-4ee9-bc79-3fd3c5b28a68.place-bottom::after {
|
|
59
59
|
content: "";
|
|
60
60
|
position: absolute;
|
|
61
61
|
width: 10px;
|
|
@@ -70,10 +70,10 @@
|
|
|
70
70
|
transform: rotate(45deg);
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
.
|
|
73
|
+
.tdf7acefc-75d6-4ee9-bc79-3fd3c5b28a68.place-left {
|
|
74
74
|
margin-left: -10px;
|
|
75
75
|
}
|
|
76
|
-
.
|
|
76
|
+
.tdf7acefc-75d6-4ee9-bc79-3fd3c5b28a68.place-left::before {
|
|
77
77
|
content: "";
|
|
78
78
|
background-color: inherit;
|
|
79
79
|
position: absolute;
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
width: 10px;
|
|
82
82
|
height: 18px;
|
|
83
83
|
}
|
|
84
|
-
.
|
|
84
|
+
.tdf7acefc-75d6-4ee9-bc79-3fd3c5b28a68.place-left::after {
|
|
85
85
|
content: "";
|
|
86
86
|
position: absolute;
|
|
87
87
|
width: 10px;
|
|
@@ -96,10 +96,10 @@
|
|
|
96
96
|
transform: rotate(45deg);
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
.
|
|
99
|
+
.tdf7acefc-75d6-4ee9-bc79-3fd3c5b28a68.place-right {
|
|
100
100
|
margin-left: 10px;
|
|
101
101
|
}
|
|
102
|
-
.
|
|
102
|
+
.tdf7acefc-75d6-4ee9-bc79-3fd3c5b28a68.place-right::before {
|
|
103
103
|
content: "";
|
|
104
104
|
background-color: inherit;
|
|
105
105
|
position: absolute;
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
width: 10px;
|
|
108
108
|
height: 18px;
|
|
109
109
|
}
|
|
110
|
-
.
|
|
110
|
+
.tdf7acefc-75d6-4ee9-bc79-3fd3c5b28a68.place-right::after {
|
|
111
111
|
content: "";
|
|
112
112
|
position: absolute;
|
|
113
113
|
width: 10px;
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
transform: rotate(-135deg);
|
|
123
123
|
}
|
|
124
124
|
</style></div><div class="operations_Fpkw"><div class="item_b5wY" data-tip="复制"><svg viewBox="0 0 20 20" focusable="false" data-icon="snippets" width="20px" height="20px" fill="currentColor" aria-hidden="true"><path d="M15,5 L15,18 L2,18 L2,5 L15,5 Z M14,6 L3,6 L3,17 L14,17 L14,6 Z M18,2 L18,15 L16,15 L16,13.999 L17,14 L17,3 L6,3 L6,4 L5,4 L5,2 L18,2 Z M9,8 L9,11 L12,11 L12,12 L9,12 L9,15 L8,15 L8,12 L5,12 L5,11 L8,11 L8,8 L9,8 Z"></path></svg></div><div class="item_b5wY" data-tip="展开"><svg width="20px" height="20px" viewBox="0 0 20 20" fill="currentColor"><path d="M14.4307124,13.5667899 L15.1349452,14.276759 L10.7473676,18.6288871 L6.42783259,14.2738791 L7.13782502,13.5696698 L10.7530744,17.2147744 L14.4307124,13.5667899 Z M4.79130753,8.067524 L16.3824174,11.1733525 L16.1235984,12.1392784 L4.53248848,9.03344983 L4.79130753,8.067524 Z M10.8154102,1.57503552 L15.1349452,5.93004351 L14.4249528,6.63425282 L10.809949,2.98914817 L7.13206544,6.6371327 L6.42783259,5.92716363 L10.8154102,1.57503552 Z" transform="translate(10.457453, 10.101961) rotate(90.000000) translate(-10.457453, -10.101961) "></path></svg></div></div></div><div class="codeWrapper_udwJ"></div></div></div></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="文件选项卡"><a class="pagination-nav__link pagination-nav__link--prev" href="/request"><div class="pagination-nav__sublabel">上一页</div><div class="pagination-nav__label">request</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/loading"><div class="pagination-nav__sublabel">下一页</div><div class="pagination-nav__label">loading</div></a></nav></div></div></div></div></main></div></div></div>
|
|
125
|
-
<script src="/assets/js/runtime~main.
|
|
126
|
-
<script src="/assets/js/main.
|
|
125
|
+
<script src="/assets/js/runtime~main.91fe50fb.js"></script>
|
|
126
|
+
<script src="/assets/js/main.98944413.js"></script>
|
|
127
127
|
</body>
|
|
128
128
|
</html>
|
package/es/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,a as n,b as t,c as r,d as o}from"./bb1b9025.esm.es5.production.mjs";function a(n){var t=e(n);return n.forEach(function(e){t[e.key]=e.value}),t.pick=function(e){return n.find(function(n){return n.key===e||n.value===e})},t.pickLabel=function(e){var n;return null===(n=t.pick(e))||void 0===n?void 0:n.label},t.pickValue=function(e){var n;return null===(n=t.pick(e))||void 0===n?void 0:n.value},t.pickKey=function(e){var n;return null===(n=t.pick(e))||void 0===n?void 0:n.key},t}var c=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"请稍候",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=(t=Object.assign({},{hasMask:!1,maskColor:"#00000070",onCancel:null,cancelInline:!1,id:"com_global_page_loading"},t)).id,o=t.hasMask,a=t.maskColor,c=t.onCancel,s=t.cancelInline,l="_".concat(r,"_timeout");window[l]&&clearTimeout(window[l]);var u=document.getElementById(r);u||((u=document.createElement("div")).id=r,u.className=r,document.body.append(u));var d="".concat(r,"_style");if(!document.getElementById(d)){var f=document.createElement("style");f.id=d,f.innerHTML="\n .".concat(r," {\n position: fixed;\n left: 0;\n top: 0;\n width: 100vw;\n height: 100vh;\n display: flex;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n z-index: 10000;\n }\n .").concat(r,".show-mask {\n pointer-events: unset;\n background: #00000070;\n }\n .").concat(r," .mask-wrapper {\n position: fixed;\n }\n .").concat(r," .loading-wrapper {\n width: 120px;\n height: 120px;\n z-index: 8000;\n background: rgba(0, 0, 0, 0.6);\n border-radius: 8px;\n text-align: center;\n color: white;\n display: flex;\n justify-content: center;\n flex-direction: column;\n align-items: center;\n pointer-events: initial;\n line-height: 1.3;\n }\n .").concat(r," .loading-wrapper img {\n width: 50px;\n height: 50px;\n margin-bottom: 10px;\n }\n .").concat(r," .loading-wrapper a {\n color: #6ab2ff;\n }"),document.head.appendChild(f)}if(u.innerHTML='\n <div class="loading-wrapper">\n <img src="https://img.alicdn.com/tfs/TB1bnUsQBLoK1RjSZFuXXXn0XXa-32-32.svg" alt="加载中">\n <div>\n <span>'.concat(e,"</span>\n ").concat(s?"":"<br />","\n ").concat(c?'<a href="javascript:;" class="cancel">取消</a>':"","\n </div>\n </div>"),c){var p=u.querySelector(".cancel");p&&p.addEventListener("click",function(){i(),c()})}u.addEventListener("click",function(){i()}),u.style.display="flex",u.style.background=o?a:"transparent",u.className="".concat(r," ").concat(o?"show-mask":""),n>0&&(window[l]=setTimeout(function(){i()},1e3*n))},i=function(){var e=document.getElementById("com_global_page_loading");e&&(e.style.display="none")};function s(r,o){o||window===window.parent||(o=window.parent),!o&&window.opener&&(o=window.opener);var a,c=new Map,i=new Map,s=function(){return Math.random().toString(36).substring(2)},l={},u="_local_function_",d=function(e,n){return(null==e?void 0:e.map(function(e){if("object"==typeof e)for(var t in e)e[t]=n(e[t]);return n(e)}))||[]};function f(e){for(var n=arguments.length,t=Array(n>1?n-1:0),a=1;a<n;a++)t[a-1]=arguments[a];if(!o){console.warn("TargetWindow is null.");return}return new Promise(function(n,a){var i=s();c.set(i,{resolve:n,reject:a}),o.postMessage({scene:r,type:"event",eventName:e,payload:d(t,function(e){var n;return"function"==typeof e?(l[n="".concat(u).concat(s())]=e,n):e}),callbackId:i},"*")})}function p(e,n){i.has(e)||i.set(e,[]),i.get(e).push(n)}return window.addEventListener("message",(a=n(function(n){var a,s,l,p,g,v,m,h,y,w,b,x,M;return t(this,function(t){switch(t.label){case 0:if(!n.data||n.data.scene!==r)return[2];if(o=n.source,s=(a=n.data).type,l=a.eventName,p=a.payload,g=a.callbackId,"event"!==s)return[3,6];v=d(p,function(n){if("string"==typeof n&&n.startsWith(u)){var t="getFn_".concat(n);return function(){for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];return f.apply(void 0,["executeLocalFunction",t].concat(e(r)))}}return n}),m=i.get(l)||[],h=i.get("*")||[],t.label=1;case 1:return t.trys.push([1,4,,5]),[4,Promise.all(m.map(function(n){return Promise.resolve(n.apply(void 0,e(v)))}))];case 2:return y=t.sent(),[4,Promise.all(h.map(function(n){return Promise.resolve(n.apply(void 0,[l].concat(e(v))))}))];case 3:if(w=t.sent(),g){if(b=y[y.length-1]||w[w.length-1],!m.length&&!b)return[2];o.postMessage({scene:r,type:"callback",callbackId:g,payload:b},"*")}return[3,5];case 4:return console.error(x=t.sent()),g&&o.postMessage({scene:r,type:"callback",callbackId:g,error:x||"unknown error"},"*"),[3,5];case 5:return[3,7];case 6:"callback"===s&&g&&(M=c.get(g))&&(n.data.error?M.reject(n.data.error):M.resolve(n.data.payload),c.delete(g)),t.label=7;case 7:return[2]}})}),function(e){return a.apply(this,arguments)})),p("executeLocalFunction",function(n){for(var t=arguments.length,r=Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];if(!l[n=(null==n?void 0:n.replace("getFn_",""))||""])throw Error("未找到本地缓存方法:".concat(n));return l[n].apply(l,e(r))}),f("auto-connect"),{postMessage:f,onMessage:p}}var l=function(e){return e&&"object"==typeof e?JSON.parse(JSON.stringify(e)):e},u=function(e){if("string"==typeof e){var n=document.createElement("div");return n.innerText=e,n.innerHTML}if("object"==typeof e&&e)for(var t in e)e[t]=u(e[t]);return e},d=function(e){if("string"==typeof e){var n=document.createElement("div");return n.innerHTML=e,n.innerText}if("object"==typeof e&&e)for(var t in e)e[t]=d(e[t]);return e},f=function(e,n,t){if(!e)throw Error("text can not be empty.");return(n=n||function(e){return console.error("复制到剪贴板失败:".concat(e||""))},navigator.clipboard&&!t)?navigator.clipboard.writeText(e).catch(function(e){throw n(e.message),e}):new Promise(function(t,r){var o=document.createElement("input");o.value=e,o.style.cssText="position:fixed;left:0;top:0;opacity:0;",document.body.appendChild(o),o.select();try{if(document.execCommand("copy"))t();else{var a="Failed to execute 'document.execCommand'.";n(a),r(Error(a))}}catch(e){n(e.message),r(e)}finally{document.body.removeChild(o)}})},p=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:location.search;return(RegExp("(^|\\?|&)".concat(e,"=(.*?)(?=&|#|$)"),"g").exec(n)||[])[2]},g=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:location.search;return parseInt(p(e,n)||"0",10)},v=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:location.search,n=((e||"").split("?").pop()||"").split("#")[0]||"",t={};return n.split("&").map(function(e){return e.split("=")}).forEach(function(e){var n=r(e,2),o=n[0],a=n[1];t[o]=a||""}),t},m=function(e,n,t){if(void 0!==p(e,t=t||"".concat(location.pathname).concat(location.search)))return t.replace(RegExp("(^|\\?|&)".concat(e,"=(.*?)(?=&|#|$)"),"g"),"$1".concat(e,"=").concat(n));var o=r(t.split("#"),2),a=o[0],c=o[1];return"".concat(a).concat(0>a.indexOf("?")?"?":"&").concat(e,"=").concat(n).concat(c?"#":"").concat(c||"")},h=function(e,n){return(n=n||"".concat(location.pathname).concat(location.search)).replace(RegExp("(^|\\?|&)".concat(e,"=.*?(&|#|$)"),"g"),function(e,n,t){return"&"===t?n:t})},y=function(e){return Object.keys(e||{}).filter(function(n){return void 0!==e[n]}).map(function(n){var t="object"==typeof e[n]?JSON.stringify(e[n]):e[n];return"".concat(encodeURIComponent(n),"=").concat(encodeURIComponent(t))}).join("&")},w=function(e,n){var t=Object.assign({},(null==e?void 0:e.headers)||{},(null==n?void 0:n.headers)||{}),r=Object.assign({},(null==e?void 0:e.fetchOptions)||{},(null==n?void 0:n.fetchOptions)||{});return Object.assign({},e||{},n||{},{headers:t,fetchOptions:r})},b=function(){var e=n(function(e,n){var r,a,c,i,s,l,u,d,f,p,g,v,m,h,b,x,M,k,E;return t(this,function(t){switch(t.label){case 0:if(a=(r=(n=w({errorMessage:"系统繁忙,请稍后再试",errorHandler:function(e){if(!(null==n?void 0:n.silent)){var t;null==n||null===(t=n.toastHandler)||void 0===t||t.call(n,e)}throw Error(e)},baseUrl:"",headers:{},fetchOptions:{credentials:"include"},checkSuccess:function(e){return(null==e?void 0:e.code)==0||(null==e?void 0:e.code)==200},toastHandler:function(e){return console.error("[您还没有配置toastHandler,请根据您的UI组件库配置合适的提示方法] ".concat(e||""))},onFetchResponse:function(e){if(200===e.status)return e.json();var n={code:e.status,status:e.status,message:e.statusText,headers:e.headers,_response:e},t=Error(n.message);throw t.response=n,t}},n))||{}).params,c=r.data,i=r.formData,s=r.json,l=r.method,u=r.headers,d=r.baseUrl,f=r.fetchOptions,p=r.checkSuccess,g=r.afterRequest,v=r.errorHandler,m=r.errorMessage,h=r.responseConverter,b=r.onFetchResponse,f.headers=o({},u||{},f.headers||{}),a&&(f.method=l||"GET",e="".concat(e).concat(e.indexOf("?")>=0?"&":"?").concat(y(a))),c)Object.assign(f,{method:l||"POST",body:y(c),headers:o({"Content-Type":"application/x-www-form-urlencoded;charset=utf-8"},f.headers||{})});else if(i){if(x=i,!(i instanceof FormData))for(var O in x=new FormData,i)x.append(O,i[O]);Object.assign(f,{method:l||"POST",body:x})}else s&&Object.assign(f,{method:l||"POST",body:JSON.stringify(s),headers:o({"Content-Type":"application/json;charset=utf-8"},f.headers||{})});M=null,t.label=1;case 1:return t.trys.push([1,3,,4]),[4,fetch("".concat((null==e?void 0:e.indexOf("http"))===0?"":d||"").concat(e),f).then(b)];case 2:return M=t.sent(),[3,4];case 3:return console.error(k=t.sent()),null==g||g(!1,{message:null==k?void 0:k.message}),null==v||v((null===(E=k.response)||void 0===E?void 0:E.message)||m||"",k.response),[2,void 0];case 4:if(M=h?h(M):M,null==p?void 0:p(M))return null==g||g(!0,M),[2,M.data];return null==g||g(!1,M),null==v||v(M.message||M.msg||m||"",M),[2,void 0]}})});return function(n,t){return e.apply(this,arguments)}}(),x=function(e){var n=w(this.overrideDefaultOptions,e),t=function(e,t){return b(e,w(n,t))};return t.overrideDefaultOptions=n,t.create=x.bind(t),t};b.create=x.bind(b);var M=function(e,n){var t=n;return n||(t=e,e=b),function(n,r){return e(n,o({},t||{},r||{}))}},k=function(e,n){var t=function(e){n=n.replace(RegExp("".concat(e,"+"),"g"),function(n){var t="".concat(r[e]);if("w"===e)return"".concat(n.length>2?"星期":"周").concat(o[t]);for(var a=0,c=t.length;a<n.length-c;a++)t="0".concat(t);return 1===n.length?t:t.substring(t.length-n.length)})};if(!e)return"";if("number"==typeof e)e=new Date(e);else if("string"==typeof e){if(/^\d{12,13}$/g.test(e))e=new Date(parseInt(e,10));else{if(!/^.{10}T.{8,12}Z?$/g.test(e))return e;e=new Date(e)}}if(!(e instanceof Date))throw Error("formatDate error: not date.");if(isNaN(null==e?void 0:e.getFullYear()))throw Error("formatDate error: invalid date.");n=n||"yyyy-MM-dd HH:mm:ss";var r={y:e.getFullYear(),M:e.getMonth()+1,d:e.getDate(),q:Math.floor((e.getMonth()+3)/3),w:e.getDay(),H:e.getHours(),h:e.getHours()%12==0?12:e.getHours()%12,m:e.getMinutes(),s:e.getSeconds(),S:e.getMilliseconds()},o=["天","一","二","三","四","五","六"];for(var a in r)t(a);return n},E=function(e,n){var t={y:0,M:1,d:0,H:0,h:0,m:0,s:0,S:0};(n=n||"yyyy-MM-dd").replace(/([^yMdHmsS]*?)(([yMdHmsS])\3*)([^yMdHmsS]*?)/g,function(n,r,o,a,c){return e=e.replace(RegExp("".concat(r,"(\\d{").concat(o.length,"})").concat(c)),function(e,n){return t[a]=parseInt(n,10),""}),""}),t.M--;var r=new Date(t.y,t.M,t.d,t.H,t.m,t.s);return 0!==t.S&&r.setMilliseconds(t.S),r},O=function(e){return new Promise(function(n){return setTimeout(n,e||0)})};export{M as Request,f as copyToClipboard,a as createEnum,d as decodeHtml,l as deepCopy,h as delParam,u as encodeHtml,k as formatDate,p as getParam,g as getParamInt,v as getParams,i as hideLoading,s as initWindowMessage,E as parseDate,b as request,m as setParam,c as showLoading,O as sleep,y as toUrlParams};
|
|
1
|
+
import{_ as _toConsumableArray,a as _asyncToGenerator,b as __generator,c as _slicedToArray,d as _objectSpread}from"./bb1b9025.esm.es5.production.mjs";function createEnum(n){var e=_toConsumableArray(n);return n.forEach(function(n){e[n.key]=n.value}),e.pick=function(e){return n.find(function(n){return n.key===e||n.value===e})},e.pickLabel=function(n){var t;return null===(t=e.pick(n))||void 0===t?void 0:t.label},e.pickValue=function(n){var t;return null===(t=e.pick(n))||void 0===t?void 0:t.value},e.pickKey=function(n){var t;return null===(t=e.pick(n))||void 0===t?void 0:t.key},e}var showLoading=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"请稍候",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=(t=Object.assign({},{hasMask:!1,maskColor:"#00000070",onCancel:null,cancelInline:!1,id:"com_global_page_loading"},t)).id,o=t.hasMask,a=t.maskColor,c=t.onCancel,i=t.cancelInline,s="_".concat(r,"_timeout");window[s]&&clearTimeout(window[s]);var l=document.getElementById(r);l||((l=document.createElement("div")).id=r,l.className=r,document.body.append(l));var u="".concat(r,"_style");if(!document.getElementById(u)){var d=document.createElement("style");d.id=u,d.innerHTML="\n .".concat(r," {\n position: fixed;\n left: 0;\n top: 0;\n width: 100vw;\n height: 100vh;\n display: flex;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n z-index: 10000;\n }\n .").concat(r,".show-mask {\n pointer-events: unset;\n background: #00000070;\n }\n .").concat(r," .mask-wrapper {\n position: fixed;\n }\n .").concat(r," .loading-wrapper {\n width: 120px;\n height: 120px;\n z-index: 8000;\n background: rgba(0, 0, 0, 0.6);\n border-radius: 8px;\n text-align: center;\n color: white;\n display: flex;\n justify-content: center;\n flex-direction: column;\n align-items: center;\n pointer-events: initial;\n line-height: 1.3;\n }\n .").concat(r," .loading-wrapper img {\n width: 50px;\n height: 50px;\n margin-bottom: 10px;\n }\n .").concat(r," .loading-wrapper a {\n color: #6ab2ff;\n }"),document.head.appendChild(d)}if(l.innerHTML='\n <div class="loading-wrapper">\n <img src="https://img.alicdn.com/tfs/TB1bnUsQBLoK1RjSZFuXXXn0XXa-32-32.svg" alt="加载中">\n <div>\n <span>'.concat(n,"</span>\n ").concat(i?"":"<br />","\n ").concat(c?'<a href="javascript:;" class="cancel">取消</a>':"","\n </div>\n </div>"),c){var f=l.querySelector(".cancel");f&&f.addEventListener("click",function(){hideLoading(),c()})}l.addEventListener("click",function(){hideLoading()}),l.style.display="flex",l.style.background=o?a:"transparent",l.className="".concat(r," ").concat(o?"show-mask":""),e>0&&(window[s]=setTimeout(function(){hideLoading()},1e3*e))},hideLoading=function(){var n="com_global_page_loading",e=document.getElementById(n);e&&(e.style.display="none")};function initWindowMessage(n,e){e||window===window.parent||(e=window.parent),!e&&window.opener&&(e=window.opener);var t=new Map,r=new Map,o=function(){return Math.random().toString(36).substring(2)},a={},c="_local_function_";function i(n){var e="".concat(c).concat(o());return a[e]=n,e}var s=function(n,e){return(null==n?void 0:n.map(function(n){if("object"==typeof n)for(var t in n)n[t]=e(n[t]);return e(n)}))||[]};function l(r){for(var a=arguments.length,c=Array(a>1?a-1:0),l=1;l<a;l++)c[l-1]=arguments[l];if(!e){console.warn("TargetWindow is null.");return}return new Promise(function(a,l){var u=o();t.set(u,{resolve:a,reject:l}),e.postMessage({scene:n,type:"event",eventName:r,payload:s(c,function(n){return"function"==typeof n?i(n):n}),callbackId:u},"*")})}function u(n,e){r.has(n)||r.set(n,[]),r.get(n).push(e)}return window.addEventListener("message",function(){var o=_asyncToGenerator(function(o){var a,i,u,d,f,p,v,g,h,m,y,b,w;return __generator(this,function(M){switch(M.label){case 0:if(!o.data||o.data.scene!==n)return[2];if(e=o.source,i=(a=o.data).type,u=a.eventName,d=a.payload,f=a.callbackId,"event"!==i)return[3,6];p=s(d,function(n){if("string"==typeof n&&n.startsWith(c)){var e="getFn_".concat(n);return function(){for(var n=arguments.length,t=Array(n),r=0;r<n;r++)t[r]=arguments[r];return l.apply(void 0,["executeLocalFunction",e].concat(_toConsumableArray(t)))}}return n}),v=r.get(u)||[],g=r.get("*")||[],M.label=1;case 1:return M.trys.push([1,4,,5]),[4,Promise.all(v.map(function(n){return Promise.resolve(n.apply(void 0,_toConsumableArray(p)))}))];case 2:return h=M.sent(),[4,Promise.all(g.map(function(n){return Promise.resolve(n.apply(void 0,[u].concat(_toConsumableArray(p))))}))];case 3:if(m=M.sent(),f){if(y=h[h.length-1]||m[m.length-1],!v.length&&!y)return[2];e.postMessage({scene:n,type:"callback",callbackId:f,payload:y},"*")}return[3,5];case 4:return console.error(b=M.sent()),f&&e.postMessage({scene:n,type:"callback",callbackId:f,error:b||"unknown error"},"*"),[3,5];case 5:return[3,7];case 6:"callback"===i&&f&&(w=t.get(f))&&(o.data.error?w.reject(o.data.error):w.resolve(o.data.payload),t.delete(f)),M.label=7;case 7:return[2]}})});return function(n){return o.apply(this,arguments)}}()),u("executeLocalFunction",function(n){for(var e,t=arguments.length,r=Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];if(!a[n=(null==n?void 0:n.replace("getFn_",""))||""])throw Error("未找到本地缓存方法:".concat(n));return(e=a)[n].apply(e,_toConsumableArray(r))}),l("auto-connect"),{postMessage:l,onMessage:u}}var deepCopy=function(n){return n&&"object"==typeof n?JSON.parse(JSON.stringify(n)):n},encodeHtml=function(n){if("string"==typeof n){var e=document.createElement("div");return e.innerText=n,e.innerHTML}if("object"==typeof n&&n)for(var t in n)n[t]=encodeHtml(n[t]);return n},decodeHtml=function(n){if("string"==typeof n){var e=document.createElement("div");return e.innerHTML=n,e.innerText}if("object"==typeof n&&n)for(var t in n)n[t]=decodeHtml(n[t]);return n},copyToClipboard=function(n,e,t){if(!n)throw Error("text can not be empty.");return(e=e||function(n){return console.error("复制到剪贴板失败:".concat(n||""))},navigator.clipboard&&!t)?navigator.clipboard.writeText(n).catch(function(n){throw e(n.message),n}):new Promise(function(t,r){var o=document.createElement("input");o.value=n,o.style.cssText="position:fixed;left:0;top:0;opacity:0;",document.body.appendChild(o),o.select();try{if(document.execCommand("copy"))t();else{var a="Failed to execute 'document.execCommand'.";e(a),r(Error(a))}}catch(n){e(n.message),r(n)}finally{document.body.removeChild(o)}})},getIdCardLastChar=function(n){if(!n||n.length<17)throw Error("传入的身份证号长度必须>=17");for(var e=[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2],t=["1","0","X","9","8","7","6","5","4","3","2"],r=0,o=0;o<17;o++)r+=parseInt(n.charAt(o),10)*e[o];return t[r%11]},validateIdCard=function(n){return n&&18===n.length?"".concat(getIdCardLastChar(n))===n.charAt(17):(console.error("身份证号不是18位!"),!1)},keyCodes=function(){for(var n={backspace:8,tab:9,clear:12,enter:13,shift:16,ctrl:17,alt:18,esc:27,space:32,pageup:33,pagedown:34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46},e=48;e<=57;e++)n[String.fromCharCode(e)]=e;for(var t=65;t<=90;t++)n[String.fromCharCode(t).toLowerCase()]=t;for(var r=96;r<=105;r++)n["num".concat(r-96)]=r;for(var o=112;o<=123;o++)n["f".concat(o-111)]=o;return n}(),getParam=function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:location.search;return(RegExp("(^|\\?|&)".concat(n,"=(.*?)(?=&|#|$)"),"g").exec(e)||[])[2]},getParamInt=function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:location.search;return parseInt(getParam(n,e)||"0",10)},getParams=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:location.search,e=((n||"").split("?").pop()||"").split("#")[0]||"",t={};return e.split("&").map(function(n){return n.split("=")}).forEach(function(n){var e=_slicedToArray(n,2),r=e[0],o=e[1];t[r]=o||""}),t},setParam=function(n,e,t){if(void 0!==getParam(n,t=t||"".concat(location.pathname).concat(location.search)))return t.replace(RegExp("(^|\\?|&)".concat(n,"=(.*?)(?=&|#|$)"),"g"),"$1".concat(n,"=").concat(e));var r=_slicedToArray(t.split("#"),2),o=r[0],a=r[1];return"".concat(o).concat(0>o.indexOf("?")?"?":"&").concat(n,"=").concat(e).concat(a?"#":"").concat(a||"")},delParam=function(n,e){return(e=e||"".concat(location.pathname).concat(location.search)).replace(RegExp("(^|\\?|&)".concat(n,"=.*?(&|#|$)"),"g"),function(n,e,t){return"&"===t?e:t})},toUrlParams=function(n){return Object.keys(n||{}).filter(function(e){return void 0!==n[e]}).map(function(e){var t="object"==typeof n[e]?JSON.stringify(n[e]):n[e];return"".concat(encodeURIComponent(e),"=").concat(encodeURIComponent(t))}).join("&")},mergeOptions=function(n,e){var t=Object.assign({},(null==n?void 0:n.headers)||{},(null==e?void 0:e.headers)||{}),r=Object.assign({},(null==n?void 0:n.fetchOptions)||{},(null==e?void 0:e.fetchOptions)||{});return Object.assign({},n||{},e||{},{headers:t,fetchOptions:r})},request=function(){var n=_asyncToGenerator(function(n,e){var t,r,o,a,c,i,s,l,u,d,f,p,v,g,h,m,y,b,w,M,x;return __generator(this,function(k){switch(k.label){case 0:if(r=(t=(e=mergeOptions({errorMessage:"系统繁忙,请稍后再试",errorHandler:function(n){if(!(null==e?void 0:e.silent)){var t;null==e||null===(t=e.toastHandler)||void 0===t||t.call(e,n)}throw Error(n)},baseUrl:"",headers:{},fetchOptions:{credentials:"include"},checkSuccess:function(n){return(null==n?void 0:n.code)==0||(null==n?void 0:n.code)==200},toastHandler:function(n){return console.error("[您还没有配置toastHandler,请根据您的UI组件库配置合适的提示方法] ".concat(n||""))},onFetchResponse:function(n){if(200===n.status)return n.json();var e={code:n.status,status:n.status,message:n.statusText,headers:n.headers,_response:n},t=Error(e.message);throw t.response=e,t}},e))||{}).params,o=t.data,a=t.formData,c=t.json,i=t.method,s=t.headers,l=t.baseUrl,u=t.fetchOptions,d=t.checkSuccess,f=t.afterRequest,p=t.errorHandler,v=t.errorMessage,g=t.responseConverter,h=t.onFetchResponse,u.headers=_objectSpread({},s||{},u.headers||{}),r&&(u.method=i||"GET",n="".concat(n).concat(n.indexOf("?")>=0?"&":"?").concat(toUrlParams(r))),o)Object.assign(u,{method:i||"POST",body:toUrlParams(o),headers:_objectSpread({"Content-Type":"application/x-www-form-urlencoded;charset=utf-8"},u.headers||{})});else if(a){if(m=a,!(a instanceof FormData))for(var E in m=new FormData,a)m.append(E,a[E]);Object.assign(u,{method:i||"POST",body:m})}else c&&Object.assign(u,{method:i||"POST",body:JSON.stringify(c),headers:_objectSpread({"Content-Type":"application/json;charset=utf-8"},u.headers||{})});y=null,k.label=1;case 1:return k.trys.push([1,3,,4]),0===(b="".concat(/^(http|\/\/)/g.test(n)?"":l||"").concat(n)).indexOf("//")&&"blob:"===location.protocol&&(b="".concat(null===(w=location.pathname.split(":"))||void 0===w?void 0:w[0],":").concat(b)),[4,fetch(b,u).then(h)];case 2:return y=k.sent(),[3,4];case 3:return console.error(M=k.sent()),null==f||f(!1,{message:null==M?void 0:M.message}),null==p||p((null===(x=M.response)||void 0===x?void 0:x.message)||v||"",M.response),[2,void 0];case 4:if(y=g?g(y):y,null==d?void 0:d(y))return null==f||f(!0,y),[2,y.data];return null==f||f(!1,y),null==p||p(y.message||y.msg||v||"",y),[2,void 0]}})});return function(e,t){return n.apply(this,arguments)}}(),create=function(n){var e=mergeOptions(this.overrideDefaultOptions,n),t=function(n,t){return request(n,mergeOptions(e,t))};return t.overrideDefaultOptions=e,t.create=create.bind(t),t};request.create=create.bind(request);var Request=function(n,e){var t=e;return e||(t=n,n=request),function(e,r){return n(e,_objectSpread({},t||{},r||{}))}},formatDate=function(n,e){var t=function(n){e=e.replace(RegExp("".concat(n,"+"),"g"),function(e){var t="".concat(r[n]);if("w"===n)return"".concat(e.length>2?"星期":"周").concat(o[t]);for(var a=0,c=t.length;a<e.length-c;a++)t="0".concat(t);return 1===e.length?t:t.substring(t.length-e.length)})};if(!n)return"";if("number"==typeof n)n=new Date(n);else if("string"==typeof n){if(/^\d{12,13}$/g.test(n))n=new Date(parseInt(n,10));else{if(!/^.{10}T.{8,12}Z?$/g.test(n))return n;n=new Date(n)}}if(!(n instanceof Date))throw Error("formatDate error: not date.");if(isNaN(null==n?void 0:n.getFullYear()))throw Error("formatDate error: invalid date.");e=e||"yyyy-MM-dd HH:mm:ss";var r={y:n.getFullYear(),M:n.getMonth()+1,d:n.getDate(),q:Math.floor((n.getMonth()+3)/3),w:n.getDay(),H:n.getHours(),h:n.getHours()%12==0?12:n.getHours()%12,m:n.getMinutes(),s:n.getSeconds(),S:n.getMilliseconds()},o=["天","一","二","三","四","五","六"];for(var a in r)t(a);return e},parseDate=function(n,e){var t={y:0,M:1,d:0,H:0,h:0,m:0,s:0,S:0};(e=e||"yyyy-MM-dd").replace(/([^yMdHmsS]*?)(([yMdHmsS])\3*)([^yMdHmsS]*?)/g,function(e,r,o,a,c){return n=n.replace(RegExp("".concat(r,"(\\d{").concat(o.length,"})").concat(c)),function(n,e){return t[a]=parseInt(e,10),""}),""}),t.M--;var r=new Date(t.y,t.M,t.d,t.H,t.m,t.s);return 0!==t.S&&r.setMilliseconds(t.S),r},sleep=function(n){return new Promise(function(e){return setTimeout(e,n||0)})},formatJson=function(json,indent,leftBracesInSameLine){function getIndentStr(n){for(var e="",t=0;t<n;t++)e+=indent||" ";return e}function format(n,e){e=void 0===e?0:e;var t="";if("object"==typeof n&&null!=n){var r=n instanceof Array,o=0;for(var a in t+="".concat(r?"[":"{","\n"),n){t+=o++>0?",\n":"";var c="object"==typeof n[a]&&null!=n[a],i=getIndentStr(e+1);t+=(r&&c?"":i)+(r?"":'"'.concat(a,'": ').concat(c&&!leftBracesInSameLine?"\n":""))+(!c||c&&leftBracesInSameLine&&!r?"":i)+format(n[a],e+1)}t+="\n".concat(getIndentStr(e)).concat(r?"]":"}")}else{var s="string"==typeof n?'"':"";t+="".concat(s).concat(n).concat(s)}return t}return format(eval("(".concat(json,")")))},getRandom=function(n,e){return"number"==typeof n?(void 0===e&&(e=n,n=0),n+Math.floor(Math.random()*(e-n))):n instanceof Array?void 0!==e?(n.sort(function(){return Math.random()>.5?1:-1}),n.slice(0,e)):0===n.length?null:1===n.length?n[0]:n[Math.floor(Math.random()*n.length)]:Math.random()},getRandomStr=function(n,e){n=n||18;var t="ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz0123456789".split("");"number"===e&&(t="0123456789".split(""));for(var r="",o=0;o<n;o++)r+=getRandom(t);return r},toUnderline=function(n,e){return n.replace(/([A-Z])/g,function(n,t){return"".concat(e||"_").concat(t.toLowerCase())})},toHump=function(n,e){return n.replace(RegExp("".concat(e||"_","(\\w)"),"g"),function(n,e){return e.toUpperCase()})};export{Request,copyToClipboard,createEnum,decodeHtml,deepCopy,delParam,encodeHtml,formatDate,formatJson,getIdCardLastChar,getParam,getParamInt,getParams,getRandom,getRandomStr,hideLoading,initWindowMessage,keyCodes,parseDate,request,setParam,showLoading,sleep,toHump,toUnderline,toUrlParams,validateIdCard};
|
package/esm/index.d.ts
CHANGED
package/esm/index.js
CHANGED
package/esm/other.d.ts
CHANGED
|
@@ -26,3 +26,17 @@ export declare const decodeHtml: (html: string | any) => any;
|
|
|
26
26
|
* @returns
|
|
27
27
|
*/
|
|
28
28
|
export declare const copyToClipboard: (text: string, onFailure: (message: string) => void, supportSilent: boolean) => Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* 获取身份证号第18位校验码
|
|
31
|
+
* @params cid 身份证号码,17或18位均可
|
|
32
|
+
*/
|
|
33
|
+
export declare const getIdCardLastChar: (cid: string) => string;
|
|
34
|
+
/**
|
|
35
|
+
* 检测某个身份证ID是否合法,包括长度和最后一位校验码检测
|
|
36
|
+
* @params cid 身份证号码,必须是18位
|
|
37
|
+
*/
|
|
38
|
+
export declare const validateIdCard: (cid: string) => boolean;
|
|
39
|
+
/**
|
|
40
|
+
* 键盘键值映射,如: keyCodes.ctrl == 17
|
|
41
|
+
*/
|
|
42
|
+
export declare const keyCodes: Record<string, number>;
|
package/esm/other.js
CHANGED
|
@@ -71,3 +71,88 @@
|
|
|
71
71
|
}
|
|
72
72
|
});
|
|
73
73
|
};
|
|
74
|
+
/**
|
|
75
|
+
* 获取身份证号第18位校验码
|
|
76
|
+
* @params cid 身份证号码,17或18位均可
|
|
77
|
+
*/ export var getIdCardLastChar = function(cid) {
|
|
78
|
+
if (!cid || cid.length < 17) throw new Error("传入的身份证号长度必须>=17");
|
|
79
|
+
var weights = [
|
|
80
|
+
7,
|
|
81
|
+
9,
|
|
82
|
+
10,
|
|
83
|
+
5,
|
|
84
|
+
8,
|
|
85
|
+
4,
|
|
86
|
+
2,
|
|
87
|
+
1,
|
|
88
|
+
6,
|
|
89
|
+
3,
|
|
90
|
+
7,
|
|
91
|
+
9,
|
|
92
|
+
10,
|
|
93
|
+
5,
|
|
94
|
+
8,
|
|
95
|
+
4,
|
|
96
|
+
2
|
|
97
|
+
]; // 十七位数字权重
|
|
98
|
+
var validates = [
|
|
99
|
+
"1",
|
|
100
|
+
"0",
|
|
101
|
+
"X",
|
|
102
|
+
"9",
|
|
103
|
+
"8",
|
|
104
|
+
"7",
|
|
105
|
+
"6",
|
|
106
|
+
"5",
|
|
107
|
+
"4",
|
|
108
|
+
"3",
|
|
109
|
+
"2"
|
|
110
|
+
]; // 校验码
|
|
111
|
+
var sum = 0;
|
|
112
|
+
for(var i = 0; i < 17; i++)sum += parseInt(cid.charAt(i), 10) * weights[i];
|
|
113
|
+
return validates[sum % 11];
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* 检测某个身份证ID是否合法,包括长度和最后一位校验码检测
|
|
117
|
+
* @params cid 身份证号码,必须是18位
|
|
118
|
+
*/ export var validateIdCard = function(cid) {
|
|
119
|
+
if (!cid || cid.length !== 18) {
|
|
120
|
+
console.error("身份证号不是18位!");
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
return "".concat(getIdCardLastChar(cid)) === cid.charAt(17);
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* 键盘键值映射,如: keyCodes.ctrl == 17
|
|
127
|
+
*/ export var keyCodes = function() {
|
|
128
|
+
var keys = {
|
|
129
|
+
backspace: 8,
|
|
130
|
+
tab: 9,
|
|
131
|
+
clear: 12,
|
|
132
|
+
enter: 13,
|
|
133
|
+
shift: 16,
|
|
134
|
+
ctrl: 17,
|
|
135
|
+
alt: 18,
|
|
136
|
+
esc: 27,
|
|
137
|
+
space: 32,
|
|
138
|
+
pageup: 33,
|
|
139
|
+
pagedown: 34,
|
|
140
|
+
end: 35,
|
|
141
|
+
home: 36,
|
|
142
|
+
left: 37,
|
|
143
|
+
up: 38,
|
|
144
|
+
right: 39,
|
|
145
|
+
down: 40,
|
|
146
|
+
insert: 45,
|
|
147
|
+
delete: 46
|
|
148
|
+
};
|
|
149
|
+
// 数字0-9
|
|
150
|
+
for(var i = 48; i <= 57; i++)keys[String.fromCharCode(i)] = i;
|
|
151
|
+
// 字母a-z
|
|
152
|
+
for(var i1 = 65; i1 <= 90; i1++)keys[String.fromCharCode(i1).toLowerCase()] = i1;
|
|
153
|
+
// 小键盘数字0-9,这里用num0-num9表示
|
|
154
|
+
for(var i2 = 96; i2 <= 105; i2++)keys["num".concat(i2 - 96)] = i2;
|
|
155
|
+
// f1-f12功能键
|
|
156
|
+
for(var i3 = 112; i3 <= 123; i3++)keys["f".concat(i3 - 111)] = i3;
|
|
157
|
+
return keys;
|
|
158
|
+
}();
|
package/esm/request.js
CHANGED
|
@@ -19,7 +19,7 @@ import { toUrlParams } from "./param";
|
|
|
19
19
|
* @returns
|
|
20
20
|
*/ var request = function() {
|
|
21
21
|
var _ref = _async_to_generator(function(url, options) {
|
|
22
|
-
var defaultOptions, _ref, params, data, formData, json, method, headers, baseUrl, fetchOptions, checkSuccess, afterRequest, errorHandler, errorMessage, responseConverter, onFetchResponse, body, key, resp, e, _e_response;
|
|
22
|
+
var defaultOptions, _ref, params, data, formData, json, method, headers, baseUrl, fetchOptions, checkSuccess, afterRequest, errorHandler, errorMessage, responseConverter, onFetchResponse, body, key, resp, _location_pathname_split, targetUrl, e, _e_response;
|
|
23
23
|
return _ts_generator(this, function(_state) {
|
|
24
24
|
switch(_state.label){
|
|
25
25
|
case 0:
|
|
@@ -99,9 +99,12 @@ import { toUrlParams } from "./param";
|
|
|
99
99
|
,
|
|
100
100
|
4
|
|
101
101
|
]);
|
|
102
|
+
targetUrl = "".concat(/^(http|\/\/)/g.test(url) ? "" : baseUrl || "").concat(url);
|
|
103
|
+
// 如果当前是blob地址,目标地址又是 // 开头,自动修正
|
|
104
|
+
if (targetUrl.indexOf("//") === 0 && location.protocol === "blob:") targetUrl = "".concat((_location_pathname_split = location.pathname.split(":")) === null || _location_pathname_split === void 0 ? void 0 : _location_pathname_split[0], ":").concat(targetUrl);
|
|
102
105
|
return [
|
|
103
106
|
4,
|
|
104
|
-
fetch(
|
|
107
|
+
fetch(targetUrl, fetchOptions).then(onFetchResponse)
|
|
105
108
|
];
|
|
106
109
|
case 2:
|
|
107
110
|
resp = _state.sent();
|
package/esm/string.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 格式化一段JSON字符串,支持解析非标准JSON
|
|
3
|
+
* 不同于绝大多数格式化工具,本方法支持设置缩进方式以及左大括号是否换行
|
|
4
|
+
* @start 2016-08-24
|
|
5
|
+
* @param {Object} json 要格式化的json串
|
|
6
|
+
* @param {Object} indent 缩进方式,可以是若干个空格和tab,默认tab缩进,如 2个空格:" "、4个空格:" "、tab:" "
|
|
7
|
+
* @param {Object} leftBracesInSameLine 左大括号是否保持在同一行,默认 false
|
|
8
|
+
*/
|
|
9
|
+
export declare const formatJson: (json: string, indent?: string, leftBracesInSameLine?: boolean) => string;
|
|
10
|
+
/**
|
|
11
|
+
* 获取各种随机数,支持如下几种调用方式:
|
|
12
|
+
* getRandom() 返回0-1的随机小数,等同于Math.random(),0 <= result < 1
|
|
13
|
+
* getRandom(start, end) 返回start-end的随机整数,start <= result < end
|
|
14
|
+
* getRandom(end) 返回0-end的随机整数,0 <= result < end
|
|
15
|
+
* getRandom(array) 随机返回数组中的某一个内容
|
|
16
|
+
* getRandom(array, count) 随机从数组中返回长度为count的不重复内容组成的新数组,如果不足count个,返回全部 并乱序
|
|
17
|
+
* @param {Object} start
|
|
18
|
+
* @param {Object} end
|
|
19
|
+
* @return {Object}
|
|
20
|
+
*/
|
|
21
|
+
export declare const getRandom: (start?: any, end?: any) => any;
|
|
22
|
+
/**
|
|
23
|
+
* 获取随机字符串
|
|
24
|
+
* @param length 字符串长度
|
|
25
|
+
* @param type all 表示所有,number表示仅数字,默认所有
|
|
26
|
+
* @return string
|
|
27
|
+
*/
|
|
28
|
+
export declare const getRandomStr: (length: number, type?: 'number' | 'all') => string;
|
|
29
|
+
/**
|
|
30
|
+
* 字符串转下划线形式,示例:getParam 转 get_param
|
|
31
|
+
* @param str 要转换的字符串
|
|
32
|
+
* @param flag 默认下划线-,也可以传其它字符
|
|
33
|
+
*/
|
|
34
|
+
export declare const toUnderline: (str: string, flag?: string) => string;
|
|
35
|
+
/**
|
|
36
|
+
* 字符串转驼峰形式
|
|
37
|
+
* 示例一: toHump('get_param'),返回getParam
|
|
38
|
+
* 示例二: toHump('font-size','-'),返回fontSize
|
|
39
|
+
* @param str
|
|
40
|
+
* @param 分割的标志,默认为“_”
|
|
41
|
+
*/
|
|
42
|
+
export declare const toHump: (str: string, flag?: string) => string;
|
package/esm/string.js
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 格式化一段JSON字符串,支持解析非标准JSON
|
|
3
|
+
* 不同于绝大多数格式化工具,本方法支持设置缩进方式以及左大括号是否换行
|
|
4
|
+
* @start 2016-08-24
|
|
5
|
+
* @param {Object} json 要格式化的json串
|
|
6
|
+
* @param {Object} indent 缩进方式,可以是若干个空格和tab,默认tab缩进,如 2个空格:" "、4个空格:" "、tab:" "
|
|
7
|
+
* @param {Object} leftBracesInSameLine 左大括号是否保持在同一行,默认 false
|
|
8
|
+
*/ import _instanceof from "@swc/helpers/src/_instanceof.mjs";
|
|
9
|
+
export var formatJson = function(json, indent, leftBracesInSameLine) {
|
|
10
|
+
var getIndentStr = function getIndentStr(level) {
|
|
11
|
+
var str = "";
|
|
12
|
+
for(var i = 0; i < level; i++)str += indent || " ";
|
|
13
|
+
return str;
|
|
14
|
+
};
|
|
15
|
+
function format(obj, level) {
|
|
16
|
+
level = level === undefined ? 0 : level;
|
|
17
|
+
var result = "";
|
|
18
|
+
// 如果是object或者array
|
|
19
|
+
if (typeof obj === "object" && obj != null) {
|
|
20
|
+
var isArray = _instanceof(obj, Array);
|
|
21
|
+
var idx = 0;
|
|
22
|
+
result += "".concat(isArray ? "[" : "{", "\n");
|
|
23
|
+
for(var i in obj){
|
|
24
|
+
result += idx++ > 0 ? ",\n" : ""; // 如果不是数组或对象的第一个内容,追加逗号
|
|
25
|
+
var nextIsObj = typeof obj[i] === "object" && obj[i] != null;
|
|
26
|
+
var indentStr = getIndentStr(level + 1);
|
|
27
|
+
result += isArray && nextIsObj ? "" : indentStr; // 如果当前是数组并且子项是对象,无需缩进
|
|
28
|
+
result += isArray ? "" : '"'.concat(i, '": ').concat(nextIsObj && !leftBracesInSameLine ? "\n" : "");
|
|
29
|
+
result += !nextIsObj || nextIsObj && leftBracesInSameLine && !isArray ? "" : indentStr;
|
|
30
|
+
result += format(obj[i], level + 1); // 递归调用
|
|
31
|
+
}
|
|
32
|
+
result += "\n".concat(getIndentStr(level)).concat(isArray ? "]" : "}");
|
|
33
|
+
} else {
|
|
34
|
+
// 如果是 null、number、boolean、string
|
|
35
|
+
var quot = typeof obj === "string" ? '"' : ""; // 是否是字符串
|
|
36
|
+
result += "".concat(quot).concat(obj).concat(quot);
|
|
37
|
+
}
|
|
38
|
+
return result;
|
|
39
|
+
}
|
|
40
|
+
// eslint-disable-next-line no-eval
|
|
41
|
+
return format(eval("(".concat(json, ")"))); // 使用eval的好处是可以解析非标准JSON
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* 获取各种随机数,支持如下几种调用方式:
|
|
45
|
+
* getRandom() 返回0-1的随机小数,等同于Math.random(),0 <= result < 1
|
|
46
|
+
* getRandom(start, end) 返回start-end的随机整数,start <= result < end
|
|
47
|
+
* getRandom(end) 返回0-end的随机整数,0 <= result < end
|
|
48
|
+
* getRandom(array) 随机返回数组中的某一个内容
|
|
49
|
+
* getRandom(array, count) 随机从数组中返回长度为count的不重复内容组成的新数组,如果不足count个,返回全部 并乱序
|
|
50
|
+
* @param {Object} start
|
|
51
|
+
* @param {Object} end
|
|
52
|
+
* @return {Object}
|
|
53
|
+
*/ export var getRandom = function(start, end) {
|
|
54
|
+
if (typeof start === "number") {
|
|
55
|
+
if (typeof end === "undefined") {
|
|
56
|
+
end = start;
|
|
57
|
+
start = 0;
|
|
58
|
+
}
|
|
59
|
+
return start + Math.floor(Math.random() * (end - start));
|
|
60
|
+
} else if (_instanceof(start, Array)) {
|
|
61
|
+
if (typeof end === "undefined") {
|
|
62
|
+
if (start.length === 0) return null;
|
|
63
|
+
if (start.length === 1) return start[0];
|
|
64
|
+
return start[Math.floor(Math.random() * start.length)];
|
|
65
|
+
} else {
|
|
66
|
+
start.sort(function() {
|
|
67
|
+
return Math.random() > 0.5 ? 1 : -1;
|
|
68
|
+
});
|
|
69
|
+
return start.slice(0, end);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return Math.random();
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* 获取随机字符串
|
|
76
|
+
* @param length 字符串长度
|
|
77
|
+
* @param type all 表示所有,number表示仅数字,默认所有
|
|
78
|
+
* @return string
|
|
79
|
+
*/ export var getRandomStr = function(length, type) {
|
|
80
|
+
length = length || 18;
|
|
81
|
+
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz0123456789".split("");
|
|
82
|
+
if (type === "number") chars = "0123456789".split("");
|
|
83
|
+
var result = "";
|
|
84
|
+
for(var i = 0; i < length; i++)result += getRandom(chars);
|
|
85
|
+
return result;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* 字符串转下划线形式,示例:getParam 转 get_param
|
|
89
|
+
* @param str 要转换的字符串
|
|
90
|
+
* @param flag 默认下划线-,也可以传其它字符
|
|
91
|
+
*/ export var toUnderline = function(str, flag) {
|
|
92
|
+
return str.replace(/([A-Z])/g, function(m, $1) {
|
|
93
|
+
return "".concat(flag || "_").concat($1.toLowerCase());
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* 字符串转驼峰形式
|
|
98
|
+
* 示例一: toHump('get_param'),返回getParam
|
|
99
|
+
* 示例二: toHump('font-size','-'),返回fontSize
|
|
100
|
+
* @param str
|
|
101
|
+
* @param 分割的标志,默认为“_”
|
|
102
|
+
*/ export var toHump = function(str, flag) {
|
|
103
|
+
return str.replace(new RegExp("".concat(flag || "_", "(\\w)"), "g"), function(_m, $1) {
|
|
104
|
+
return $1.toUpperCase();
|
|
105
|
+
});
|
|
106
|
+
};
|