youtil 3.1.2 → 3.1.3
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/package.json +3 -4
- package/docs/404.html +0 -24
- package/docs/574.483e4d8b.async.js +0 -15
- package/docs/574.e8c51481.chunk.css +0 -5
- package/docs/762.1d61e7db.async.js +0 -3
- package/docs/831.f94499ec.async.js +0 -137
- package/docs/972.5b978da2.async.js +0 -22
- package/docs/CNAME +0 -1
- package/docs/api/functions/copy-to-clipboard/index.html +0 -24
- package/docs/api/functions/create-enum/index.html +0 -24
- package/docs/api/functions/decode-html/index.html +0 -24
- package/docs/api/functions/deep-copy/index.html +0 -24
- package/docs/api/functions/del-param/index.html +0 -24
- package/docs/api/functions/encode-html/index.html +0 -24
- package/docs/api/functions/format-date/index.html +0 -24
- package/docs/api/functions/format-json/index.html +0 -24
- package/docs/api/functions/get-id-card-last-char/index.html +0 -24
- package/docs/api/functions/get-param/index.html +0 -24
- package/docs/api/functions/get-param-int/index.html +0 -24
- package/docs/api/functions/get-params/index.html +0 -24
- package/docs/api/functions/get-random/index.html +0 -24
- package/docs/api/functions/get-random-str/index.html +0 -24
- package/docs/api/functions/hide-loading/index.html +0 -24
- package/docs/api/functions/init-window-message/index.html +0 -24
- package/docs/api/functions/parse-date/index.html +0 -24
- package/docs/api/functions/request/index.html +0 -24
- package/docs/api/functions/set-param/index.html +0 -24
- package/docs/api/functions/show-loading/index.html +0 -24
- package/docs/api/functions/sleep/index.html +0 -24
- package/docs/api/functions/to-hump/index.html +0 -24
- package/docs/api/functions/to-underline/index.html +0 -24
- package/docs/api/functions/to-url-params/index.html +0 -24
- package/docs/api/functions/validate-id-card/index.html +0 -24
- package/docs/api/globals/index.html +0 -24
- package/docs/api/interfaces/i-request-options/index.html +0 -24
- package/docs/api/interfaces/i-show-loading-config/index.html +0 -24
- package/docs/api/type-aliases/enum-item/index.html +0 -24
- package/docs/api/type-aliases/enum-type/index.html +0 -24
- package/docs/api/variables/key-codes/index.html +0 -24
- package/docs/api/variables/request/index.html +0 -24
- package/docs/dumi__tmp-production__dumi__theme__ContextWrapper.ab2cd1e2.async.js +0 -1
- package/docs/guide/enum/index.html +0 -24
- package/docs/guide/index.html +0 -24
- package/docs/guide/loading/index.html +0 -24
- package/docs/guide/message/index.html +0 -24
- package/docs/guide/request/index.html +0 -24
- package/docs/index.html +0 -24
- package/docs/markdown__api__functions__copyToClipboard.md.33be0665.chunk.css +0 -1
- package/docs/markdown__api__functions__copyToClipboard.md.fa13570e.async.js +0 -3
- package/docs/markdown__api__functions__createEnum.md.33be0665.chunk.css +0 -1
- package/docs/markdown__api__functions__createEnum.md.ab0957ee.async.js +0 -8
- package/docs/markdown__api__functions__decodeHtml.md.33be0665.chunk.css +0 -1
- package/docs/markdown__api__functions__decodeHtml.md.922bf499.async.js +0 -1
- package/docs/markdown__api__functions__deepCopy.md.33be0665.chunk.css +0 -1
- package/docs/markdown__api__functions__deepCopy.md.4dea99a7.async.js +0 -1
- package/docs/markdown__api__functions__delParam.md.33be0665.chunk.css +0 -1
- package/docs/markdown__api__functions__delParam.md.dc0c2c8a.async.js +0 -4
- package/docs/markdown__api__functions__encodeHtml.md.33be0665.chunk.css +0 -1
- package/docs/markdown__api__functions__encodeHtml.md.d4d7ef49.async.js +0 -1
- package/docs/markdown__api__functions__formatDate.md.33be0665.chunk.css +0 -1
- package/docs/markdown__api__functions__formatDate.md.e43ecd6d.async.js +0 -1
- package/docs/markdown__api__functions__formatJson.md.33be0665.chunk.css +0 -1
- package/docs/markdown__api__functions__formatJson.md.56d52c5d.async.js +0 -2
- package/docs/markdown__api__functions__getIdCardLastChar.md.1a9f4c4c.async.js +0 -1
- package/docs/markdown__api__functions__getIdCardLastChar.md.33be0665.chunk.css +0 -1
- package/docs/markdown__api__functions__getParam.md.33be0665.chunk.css +0 -1
- package/docs/markdown__api__functions__getParam.md.65c4baf1.async.js +0 -5
- package/docs/markdown__api__functions__getParamInt.md.33be0665.chunk.css +0 -1
- package/docs/markdown__api__functions__getParamInt.md.e53ccbcf.async.js +0 -1
- package/docs/markdown__api__functions__getParams.md.33be0665.chunk.css +0 -1
- package/docs/markdown__api__functions__getParams.md.86dccf75.async.js +0 -2
- package/docs/markdown__api__functions__getRandom.md.2c03a03a.async.js +0 -6
- package/docs/markdown__api__functions__getRandom.md.33be0665.chunk.css +0 -1
- package/docs/markdown__api__functions__getRandomStr.md.33be0665.chunk.css +0 -1
- package/docs/markdown__api__functions__getRandomStr.md.7162c7eb.async.js +0 -1
- package/docs/markdown__api__functions__hideLoading.md.33be0665.chunk.css +0 -1
- package/docs/markdown__api__functions__hideLoading.md.63141f59.async.js +0 -1
- package/docs/markdown__api__functions__initWindowMessage.md.33be0665.chunk.css +0 -1
- package/docs/markdown__api__functions__initWindowMessage.md.4cecf804.async.js +0 -1
- package/docs/markdown__api__functions__parseDate.md.33be0665.chunk.css +0 -1
- package/docs/markdown__api__functions__parseDate.md.43f68864.async.js +0 -1
- package/docs/markdown__api__functions__request.md.33be0665.chunk.css +0 -1
- package/docs/markdown__api__functions__request.md.8100475a.async.js +0 -1
- package/docs/markdown__api__functions__setParam.md.33be0665.chunk.css +0 -1
- package/docs/markdown__api__functions__setParam.md.6122453b.async.js +0 -3
- package/docs/markdown__api__functions__showLoading.md.23c9d9cf.async.js +0 -1
- package/docs/markdown__api__functions__showLoading.md.33be0665.chunk.css +0 -1
- package/docs/markdown__api__functions__sleep.md.33be0665.chunk.css +0 -1
- package/docs/markdown__api__functions__sleep.md.65b4d778.async.js +0 -2
- package/docs/markdown__api__functions__toHump.md.33be0665.chunk.css +0 -1
- package/docs/markdown__api__functions__toHump.md.a648d9ca.async.js +0 -3
- package/docs/markdown__api__functions__toUnderline.md.33be0665.chunk.css +0 -1
- package/docs/markdown__api__functions__toUnderline.md.ab7a4578.async.js +0 -1
- package/docs/markdown__api__functions__toUrlParams.md.33be0665.chunk.css +0 -1
- package/docs/markdown__api__functions__toUrlParams.md.de7422f6.async.js +0 -1
- package/docs/markdown__api__functions__validateIdCard.md.33be0665.chunk.css +0 -1
- package/docs/markdown__api__functions__validateIdCard.md.ccfc4d2f.async.js +0 -1
- package/docs/markdown__api__globals.md.2389be1f.async.js +0 -1
- package/docs/markdown__api__globals.md.33be0665.chunk.css +0 -1
- package/docs/markdown__api__interfaces__IRequestOptions.md.33be0665.chunk.css +0 -1
- package/docs/markdown__api__interfaces__IRequestOptions.md.da2c2fdd.async.js +0 -1
- package/docs/markdown__api__interfaces__IShowLoadingConfig.md.09756000.async.js +0 -1
- package/docs/markdown__api__interfaces__IShowLoadingConfig.md.33be0665.chunk.css +0 -1
- package/docs/markdown__api__type-aliases__EnumItem.md.33be0665.chunk.css +0 -1
- package/docs/markdown__api__type-aliases__EnumItem.md.955a45d6.async.js +0 -1
- package/docs/markdown__api__type-aliases__EnumType.md.33be0665.chunk.css +0 -1
- package/docs/markdown__api__type-aliases__EnumType.md.efd1803a.async.js +0 -1
- package/docs/markdown__api__variables__Request.md.1dbabcda.async.js +0 -1
- package/docs/markdown__api__variables__Request.md.33be0665.chunk.css +0 -1
- package/docs/markdown__api__variables__keyCodes.md.33be0665.chunk.css +0 -1
- package/docs/markdown__api__variables__keyCodes.md.74858111.async.js +0 -1
- package/docs/markdown__guide__enum.md.33be0665.chunk.css +0 -1
- package/docs/markdown__guide__enum.md.b90b172d.async.js +0 -1
- package/docs/markdown__guide__index.md.33be0665.chunk.css +0 -1
- package/docs/markdown__guide__index.md.896aab37.async.js +0 -13
- package/docs/markdown__guide__loading.md.33be0665.chunk.css +0 -1
- package/docs/markdown__guide__loading.md.512e960b.async.js +0 -1
- package/docs/markdown__guide__message.md.0788a6e2.async.js +0 -84
- package/docs/markdown__guide__message.md.33be0665.chunk.css +0 -1
- package/docs/markdown__guide__request.md.33be0665.chunk.css +0 -1
- package/docs/markdown__guide__request.md.804eed5b.async.js +0 -57
- package/docs/markdown__index.md.33be0665.chunk.css +0 -1
- package/docs/markdown__index.md.9c254237.async.js +0 -1
- package/docs/meta__markdown.3bc0c0cf.async.js +0 -310
- package/docs/nm__dumi__dist__client__pages__404.816f7d6a.async.js +0 -1
- package/docs/nm__dumi__dist__client__pages__404.8b85f2d9.chunk.css +0 -1
- package/docs/nm__dumi__dist__client__pages__Demo__index.088e9a8b.async.js +0 -1
- package/docs/nm__dumi__dist__client__pages__Demo__index.578aa5c0.chunk.css +0 -1
- package/docs/nm__dumi__theme-default__layouts__DocLayout__index.363dcde9.async.js +0 -1
- package/docs/preload_helper.a0360861.js +0 -1
- package/docs/umi.04710f8f.js +0 -104
- package/docs/umi.4e0bcd92.css +0 -1
- package/docs/~demos/:id/index.html +0 -24
- package/docs/~demos/markdown-guide-enum-demo-0/index.html +0 -24
- package/docs/~demos/markdown-guide-loading-demo-0/index.html +0 -24
- package/docs/~demos/markdown-guide-request-demo-0/index.html +0 -24
- package/docs/~demos/markdown-guide-request-demo-1/index.html +0 -24
|
@@ -1,310 +0,0 @@
|
|
|
1
|
-
(self.webpackChunkyoutil=self.webpackChunkyoutil||[]).push([[138],{28111:function(n,e,a){"use strict";a.r(e),a.d(e,{demos:function(){return r}});var t=a(67294),r={}},51317:function(n,e,a){"use strict";a.r(e),a.d(e,{demos:function(){return r}});var t=a(67294),r={}},75228:function(n,e,a){"use strict";a.r(e),a.d(e,{demos:function(){return r}});var t=a(67294),r={}},90804:function(n,e,a){"use strict";a.r(e),a.d(e,{demos:function(){return r}});var t=a(67294),r={}},9712:function(n,e,a){"use strict";a.r(e),a.d(e,{demos:function(){return r}});var t=a(67294),r={}},2837:function(n,e,a){"use strict";a.r(e),a.d(e,{demos:function(){return r}});var t=a(67294),r={}},68039:function(n,e,a){"use strict";a.r(e),a.d(e,{demos:function(){return r}});var t=a(67294),r={}},84350:function(n,e,a){"use strict";a.r(e),a.d(e,{demos:function(){return r}});var t=a(67294),r={}},49077:function(n,e,a){"use strict";a.r(e),a.d(e,{demos:function(){return r}});var t=a(67294),r={}},64212:function(n,e,a){"use strict";a.r(e),a.d(e,{demos:function(){return r}});var t=a(67294),r={}},84283:function(n,e,a){"use strict";a.r(e),a.d(e,{demos:function(){return r}});var t=a(67294),r={}},4316:function(n,e,a){"use strict";a.r(e),a.d(e,{demos:function(){return r}});var t=a(67294),r={}},96319:function(n,e,a){"use strict";a.r(e),a.d(e,{demos:function(){return r}});var t=a(67294),r={}},63532:function(n,e,a){"use strict";a.r(e),a.d(e,{demos:function(){return r}});var t=a(67294),r={}},30061:function(n,e,a){"use strict";a.r(e),a.d(e,{demos:function(){return r}});var t=a(67294),r={}},66186:function(n,e,a){"use strict";a.r(e),a.d(e,{demos:function(){return r}});var t=a(67294),r={}},25970:function(n,e,a){"use strict";a.r(e),a.d(e,{demos:function(){return r}});var t=a(67294),r={}},64962:function(n,e,a){"use strict";a.r(e),a.d(e,{demos:function(){return r}});var t=a(67294),r={}},1533:function(n,e,a){"use strict";a.r(e),a.d(e,{demos:function(){return r}});var t=a(67294),r={}},71802:function(n,e,a){"use strict";a.r(e),a.d(e,{demos:function(){return r}});var t=a(67294),r={}},53837:function(n,e,a){"use strict";a.r(e),a.d(e,{demos:function(){return r}});var t=a(67294),r={}},64429:function(n,e,a){"use strict";a.r(e),a.d(e,{demos:function(){return r}});var t=a(67294),r={}},23442:function(n,e,a){"use strict";a.r(e),a.d(e,{demos:function(){return r}});var t=a(67294),r={}},25140:function(n,e,a){"use strict";a.r(e),a.d(e,{demos:function(){return r}});var t=a(67294),r={}},91729:function(n,e,a){"use strict";a.r(e),a.d(e,{demos:function(){return r}});var t=a(67294),r={}},88718:function(n,e,a){"use strict";a.r(e),a.d(e,{demos:function(){return r}});var t=a(67294),r={}},27126:function(n,e,a){"use strict";a.r(e),a.d(e,{demos:function(){return r}});var t=a(67294),r={}},28812:function(n,e,a){"use strict";a.r(e),a.d(e,{demos:function(){return r}});var t=a(67294),r={}},41565:function(n,e,a){"use strict";a.r(e),a.d(e,{demos:function(){return r}});var t=a(67294),r={}},52495:function(n,e,a){"use strict";a.r(e),a.d(e,{demos:function(){return r}});var t=a(67294),r={}},3740:function(n,e,a){"use strict";a.r(e),a.d(e,{demos:function(){return r}});var t=a(67294),r={}},80647:function(n,e,a){"use strict";a.r(e),a.d(e,{demos:function(){return r}});var t=a(67294),r={}},66693:function(n,e,a){"use strict";a.r(e),a.d(e,{demos:function(){return h}});var t=a(15009),r=a.n(t),l=a(19632),P=a.n(l),g=a(99289),p=a.n(g),A=a(67294),H=a(32632),h={"markdown-guide-enum-demo-0":{component:A.memo(A.lazy(p()(r()().mark(function M(){var E,O,m;return r()().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return v.next=2,Promise.resolve().then(a.bind(a,32632));case 2:return E=v.sent,O=E.createEnum,m=O([{label:"\u7537",value:1,key:"MAN",others:123},{label:"\u5973",value:"2",key:"WOMAN"}]),console.log(m.MAN),console.log(m.pick("MAN")),console.log(m.pick(1)),console.log(m.pickLabel(1)),console.log(m.pickValue("MAN")),console.log(m.pickKey(1)),console.log(m.pickByLabel("\u7537")),console.log(m[0]),console.log(m),console.log(P()(m)),console.log(m.length),v.abrupt("return",{default:function(){return"\u8BF7\u67E5\u770B\u63A7\u5236\u53F0"}});case 17:case"end":return v.stop()}},M)})))),asset:{type:"BLOCK",id:"markdown-guide-enum-demo-0",refAtomIds:[],dependencies:{"index.tsx":{type:"FILE",value:`import { createEnum } from 'youtil';
|
|
2
|
-
|
|
3
|
-
// \u4F7F\u7528\u793A\u4F8B\uFF0C\u6CE8\u610F\u4E00\u5B9A\u4E0D\u8981\u5FD8\u4E86\u7ED3\u5C3E\u7684 as const
|
|
4
|
-
const genders = createEnum([
|
|
5
|
-
{ label: '\u7537', value: 1, key: 'MAN', others: 123 },
|
|
6
|
-
// value \u53EF\u4EE5\u662F\u6570\u5B57\u4E5F\u53EF\u4EE5\u662F\u5B57\u7B26\u4E32
|
|
7
|
-
{ label: '\u5973', value: '2', key: 'WOMAN' },
|
|
8
|
-
] as const);
|
|
9
|
-
console.log(genders.MAN); // \u652F\u6301\u9F20\u6807\u60AC\u505C\u663E\u793A\u503C\u4E3A 1
|
|
10
|
-
console.log(genders.pick('MAN')); // \u8FD4\u56DEMAN\u7684\u5B8C\u6574\u5BF9\u8C61
|
|
11
|
-
console.log(genders.pick(1)); // \u8FD4\u56DEMAN\u7684\u5B8C\u6574\u5BF9\u8C61
|
|
12
|
-
console.log(genders.pickLabel(1)); // \u8FD4\u56DE \u7537
|
|
13
|
-
console.log(genders.pickValue('MAN')); // \u8FD4\u56DE 1
|
|
14
|
-
console.log(genders.pickKey(1)); // \u8FD4\u56DEMAN\u7684\u5B8C\u6574\u5BF9\u8C61
|
|
15
|
-
console.log(genders.pickByLabel('\u7537')); // \u8FD4\u56DEMAN\u7684\u5B8C\u6574\u5BF9\u8C61
|
|
16
|
-
console.log(genders[0]); // \u8FD4\u56DEMAN\u7684\u5B8C\u6574\u5BF9\u8C61
|
|
17
|
-
console.log(genders); // \u8F93\u51FA\u5B8C\u6574\u6570\u7EC4
|
|
18
|
-
console.log([...genders]); // \u53BB\u9664\u9644\u52A0\u5C5E\u6027\uFF0C\u8FD8\u539F\u4E3A\u7EAF\u6570\u7EC4
|
|
19
|
-
console.log(genders.length); // \u8F93\u51FA2
|
|
20
|
-
|
|
21
|
-
export default () => '\u8BF7\u67E5\u770B\u63A7\u5236\u53F0'`},youtil:{type:"NPM",value:"3.1.1"}},entry:"index.tsx"},context:{youtil:H},renderOpts:{compile:function(){var M=p()(r()().mark(function O(){var m,N=arguments;return r()().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:return w.next=2,a.e(831).then(a.bind(a,17831));case 2:return w.abrupt("return",(m=w.sent).default.apply(m,N));case 3:case"end":return w.stop()}},O)}));function E(){return M.apply(this,arguments)}return E}()}}}},17664:function(n,e,a){"use strict";a.r(e),a.d(e,{demos:function(){return r}});var t=a(67294),r={}},79254:function(n,e,a){"use strict";var t;a.r(e),a.d(e,{demos:function(){return H}});var r=a(15009),l=a.n(r),P=a(99289),g=a.n(P),p=a(67294),A=a(32632),H={"markdown-guide-loading-demo-0":{component:p.memo(p.lazy(g()(l()().mark(function h(){var M,E,O,m,N,v;return l()().wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return F.next=2,Promise.resolve().then(a.bind(a,32632));case 2:return M=F.sent,E=M.showLoading,O=M.hideLoading,F.next=7,Promise.resolve().then(a.t.bind(a,67294,19));case 7:return m=F.sent,N=m.useEffect,v=function(){return p.createElement("div",null,p.createElement("a",{href:"javascript:;",onClick:function(){return E("\u6B63\u5728\u52A0\u8F7D...",10)}},"\u663E\u793Aloading\uFF0810\u79D2\u81EA\u52A8\u5173\u95ED\uFF09"),p.createElement("br",null),p.createElement("a",{href:"javascript:;",onClick:function(){return O()}},"\u5173\u95EDloading"),p.createElement("br",null),p.createElement("a",{href:"javascript:;",onClick:function(){return E("\u6B63\u5728\u52A0\u8F7D...",0)}},"\u4E00\u76F4\u663E\u793A"),p.createElement("br",null),p.createElement("a",{href:"javascript:;",onClick:function(){return E("\u6B63\u5728\u52A0\u8F7D...",0,{onCancel:function(){return alert("\u4F60\u70B9\u51FB\u4E86\u53D6\u6D88")}})}},"\u652F\u6301\u53D6\u6D88"),p.createElement("br",null),p.createElement("a",{href:"javascript:;",onClick:function(){return E("\u6B63\u5728\u52A0\u8F7D...",0,{onCancel:function(){return alert("\u4F60\u70B9\u51FB\u4E86\u53D6\u6D88")},cancelInline:!0})}},"\u53D6\u6D88\u4E0D\u6362\u884C"),p.createElement("br",null),p.createElement("a",{href:"javascript:;",onClick:function(){return E("\u53D1\u751F\u7684\u5BB6\u4E50\u9E21\u7C89\u53D7\u6253\u51FB\u4E86\u653E\u5927\u968F\u673A\u53D1\u9001\u8FBE\u4E86",0)}},"\u8D85\u5BBD\u6587\u5B57"),p.createElement("br",null),p.createElement("a",{href:"javascript:;",onClick:function(){return E("\u6B63\u5728\u52A0\u8F7D",10,{hasMask:!0})}},"\u663E\u793A\u906E\u7F69"),p.createElement("br",null))},F.abrupt("return",{default:v});case 11:case"end":return F.stop()}},h)})))),asset:{type:"BLOCK",id:"markdown-guide-loading-demo-0",refAtomIds:[],dependencies:{"index.jsx":{type:"FILE",value:`import { showLoading, hideLoading } from 'youtil';
|
|
22
|
-
import { useEffect } from 'react';
|
|
23
|
-
|
|
24
|
-
const App = () => {
|
|
25
|
-
return <div>
|
|
26
|
-
<a href="javascript:;" onClick={() => showLoading('\u6B63\u5728\u52A0\u8F7D...', 10)}>\u663E\u793Aloading\uFF0810\u79D2\u81EA\u52A8\u5173\u95ED\uFF09</a><br />
|
|
27
|
-
<a href="javascript:;" onClick={() => hideLoading()}>\u5173\u95EDloading</a><br />
|
|
28
|
-
<a href="javascript:;" onClick={() => showLoading('\u6B63\u5728\u52A0\u8F7D...', 0)}>\u4E00\u76F4\u663E\u793A</a><br />
|
|
29
|
-
<a href="javascript:;" onClick={() => showLoading('\u6B63\u5728\u52A0\u8F7D...', 0, {
|
|
30
|
-
onCancel: () => alert('\u4F60\u70B9\u51FB\u4E86\u53D6\u6D88')
|
|
31
|
-
})}>\u652F\u6301\u53D6\u6D88</a><br />
|
|
32
|
-
<a href="javascript:;" onClick={() => showLoading('\u6B63\u5728\u52A0\u8F7D...', 0, {
|
|
33
|
-
onCancel: () => alert('\u4F60\u70B9\u51FB\u4E86\u53D6\u6D88'),
|
|
34
|
-
cancelInline: true,
|
|
35
|
-
})}>\u53D6\u6D88\u4E0D\u6362\u884C</a><br />
|
|
36
|
-
<a href="javascript:;" onClick={() => showLoading('\u53D1\u751F\u7684\u5BB6\u4E50\u9E21\u7C89\u53D7\u6253\u51FB\u4E86\u653E\u5927\u968F\u673A\u53D1\u9001\u8FBE\u4E86', 0)}>\u8D85\u5BBD\u6587\u5B57</a><br />
|
|
37
|
-
<a href="javascript:;" onClick={() => showLoading('\u6B63\u5728\u52A0\u8F7D', 10, { hasMask: true })}>\u663E\u793A\u906E\u7F69</a><br />
|
|
38
|
-
</div>;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export default App;`},youtil:{type:"NPM",value:"3.1.1"},react:{type:"NPM",value:"16.14.0"}},entry:"index.jsx"},context:{youtil:A,react:t||(t=a.t(p,2))},renderOpts:{compile:function(){var h=g()(l()().mark(function E(){var O,m=arguments;return l()().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return v.next=2,a.e(831).then(a.bind(a,17831));case 2:return v.abrupt("return",(O=v.sent).default.apply(O,m));case 3:case"end":return v.stop()}},E)}));function M(){return h.apply(this,arguments)}return M}()}}}},9979:function(n,e,a){"use strict";a.r(e),a.d(e,{demos:function(){return r}});var t=a(67294),r={}},8788:function(n,e,a){"use strict";var t;a.r(e),a.d(e,{demos:function(){return H}});var r=a(15009),l=a.n(r),P=a(99289),g=a.n(P),p=a(67294),A=a(32632),H={"markdown-guide-request-demo-0":{component:p.memo(p.lazy(g()(l()().mark(function h(){var M,E,O,m,N,v,w;return l()().wrap(function(L){for(;;)switch(L.prev=L.next){case 0:return L.next=2,Promise.resolve().then(a.bind(a,32632));case 2:return M=L.sent,E=M.request,O=M.Request,L.next=7,Promise.resolve().then(a.t.bind(a,67294,19));case 7:return m=L.sent,N=m.useEffect,v=new O({errorMessage:"\u6211\u662F222",fetchOptions:{}}),w=new O({baseUrl:"/api/"},v),L.abrupt("return",{default:function(){var X=function(){var ra=g()(l()().mark(function Z(){var oa;return l()().wrap(function(aa){for(;;)switch(aa.prev=aa.next){case 0:return aa.next=2,v("test-post",{data:{a:1},onFetchResponse:function(Ia){return{code:0,data:Ia.headers}}});case 2:oa=aa.sent,console.log(oa,Object.fromEntries(oa.entries()));case 4:case"end":return aa.stop()}},Z)}));return function(){return ra.apply(this,arguments)}}();return p.createElement("div",null,p.createElement("a",{href:"javascript:;",onClick:X},"\u70B9\u51FB\u8BF7\u6C42"))}});case 12:case"end":return L.stop()}},h)})))),asset:{type:"BLOCK",id:"markdown-guide-request-demo-0",refAtomIds:[],dependencies:{"index.jsx":{type:"FILE",value:`import { request, Request } from 'youtil';
|
|
42
|
-
import { useEffect } from 'react';
|
|
43
|
-
|
|
44
|
-
var request2 = new Request({ errorMessage: '\u6211\u662F222', fetchOptions: {} });
|
|
45
|
-
var request3 = new Request({ baseUrl: '/api/' }, request2);
|
|
46
|
-
export default () => {
|
|
47
|
-
const test = async () => {
|
|
48
|
-
const a = await request2('test-post', { data: {a: 1}, onFetchResponse: resp => ({ code: 0, data: resp.headers }) });
|
|
49
|
-
console.log(a, Object.fromEntries(a.entries()));
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
return <div>
|
|
53
|
-
<a href="javascript:;" onClick={test}>\u70B9\u51FB\u8BF7\u6C42</a>
|
|
54
|
-
</div>;
|
|
55
|
-
}`},youtil:{type:"NPM",value:"3.1.1"},react:{type:"NPM",value:"16.14.0"}},entry:"index.jsx"},context:{youtil:A,react:t||(t=a.t(p,2))},renderOpts:{compile:function(){var h=g()(l()().mark(function E(){var O,m=arguments;return l()().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return v.next=2,a.e(831).then(a.bind(a,17831));case 2:return v.abrupt("return",(O=v.sent).default.apply(O,m));case 3:case"end":return v.stop()}},E)}));function M(){return h.apply(this,arguments)}return M}()}},"markdown-guide-request-demo-1":{component:p.memo(p.lazy(g()(l()().mark(function h(){var M,E,O,m,N,v,w;return l()().wrap(function(L){for(;;)switch(L.prev=L.next){case 0:return L.next=2,Promise.resolve().then(a.bind(a,32632));case 2:return M=L.sent,E=M.request,O=M.Request,L.next=7,Promise.resolve().then(a.t.bind(a,67294,19));case 7:return m=L.sent,N=m.useEffect,v=E.create({baseUrl:"http://xxx.com",errorMessage:"\u62A5\u9519\u5566\u5566\u5566"}),console.log(v.overrideOptions),w=v.create({toastHandler:function(X){return alert(X)}}),console.log(w.overrideOptions),L.abrupt("return",{default:function(){var X=function(){var ra=g()(l()().mark(function Z(){return l()().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return _.next=2,w("/test",{data:{a:1}});case 2:case"end":return _.stop()}},Z)}));return function(){return ra.apply(this,arguments)}}();return p.createElement("div",null,p.createElement("a",{href:"javascript:;",onClick:X},"\u70B9\u51FB\u8BF7\u6C42"))}});case 14:case"end":return L.stop()}},h)})))),asset:{type:"BLOCK",id:"markdown-guide-request-demo-1",refAtomIds:[],dependencies:{"index.jsx":{type:"FILE",value:`import { request, Request } from 'youtil';
|
|
56
|
-
import { useEffect } from 'react';
|
|
57
|
-
|
|
58
|
-
var request2 = request.create({
|
|
59
|
-
baseUrl: 'http://xxx.com',
|
|
60
|
-
errorMessage: '\u62A5\u9519\u5566\u5566\u5566',
|
|
61
|
-
});
|
|
62
|
-
console.log(request2.overrideOptions);
|
|
63
|
-
|
|
64
|
-
var request3 = request2.create({
|
|
65
|
-
toastHandler: msg => alert(msg),
|
|
66
|
-
});
|
|
67
|
-
console.log(request3.overrideOptions);
|
|
68
|
-
|
|
69
|
-
export default () => {
|
|
70
|
-
const test = async () => {
|
|
71
|
-
await request3('/test', { data: {a: 1} });
|
|
72
|
-
}
|
|
73
|
-
return <div>
|
|
74
|
-
<a href="javascript:;" onClick={test}>\u70B9\u51FB\u8BF7\u6C42</a>
|
|
75
|
-
</div>;
|
|
76
|
-
}`},youtil:{type:"NPM",value:"3.1.1"},react:{type:"NPM",value:"16.14.0"}},entry:"index.jsx"},context:{youtil:A,react:t||(t=a.t(p,2))},renderOpts:{compile:function(){var h=g()(l()().mark(function E(){var O,m=arguments;return l()().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return v.next=2,a.e(831).then(a.bind(a,17831));case 2:return v.abrupt("return",(O=v.sent).default.apply(O,m));case 3:case"end":return v.stop()}},E)}));function M(){return h.apply(this,arguments)}return M}()}}}},37310:function(n,e,a){"use strict";a.r(e),a.d(e,{demos:function(){return r}});var t=a(67294),r={}},32632:function(n,e,a){"use strict";a.r(e),a.d(e,{Request:function(){return wa},copyToClipboard:function(){return w},createEnum:function(){return l},decodeHtml:function(){return v},deepCopy:function(){return m},delParam:function(){return ga},encodeHtml:function(){return N},formatDate:function(){return Wa},formatJson:function(){return ca.Sk},getIdCardLastChar:function(){return F},getParam:function(){return Z},getParamInt:function(){return oa},getParams:function(){return _},getRandom:function(){return ca.sZ},getRandomStr:function(){return ca.kD},hideLoading:function(){return g},initWindowMessage:function(){return O},keyCodes:function(){return k},parseDate:function(){return Ba},request:function(){return la},setParam:function(){return aa},showLoading:function(){return P},sleep:function(){return Sa},toHump:function(){return ca.oi},toUnderline:function(){return ca.Yp},toUrlParams:function(){return Ia},validateIdCard:function(){return L}});var t=a(19632),r=a.n(t);function l(i){var d=r()(i),o={},u={};return i.forEach(function(I){o[I.value]=I,u[I.label]=I,I.key&&(o[I.key]=I,typeof I.key=="number"?console.error("createEnum\u4E2D\u7684key\u4E0D\u80FD\u4E3A\u7EAF\u6570\u5B57"):d[I.key]=I.value)}),d.pick=function(I){return o[I]},d.pickLabel=function(I){var c;return(c=d.pick(I))===null||c===void 0?void 0:c.label},d.pickValue=function(I){var c;return(c=d.pick(I))===null||c===void 0?void 0:c.value},d.pickKey=function(I){var c;return(c=d.pick(I))===null||c===void 0?void 0:c.key},d.pickByLabel=function(I){return u[I]},d}var P=function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"\u8BF7\u7A0D\u5019",o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:10,u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},I={hasMask:!1,maskColor:"#00000070",onCancel:null,cancelInline:!1,id:"com_global_page_loading"};u=Object.assign({},I,u);var c=u,s=c.id,b=c.hasMask,S=c.maskColor,T=c.onCancel,K=c.cancelInline,x="_".concat(s,"_timeout");window[x]&&clearTimeout(window[x]);var f=document.getElementById(s);f||(f=document.createElement("div"),f.id=s,f.className=s,document.body.append(f));var C="".concat(s,"_style");if(!document.getElementById(C)){var y=document.createElement("style");y.id=C,y.innerHTML=`
|
|
77
|
-
.`.concat(s,` {
|
|
78
|
-
position: fixed;
|
|
79
|
-
left: 0;
|
|
80
|
-
top: 0;
|
|
81
|
-
width: 100vw;
|
|
82
|
-
height: 100vh;
|
|
83
|
-
display: flex;
|
|
84
|
-
justify-content: center;
|
|
85
|
-
align-items: center;
|
|
86
|
-
pointer-events: none;
|
|
87
|
-
z-index: 10000;
|
|
88
|
-
}
|
|
89
|
-
.`).concat(s,`.show-mask {
|
|
90
|
-
pointer-events: unset;
|
|
91
|
-
background: #00000070;
|
|
92
|
-
}
|
|
93
|
-
.`).concat(s,` .mask-wrapper {
|
|
94
|
-
position: fixed;
|
|
95
|
-
}
|
|
96
|
-
.`).concat(s,` .loading-wrapper {
|
|
97
|
-
width: 120px;
|
|
98
|
-
height: 120px;
|
|
99
|
-
z-index: 8000;
|
|
100
|
-
background: rgba(0, 0, 0, 0.6);
|
|
101
|
-
border-radius: 8px;
|
|
102
|
-
text-align: center;
|
|
103
|
-
color: white;
|
|
104
|
-
display: flex;
|
|
105
|
-
justify-content: center;
|
|
106
|
-
flex-direction: column;
|
|
107
|
-
align-items: center;
|
|
108
|
-
pointer-events: initial;
|
|
109
|
-
line-height: 1.3;
|
|
110
|
-
}
|
|
111
|
-
.`).concat(s,` .loading-wrapper img {
|
|
112
|
-
width: 50px;
|
|
113
|
-
height: 50px;
|
|
114
|
-
margin-bottom: 10px;
|
|
115
|
-
}
|
|
116
|
-
.`).concat(s,` .loading-wrapper a {
|
|
117
|
-
color: #6ab2ff;
|
|
118
|
-
}`),document.head.appendChild(y)}if(f.innerHTML=`
|
|
119
|
-
<div class="loading-wrapper">
|
|
120
|
-
<img src="https://img.alicdn.com/tfs/TB1bnUsQBLoK1RjSZFuXXXn0XXa-32-32.svg" alt="\u52A0\u8F7D\u4E2D">
|
|
121
|
-
<div>
|
|
122
|
-
<span>`.concat(d,`</span>
|
|
123
|
-
`).concat(K?"":"<br />",`
|
|
124
|
-
`).concat(T?'<a href="javascript:;" class="cancel">\u53D6\u6D88</a>':"",`
|
|
125
|
-
</div>
|
|
126
|
-
</div>`),T){var R=f.querySelector(".cancel");R&&R.addEventListener("click",function(){g(),T()})}f.addEventListener("click",function(){g()}),f.style.display="flex",f.style.background=b?S:"transparent",f.className="".concat(s," ").concat(b?"show-mask":""),o>0&&(window[x]=setTimeout(function(){g()},o*1e3))},g=function(){var d="com_global_page_loading",o=document.getElementById(d);o&&(o.style.display="none")},p=a(15009),A=a.n(p),H=a(99289),h=a.n(H),M=a(52677),E=a.n(M);function O(i,d){!d&&window!==window.parent&&(d=window.parent),!d&&window.opener&&(d=window.opener);var o=new Map,u=new Map,I=function(){return Math.random().toString(36).substring(2)},c={},s="_local_function_";function b(x){var f="".concat(s).concat(I());return c[f]=x,f}var S=function(f,C){return(f==null?void 0:f.map(function(y){if(E()(y)==="object")for(var R in y)y[R]=C(y[R]);return C(y)}))||[]};function T(x){for(var f=arguments.length,C=new Array(f>1?f-1:0),y=1;y<f;y++)C[y-1]=arguments[y];if(!d){console.warn("TargetWindow is null.");return}return new Promise(function(R,W){var $=I();o.set($,{resolve:R,reject:W}),d.postMessage({scene:i,type:"event",eventName:x,payload:S(C,function(B){return typeof B=="function"?b(B):B}),callbackId:$},"*")})}window.addEventListener("message",function(){var x=h()(A()().mark(function f(C){var y,R,W,$,B,ea,ua,J,G,na,Q,q;return A()().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:if(!(!C.data||C.data.scene!==i)){D.next=2;break}return D.abrupt("return");case 2:if(d=C.source,y=C.data,R=y.type,W=y.eventName,$=y.payload,B=y.callbackId,R!=="event"){D.next=28;break}return ea=S($,function(V){if(typeof V=="string"&&V.startsWith(s)){var sa="getFn_".concat(V);return function(){for(var ta=arguments.length,da=new Array(ta),pa=0;pa<ta;pa++)da[pa]=arguments[pa];return T.apply(void 0,["executeLocalFunction",sa].concat(da))}}return V}),ua=u.get(W)||[],J=u.get("*")||[],D.prev=8,D.next=11,Promise.all(ua.map(function(V){return Promise.resolve(V.apply(void 0,r()(ea)))}));case 11:return G=D.sent,D.next=14,Promise.all(J.map(function(V){return Promise.resolve(V.apply(void 0,[W].concat(r()(ea))))}));case 14:if(na=D.sent,!B){D.next=20;break}if(Q=G[G.length-1]||na[na.length-1],!(!ua.length&&!Q)){D.next=19;break}return D.abrupt("return");case 19:d.postMessage({scene:i,type:"callback",callbackId:B,payload:Q},"*");case 20:D.next=26;break;case 22:D.prev=22,D.t0=D.catch(8),console.error(D.t0),B&&d.postMessage({scene:i,type:"callback",callbackId:B,error:D.t0||"unknown error"},"*");case 26:D.next=29;break;case 28:R==="callback"&&B&&(q=o.get(B),q&&(C.data.error?q.reject(C.data.error):q.resolve(C.data.payload),o.delete(B)));case 29:case"end":return D.stop()}},f,null,[[8,22]])}));return function(f){return x.apply(this,arguments)}}());function K(x,f){u.has(x)||u.set(x,[]),u.get(x).push(f)}return K("executeLocalFunction",function(x){var f;if(x=((f=x)===null||f===void 0?void 0:f.replace("getFn_",""))||"",!c[x])throw new Error("\u672A\u627E\u5230\u672C\u5730\u7F13\u5B58\u65B9\u6CD5\uFF1A".concat(x));for(var C=arguments.length,y=new Array(C>1?C-1:0),R=1;R<C;R++)y[R-1]=arguments[R];return c[x].apply(c,y)}),T("auto-connect"),{postMessage:T,onMessage:K}}var m=function(d){return!d||E()(d)!=="object"?d:JSON.parse(JSON.stringify(d))},N=function i(d){if(typeof d=="string"){var o=document.createElement("div");return o.innerText=d,o.innerHTML}else if(E()(d)==="object"&&d)for(var u in d)d[u]=i(d[u]);return d},v=function i(d){if(typeof d=="string"){var o=document.createElement("div");return o.innerHTML=d,o.innerText}else if(E()(d)==="object"&&d)for(var u in d)d[u]=i(d[u]);return d},w=function(d,o,u){if(!d)throw new Error("text can not be empty.");return o=o||function(I){return console.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25\uFF1A".concat(I||""))},navigator.clipboard&&!u?navigator.clipboard.writeText(d).catch(function(I){throw o(I.message),I}):new Promise(function(I,c){var s=document.createElement("input");s.value=d,s.style.cssText="position:fixed;left:0;top:0;opacity:0;",document.body.appendChild(s),s.select();try{if(document.execCommand("copy"))I();else{var b="Failed to execute 'document.execCommand'.";o(b),c(new Error(b))}}catch(S){o(S.message),c(S)}finally{document.body.removeChild(s)}})},F=function(d){if(!d||d.length<17)throw new Error("\u4F20\u5165\u7684\u8EAB\u4EFD\u8BC1\u53F7\u957F\u5EA6\u5FC5\u987B>=17");for(var o=[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2],u=["1","0","X","9","8","7","6","5","4","3","2"],I=0,c=0;c<17;c++)I+=parseInt(d.charAt(c),10)*o[c];return u[I%11]},L=function(d){return!d||d.length!==18?(console.error("\u8EAB\u4EFD\u8BC1\u53F7\u4E0D\u662F18\u4F4D\uFF01"),!1):"".concat(F(d))===d.charAt(17)},k=function(){for(var i={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},d=48;d<=57;d++)i[String.fromCharCode(d)]=d;for(var o=65;o<=90;o++)i[String.fromCharCode(o).toLowerCase()]=o;for(var u=96;u<=105;u++)i["num".concat(u-96)]=u;for(var I=112;I<=123;I++)i["f".concat(I-111)]=I;return i}(),X=a(5574),ra=a.n(X),Z=function(d){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:location.search;return(new RegExp("(^|\\?|&)".concat(d,"=(.*?)(?=&|#|$)"),"g").exec(o)||[])[2]},oa=function(d){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:location.search;return parseInt(Z(d,o)||"0",10)},_=function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:location.search,o=((d||"").split("?").pop()||"").split("#")[0]||"",u={};return o.split("&").map(function(I){return I.split("=")}).forEach(function(I){var c=ra()(I,2),s=c[0],b=c[1];u[s]=b||""}),u},aa=function(d,o,u){if(u=u||"".concat(location.pathname).concat(location.search),Z(d,u)!==void 0)return u.replace(new RegExp("(^|\\?|&)".concat(d,"=(.*?)(?=&|#|$)"),"g"),"$1".concat(d,"=").concat(o));var I=u.split("#"),c=ra()(I,2),s=c[0],b=c[1];return"".concat(s).concat(s.indexOf("?")<0?"?":"&").concat(d,"=").concat(o).concat(b?"#":"").concat(b||"")},ga=function(d,o){return o=o||"".concat(location.pathname).concat(location.search),o.replace(new RegExp("(^|\\?|&)".concat(d,"=.*?(&|#|$)"),"g"),function(u,I,c){return c==="&"?I:c})},Ia=function(d){return Object.keys(d||{}).filter(function(o){return d[o]!==void 0}).map(function(o){var u=E()(d[o])==="object"?JSON.stringify(d[o]):d[o];return"".concat(encodeURIComponent(o),"=").concat(encodeURIComponent(u))}).join("&")},ya=a(97857),Y=a.n(ya),ha=a(72004),Ma=a.n(ha),Ea=a(12444),Pa=a.n(Ea),Da=a(25098),Oa=a.n(Da),Ca=a(31996),Ra=a.n(Ca),La=a(26037),ba=a.n(La),Ta=a(12665),Aa=a.n(Ta),ia=function(d,o){var u=Object.assign({},(d==null?void 0:d.headers)||{},(o==null?void 0:o.headers)||{}),I=Object.assign({},(d==null?void 0:d.fetchOptions)||{},(o==null?void 0:o.fetchOptions)||{});return Object.assign({},d||{},o||{},{headers:u,fetchOptions:I})},Ua=function(i){Ra()(o,i);var d=ba()(o);function o(u,I){var c;return Pa()(this,o),c=d.call(this,u),Object.assign(Oa()(c),I||{}),c}return Ma()(o)}(Aa()(Error)),la=function(){var i=h()(A()().mark(function d(o,u){var I,c,s,b,S,T,K,x,f,C,y,R,W,$,B,ea,ua,J,G,na,Q,q,z,D,V,sa,ta,da;return A()().wrap(function(U){for(;;)switch(U.prev=U.next){case 0:if(c={errorMessage:"\u7CFB\u7EDF\u7E41\u5FD9\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",errorHandler:function(j){var fa;if(!((fa=u)!==null&&fa!==void 0&&fa.silent)&&j){var va,ma;(va=u)===null||va===void 0||(ma=va.toastHandler)===null||ma===void 0||ma.call(va,j)}throw new Error(j)},baseUrl:"",headers:{},fetchOptions:{credentials:"include"},checkSuccess:function(j){return(j==null?void 0:j.code)==0||(j==null?void 0:j.code)==200},toastHandler:function(j){return console.error("[\u60A8\u8FD8\u6CA1\u6709\u914D\u7F6EtoastHandler\uFF0C\u8BF7\u6839\u636E\u60A8\u7684UI\u7EC4\u4EF6\u5E93\u914D\u7F6E\u5408\u9002\u7684\u63D0\u793A\u65B9\u6CD5] ".concat(j||""))},onFetchResponse:function(j){if(j.status===200)return j.json();throw new Ua(j.statusText,{response:Y()(Y()({},j),{},{code:j.status,message:j.statusText,isHttpResponse:!0})})}},u=ia(c,u),s=u||{},b=s.params,S=s.data,T=s.formData,K=s.json,x=s.method,f=s.headers,C=s.baseUrl,y=s.fetchOptions,R=s.checkSuccess,W=s.afterRequest,$=s.errorHandler,B=s.errorMessage,ea=s.responseConverter,ua=s.onFetchResponse,J=s.setLoading,G=s.overrideMessage,na=((I=u)===null||I===void 0?void 0:I.defaultErrorMessage)||B,y.headers=Y()(Y()({},f||{}),y.headers||{}),b&&(y.method=x||"GET",o="".concat(o).concat(o.indexOf("?")>=0?"&":"?").concat(Ia(b))),S)Object.assign(y,{method:x||"POST",body:Ia(S),headers:Y()({"Content-Type":"application/x-www-form-urlencoded;charset=utf-8"},y.headers||{})});else if(T){if(Q=T,!(T instanceof FormData)){Q=new FormData;for(q in T)Q.append(q,T[q])}Object.assign(y,{method:x||"POST",body:Q})}else K&&Object.assign(y,{method:x||"POST",body:JSON.stringify(K),headers:Y()({"Content-Type":"application/json;charset=utf-8"},y.headers||{})});return z=null,J==null||J(!0),U.prev=9,D="".concat(/^(http|\/\/)/g.test(o)?"":C||"").concat(o),D.indexOf("//")===0&&location.protocol==="blob:"&&(D="".concat((V=location.pathname.split(":"))===null||V===void 0?void 0:V[0],":").concat(D)),U.next=14,fetch(D,y).then(ua);case 14:z=U.sent,U.next=25;break;case 17:return U.prev=17,U.t0=U.catch(9),console.error(U.t0),J==null||J(!1),W==null||W(!1,U.t0.response),ta=typeof G=="function"?G(U.t0.response):G,$==null||$(ta!=null?ta:((sa=U.t0.response)===null||sa===void 0?void 0:sa.message)||na,U.t0.response,u),U.abrupt("return",void 0);case 25:if(J==null||J(!1),z=ea?ea(z):z,!(R!=null&&R(z))){U.next=32;break}return W==null||W(!0,z),U.abrupt("return",z.data);case 32:return W==null||W(!1,z),da=typeof G=="function"?G(z):G,$==null||$(da!=null?da:z.message||na,z,u),U.abrupt("return",void 0);case 36:case"end":return U.stop()}},d,null,[[9,17]])}));return function(o,u){return i.apply(this,arguments)}}(),ja=function i(d){var o=ia(this.overrideDefaultOptions,d),u=function(c,s){return la(c,ia(o,s))};return u.overrideDefaultOptions=o,u.create=i.bind(u),u};la.create=ja.bind(la);var wa=function(d,o){var u=o;return o||(u=d,d=la),function(I,c){return d(I,Y()(Y()({},u||{}),c||{}))}},Wa=function(d,o){var u;if(!d)return"";if(typeof d=="number")d=new Date(d);else if(typeof d=="string")if(/^\d{12,13}$/g.test(d))d=new Date(parseInt(d,10));else if(/^.{10}T.{8,12}Z?$/g.test(d))d=new Date(d);else return d;if(!(d instanceof Date))throw new Error("formatDate error: not date.");if(isNaN((u=d)===null||u===void 0?void 0:u.getFullYear()))throw new Error("formatDate error: invalid date.");o=o||"yyyy-MM-dd HH:mm:ss";var I={y:d.getFullYear(),M:d.getMonth()+1,d:d.getDate(),q:Math.floor((d.getMonth()+3)/3),w:d.getDay(),H:d.getHours(),h:d.getHours()%12===0?12:d.getHours()%12,m:d.getMinutes(),s:d.getSeconds(),S:d.getMilliseconds()},c=["\u5929","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"],s=function(T){o=o.replace(new RegExp("".concat(T,"+"),"g"),function(K){var x="".concat(I[T]);if(T==="w")return"".concat(K.length>2?"\u661F\u671F":"\u5468").concat(c[x]);for(var f=0,C=x.length;f<K.length-C;f++)x="0".concat(x);return K.length===1?x:x.substring(x.length-K.length)})};for(var b in I)s(b);return o},Ba=function(d,o){o=o||"yyyy-MM-dd";var u={y:0,M:1,d:0,H:0,h:0,m:0,s:0,S:0};o.replace(/([^yMdHmsS]*?)(([yMdHmsS])\3*)([^yMdHmsS]*?)/g,function(c,s,b,S,T){return d=d.replace(new RegExp("".concat(s,"(\\d{").concat(b.length,"})").concat(T)),function(K,x){return u[S]=parseInt(x,10),""}),""}),u.M--;var I=new Date(u.y,u.M,u.d,u.H,u.m,u.s);return u.S!==0&&I.setMilliseconds(u.S),I},Sa=function(d){return new Promise(function(o){return setTimeout(o,d||0)})},ca=a(53662)},53662:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{Sk:function(){return formatJson},Yp:function(){return toUnderline},kD:function(){return getRandomStr},oi:function(){return toHump},sZ:function(){return getRandom}});var _Users_liuxianan1_workspace_youtil_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_typeof_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(52677),_Users_liuxianan1_workspace_youtil_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_typeof_js__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_Users_liuxianan1_workspace_youtil_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_typeof_js__WEBPACK_IMPORTED_MODULE_0__),formatJson=function formatJson(json,indent,leftBracesInSameLine){function getIndentStr(n){for(var e="",a=0;a<n;a++)e+=indent||" ";return e}function format(n,e){e=e===void 0?0:e;var a="";if(_Users_liuxianan1_workspace_youtil_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_typeof_js__WEBPACK_IMPORTED_MODULE_0___default()(n)==="object"&&n!=null){var t=n instanceof Array,r=0;a+="".concat(t?"[":"{",`
|
|
127
|
-
`);for(var l in n){a+=r++>0?`,
|
|
128
|
-
`:"";var P=_Users_liuxianan1_workspace_youtil_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_typeof_js__WEBPACK_IMPORTED_MODULE_0___default()(n[l])==="object"&&n[l]!=null,g=getIndentStr(e+1);a+=t&&P?"":g,a+=t?"":'"'.concat(l,'": ').concat(P&&!leftBracesInSameLine?`
|
|
129
|
-
`:""),a+=!P||P&&leftBracesInSameLine&&!t?"":g,a+=format(n[l],e+1)}a+=`
|
|
130
|
-
`.concat(getIndentStr(e)).concat(t?"]":"}")}else{var p=typeof n=="string"?'"':"";a+="".concat(p).concat(n).concat(p)}return a}return format(eval("(".concat(json,")")))},getRandom=function n(e,a){return typeof e=="number"?(typeof a=="undefined"&&(a=e,e=0),e+Math.floor(Math.random()*(a-e))):e instanceof Array?typeof a=="undefined"?e.length===0?null:e.length===1?e[0]:e[Math.floor(Math.random()*e.length)]:(e.sort(function(){return Math.random()>.5?1:-1}),e.slice(0,a)):Math.random()},getRandomStr=function n(e,a){e=e||18;var t="ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz0123456789".split("");a==="number"&&(t="0123456789".split(""));for(var r="",l=0;l<e;l++)r+=getRandom(t);return r},toUnderline=function n(e,a){return e.replace(/([A-Z])/g,function(t,r){return"".concat(a||"_").concat(r.toLowerCase())})},toHump=function n(e,a){return e.replace(new RegExp("".concat(a||"_","(\\w)"),"g"),function(t,r){return r.toUpperCase()})}},23122:function(n,e,a){"use strict";a.r(e),a.d(e,{texts:function(){return t}});const t=[{value:"youtil",paraId:0},{value:"youtil",paraId:1},{value:" / copyToClipboard",paraId:2},{value:"copyToClipboard",paraId:3,tocIndex:0},{value:"(",paraId:3,tocIndex:0},{value:"text",paraId:3,tocIndex:0},{value:", ",paraId:3,tocIndex:0},{value:"onFailure",paraId:3,tocIndex:0},{value:", ",paraId:3,tocIndex:0},{value:"supportSilent",paraId:3,tocIndex:0},{value:"): ",paraId:3,tocIndex:0},{value:"Promise",paraId:3,tocIndex:0},{value:"<",paraId:3,tocIndex:0},{value:"void",paraId:3,tocIndex:0},{value:">",paraId:3,tocIndex:0},{value:"Defined in: ",paraId:4,tocIndex:0},{value:"other.ts:58",paraId:4,tocIndex:0},{value:`\u590D\u5236\u4E00\u6BB5\u6587\u672C\u5230\u526A\u8D34\u677F\uFF0C\u5982\u679C\u5931\u8D25\u4F1A\u629B\u51FA\u5F02\u5E38\uFF0C\u63A8\u8350\u4F7F\u7528\u59FF\u52BF\uFF1A
|
|
131
|
-
await copyTextToClipboard('\u8981\u590D\u5236\u7684\u6587\u672C', message => alert(`,paraId:5,tocIndex:0},{value:"\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25\uFF1A${message}",paraId:5,tocIndex:0},{value:`));
|
|
132
|
-
alert('\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F\uFF01');`,paraId:5,tocIndex:0},{value:"string",paraId:6,tocIndex:2},{value:"\u8981\u590D\u5236\u7684\u6587\u672C",paraId:7,tocIndex:2},{value:"(",paraId:8,tocIndex:3},{value:"message",paraId:8,tocIndex:3},{value:") => ",paraId:8,tocIndex:3},{value:"void",paraId:8,tocIndex:3},{value:"\u5931\u8D25\u56DE\u8C03\uFF0C\u63A5\u53D7\u4E00\u4E2A message \u53C2\u6570",paraId:9,tocIndex:3},{value:"boolean",paraId:10,tocIndex:4},{value:"\u662F\u5426\u652F\u6301\u540E\u53F0\u9759\u9ED8\u590D\u5236\uFF0C\u5982\u679C\u662F\u5219\u4F18\u5148\u91C7\u7528 execCommand",paraId:11,tocIndex:4},{value:"Promise",paraId:12,tocIndex:5},{value:"<",paraId:12,tocIndex:5},{value:"void",paraId:12,tocIndex:5},{value:">",paraId:12,tocIndex:5}]},46207:function(n,e,a){"use strict";a.r(e),a.d(e,{texts:function(){return t}});const t=[{value:"youtil",paraId:0},{value:"youtil",paraId:1},{value:" / createEnum",paraId:2},{value:"createEnum",paraId:3,tocIndex:0},{value:"<",paraId:3,tocIndex:0},{value:"T",paraId:3,tocIndex:0},{value:">(",paraId:3,tocIndex:0},{value:"items",paraId:3,tocIndex:0},{value:"): ",paraId:3,tocIndex:0},{value:"EnumType",paraId:4,tocIndex:0},{value:"<",paraId:3,tocIndex:0},{value:"T",paraId:3,tocIndex:0},{value:">",paraId:3,tocIndex:0},{value:"Defined in: ",paraId:5,tocIndex:0},{value:"enum.ts:38",paraId:5,tocIndex:0},{value:"\u521B\u5EFA\u4E00\u4E2A\u679A\u4E3E\uFF0C\u652F\u6301\u591A\u79CD\u9AD8\u7EA7\u7528\u6CD5\uFF1A",paraId:6,tocIndex:0},{value:`
|
|
133
|
-
const enums = createEnum([{ key: 'MAN', label: '\u7537', value: 1 }])`,paraId:6,tocIndex:0},{value:`
|
|
134
|
-
console.log(enums.MAN) // 1`,paraId:6,tocIndex:0},{value:`
|
|
135
|
-
console.log(enums.pick('MAN')) // \u5BF9\u8C61`,paraId:6,tocIndex:0},{value:`
|
|
136
|
-
console.log(enums.pick(1)) // \u5BF9\u8C61`,paraId:6,tocIndex:0},{value:`
|
|
137
|
-
console.log(enums.pickLabel('MAN')) // \u7537`,paraId:6,tocIndex:0},{value:`
|
|
138
|
-
console.log(enums.pickValue('MAN')) // 1`,paraId:6,tocIndex:0},{value:`
|
|
139
|
-
console.log(enums) // \u6570\u7EC4\u5BF9\u8C61`,paraId:6,tocIndex:0},{value:"T",paraId:7,tocIndex:2},{value:" ",paraId:7,tocIndex:2},{value:"extends",paraId:7,tocIndex:2},{value:" readonly ",paraId:7,tocIndex:2},{value:"EnumItem",paraId:8,tocIndex:2},{value:"<",paraId:7,tocIndex:2},{value:"string",paraId:7,tocIndex:2},{value:", ",paraId:7,tocIndex:2},{value:"string",paraId:7,tocIndex:2},{value:" | ",paraId:7,tocIndex:2},{value:"number",paraId:7,tocIndex:2},{value:">[]",paraId:7,tocIndex:2},{value:"T",paraId:9,tocIndex:4},{value:"EnumType",paraId:10,tocIndex:5},{value:"<",paraId:11,tocIndex:5},{value:"T",paraId:11,tocIndex:5},{value:">",paraId:11,tocIndex:5}]},35319:function(n,e,a){"use strict";a.r(e),a.d(e,{texts:function(){return t}});const t=[{value:"youtil",paraId:0},{value:"youtil",paraId:1},{value:" / decodeHtml",paraId:2},{value:"decodeHtml",paraId:3,tocIndex:0},{value:"(",paraId:3,tocIndex:0},{value:"html",paraId:3,tocIndex:0},{value:"): ",paraId:3,tocIndex:0},{value:"any",paraId:3,tocIndex:0},{value:"Defined in: ",paraId:4,tocIndex:0},{value:"other.ts:36",paraId:4,tocIndex:0},{value:'HTML\u89E3\u7801\uFF0C\u4F8B\u5982\u5C06 \u3010"\u3011 \u53D8\u6210 \u3010"\u3011',paraId:5,tocIndex:0},{value:"any",paraId:6,tocIndex:2},{value:"\u5DF2\u7ECF\u88ABHTML\u7F16\u7801\u8FC7\u7684\u5B57\u7B26\u4E32\uFF0C\u5982\u679C\u4F20\u5165\u5BF9\u8C61\u4F1A\u904D\u5386\u5904\u7406",paraId:7,tocIndex:2},{value:"any",paraId:8,tocIndex:3}]},61220:function(n,e,a){"use strict";a.r(e),a.d(e,{texts:function(){return t}});const t=[{value:"youtil",paraId:0},{value:"youtil",paraId:1},{value:" / deepCopy",paraId:2},{value:"deepCopy",paraId:3,tocIndex:0},{value:"(",paraId:3,tocIndex:0},{value:"obj",paraId:3,tocIndex:0},{value:"): ",paraId:3,tocIndex:0},{value:"any",paraId:3,tocIndex:0},{value:"Defined in: ",paraId:4,tocIndex:0},{value:"other.ts:6",paraId:4,tocIndex:0},{value:"\u57FA\u4E8EJSON\u7684\u7B80\u5355\u6DF1\u62F7\u8D1D",paraId:5,tocIndex:0},{value:"any",paraId:6,tocIndex:2},{value:"\u8981\u590D\u5236\u7684\u5BF9\u8C61\uFF0C\u975E\u5BF9\u8C61\u683C\u5F0F\u4F1A\u76F4\u63A5\u8FD4\u56DE",paraId:7,tocIndex:2},{value:"any",paraId:8,tocIndex:3}]},68500:function(n,e,a){"use strict";a.r(e),a.d(e,{texts:function(){return t}});const t=[{value:"youtil",paraId:0},{value:"youtil",paraId:1},{value:" / delParam",paraId:2},{value:"delParam",paraId:3,tocIndex:0},{value:"(",paraId:3,tocIndex:0},{value:"name",paraId:3,tocIndex:0},{value:", ",paraId:3,tocIndex:0},{value:"url",paraId:3,tocIndex:0},{value:"): ",paraId:3,tocIndex:0},{value:"string",paraId:3,tocIndex:0},{value:"Defined in: ",paraId:4,tocIndex:0},{value:"param.ts:65",paraId:4,tocIndex:0},{value:`\u5220\u9664URL\u4E2D\u67D0\u4E2A\u53C2\u6570
|
|
140
|
-
delParam('a', '?a=1&b=2&a=3#d') // '?b=2#d'
|
|
141
|
-
delParam('b', '?a=1&b=2&a=3#d') // '?a=1&a=3#d'
|
|
142
|
-
delParam('a', '?a=1#d') // '#d'`,paraId:5,tocIndex:0},{value:"string",paraId:6,tocIndex:2},{value:"\u53C2\u6570\u540D",paraId:7,tocIndex:2},{value:"string",paraId:8,tocIndex:3},{value:"\u8981\u5220\u9664\u7684URL\uFF0C\u9ED8\u8BA4\u5F53\u524D\u9875\u9762URL",paraId:9,tocIndex:3},{value:"string",paraId:10,tocIndex:4},{value:"\u5904\u7406\u5B8C\u540E\u7684URL",paraId:11,tocIndex:4}]},90373:function(n,e,a){"use strict";a.r(e),a.d(e,{texts:function(){return t}});const t=[{value:"youtil",paraId:0},{value:"youtil",paraId:1},{value:" / encodeHtml",paraId:2},{value:"encodeHtml",paraId:3,tocIndex:0},{value:"(",paraId:3,tocIndex:0},{value:"html",paraId:3,tocIndex:0},{value:"): ",paraId:3,tocIndex:0},{value:"any",paraId:3,tocIndex:0},{value:"Defined in: ",paraId:4,tocIndex:0},{value:"other.ts:18",paraId:4,tocIndex:0},{value:'HTML\u7F16\u7801\uFF0C\u4F8B\u5982\u5C06 \u3010"\u3011 \u53D8\u6210 \u3010"\u3011',paraId:5,tocIndex:0},{value:"any",paraId:6,tocIndex:2},{value:"\u5F85\u7F16\u7801\u7684\u539F\u59CB\u5B57\u7B26\u4E32\uFF0C\u5982\u679C\u4F20\u5165\u5BF9\u8C61\u4F1A\u904D\u5386\u5904\u7406",paraId:7,tocIndex:2},{value:"any",paraId:8,tocIndex:3}]},86137:function(n,e,a){"use strict";a.r(e),a.d(e,{texts:function(){return t}});const t=[{value:"youtil",paraId:0},{value:"youtil",paraId:1},{value:" / formatDate",paraId:2},{value:"formatDate",paraId:3,tocIndex:0},{value:"(",paraId:3,tocIndex:0},{value:"date",paraId:3,tocIndex:0},{value:"?, ",paraId:3,tocIndex:0},{value:"fmt",paraId:3,tocIndex:0},{value:"?): ",paraId:3,tocIndex:0},{value:"string",paraId:3,tocIndex:0},{value:"Defined in: ",paraId:4,tocIndex:0},{value:"time.ts:8",paraId:4,tocIndex:0},{value:"\u5C06\u65E5\u671F\u683C\u5F0F\u5316\u6210\u6307\u5B9A\u683C\u5F0F\u7684\u5B57\u7B26\u4E32",paraId:5,tocIndex:0},{value:"\u8981\u683C\u5F0F\u5316\u7684\u65E5\u671F\uFF0C\u4E0D\u4F20\u65F6\u9ED8\u8BA4\u5F53\u524D\u65F6\u95F4\uFF0C\u4E5F\u53EF\u4EE5\u662F\u4E00\u4E2A\u65F6\u95F4\u6233\u7B49",paraId:6,tocIndex:2},{value:"string",paraId:7,tocIndex:2},{value:" | ",paraId:7,tocIndex:2},{value:"number",paraId:7,tocIndex:2},{value:" | ",paraId:7,tocIndex:2},{value:"Date",paraId:7,tocIndex:2},{value:"string",paraId:8,tocIndex:3},{value:"\u76EE\u6807\u5B57\u7B26\u4E32\u683C\u5F0F\uFF0C\u652F\u6301\u7684\u5B57\u7B26\u6709\uFF1Ay,M,d,q,w,H,h,m,S\uFF0C\u9ED8\u8BA4\uFF1Ayyyy-MM-dd HH:mm:ss",paraId:9,tocIndex:3},{value:"string",paraId:10,tocIndex:4},{value:"\u8FD4\u56DE\u683C\u5F0F\u5316\u540E\u7684\u65E5\u671F\u5B57\u7B26\u4E32",paraId:11,tocIndex:4}]},45898:function(n,e,a){"use strict";a.r(e),a.d(e,{texts:function(){return t}});const t=[{value:"youtil",paraId:0},{value:"youtil",paraId:1},{value:" / formatJson",paraId:2},{value:"formatJson",paraId:3,tocIndex:0},{value:"(",paraId:3,tocIndex:0},{value:"json",paraId:3,tocIndex:0},{value:", ",paraId:3,tocIndex:0},{value:"indent",paraId:3,tocIndex:0},{value:"?, ",paraId:3,tocIndex:0},{value:"leftBracesInSameLine",paraId:3,tocIndex:0},{value:"?): ",paraId:3,tocIndex:0},{value:"string",paraId:3,tocIndex:0},{value:"Defined in: ",paraId:4,tocIndex:0},{value:"string.ts:10",paraId:4,tocIndex:0},{value:`\u683C\u5F0F\u5316\u4E00\u6BB5JSON\u5B57\u7B26\u4E32\uFF0C\u652F\u6301\u89E3\u6790\u975E\u6807\u51C6JSON
|
|
143
|
-
\u4E0D\u540C\u4E8E\u7EDD\u5927\u591A\u6570\u683C\u5F0F\u5316\u5DE5\u5177\uFF0C\u672C\u65B9\u6CD5\u652F\u6301\u8BBE\u7F6E\u7F29\u8FDB\u65B9\u5F0F\u4EE5\u53CA\u5DE6\u5927\u62EC\u53F7\u662F\u5426\u6362\u884C`,paraId:5,tocIndex:0},{value:"string",paraId:6,tocIndex:2},{value:"\u8981\u683C\u5F0F\u5316\u7684json\u4E32",paraId:7,tocIndex:2},{value:"string",paraId:8,tocIndex:3},{value:'\u7F29\u8FDB\u65B9\u5F0F\uFF0C\u53EF\u4EE5\u662F\u82E5\u5E72\u4E2A\u7A7A\u683C\u548Ctab\uFF0C\u9ED8\u8BA4tab\u7F29\u8FDB\uFF0C\u5982 2\u4E2A\u7A7A\u683C\uFF1A" "\u30014\u4E2A\u7A7A\u683C\uFF1A" "\u3001tab\uFF1A" "',paraId:9,tocIndex:3},{value:"boolean",paraId:10,tocIndex:4},{value:"\u5DE6\u5927\u62EC\u53F7\u662F\u5426\u4FDD\u6301\u5728\u540C\u4E00\u884C\uFF0C\u9ED8\u8BA4 false",paraId:11,tocIndex:4},{value:"string",paraId:12,tocIndex:5},{value:"2016-08-24",paraId:13,tocIndex:6}]},32091:function(n,e,a){"use strict";a.r(e),a.d(e,{texts:function(){return t}});const t=[{value:"youtil",paraId:0},{value:"youtil",paraId:1},{value:" / getIdCardLastChar",paraId:2},{value:"getIdCardLastChar",paraId:3,tocIndex:0},{value:"(",paraId:3,tocIndex:0},{value:"cid",paraId:3,tocIndex:0},{value:"): ",paraId:3,tocIndex:0},{value:"string",paraId:3,tocIndex:0},{value:"Defined in: ",paraId:4,tocIndex:0},{value:"other.ts:99",paraId:4,tocIndex:0},{value:"\u83B7\u53D6\u8EAB\u4EFD\u8BC1\u53F7\u7B2C18\u4F4D\u6821\u9A8C\u7801",paraId:5,tocIndex:0},{value:"string",paraId:6,tocIndex:2},{value:"string",paraId:7,tocIndex:3},{value:"cid \u8EAB\u4EFD\u8BC1\u53F7\u7801\uFF0C17\u621618\u4F4D\u5747\u53EF",paraId:8,tocIndex:4}]},86221:function(n,e,a){"use strict";a.r(e),a.d(e,{texts:function(){return t}});const t=[{value:"youtil",paraId:0},{value:"youtil",paraId:1},{value:" / getParam",paraId:2},{value:"getParam",paraId:3,tocIndex:0},{value:"(",paraId:3,tocIndex:0},{value:"name",paraId:3,tocIndex:0},{value:", ",paraId:3,tocIndex:0},{value:"url",paraId:3,tocIndex:0},{value:"): ",paraId:3,tocIndex:0},{value:"string",paraId:3,tocIndex:0},{value:"Defined in: ",paraId:4,tocIndex:0},{value:"param.ts:10",paraId:4,tocIndex:0},{value:`\u4ECEURL\u4E2D\u83B7\u53D6\u67D0\u4E2A\u53C2\u6570\uFF0C\u5982\u679C\u4E0D\u5B58\u5728\u8FD4\u56DE undefined \uFF0C\u5982\u679C\u5B58\u5728\u591A\u4E2A\u540C\u540D\u53C2\u6570\uFF0C\u8FD4\u56DE\u7B2C\u4E00\u4E2A\u5339\u914D\u503C
|
|
144
|
-
getParam('a', '?a=1&b=&c=3&c=33#abc') // '1'
|
|
145
|
-
getParam('b', '?a=1&b=&c=3&c=33#abc') // ''
|
|
146
|
-
getParam('c', '?a=1&b=&c=3&c=33#abc') // 3
|
|
147
|
-
getParam('d', '?a=1&b=&c=3&c=33#abc') // undefined`,paraId:5,tocIndex:0},{value:"string",paraId:6,tocIndex:2},{value:"\u53C2\u6570\u540D",paraId:7,tocIndex:2},{value:"string",paraId:8,tocIndex:3},{value:" = ",paraId:8,tocIndex:3},{value:"location.search",paraId:8,tocIndex:3},{value:"\u8981\u83B7\u53D6\u7684URL\uFF0C\u9ED8\u8BA4\u5F53\u524D\u5730\u5740",paraId:9,tocIndex:3},{value:"string",paraId:10,tocIndex:4}]},60745:function(n,e,a){"use strict";a.r(e),a.d(e,{texts:function(){return t}});const t=[{value:"youtil",paraId:0},{value:"youtil",paraId:1},{value:" / getParamInt",paraId:2},{value:"getParamInt",paraId:3,tocIndex:0},{value:"(",paraId:3,tocIndex:0},{value:"name",paraId:3,tocIndex:0},{value:", ",paraId:3,tocIndex:0},{value:"url",paraId:3,tocIndex:0},{value:"): ",paraId:3,tocIndex:0},{value:"number",paraId:3,tocIndex:0},{value:"Defined in: ",paraId:4,tocIndex:0},{value:"param.ts:19",paraId:4,tocIndex:0},{value:"\u4ECEURL\u4E2D\u83B7\u53D6int\u53C2\u6570",paraId:5,tocIndex:0},{value:"string",paraId:6,tocIndex:2},{value:"\u53C2\u6570\u540D",paraId:7,tocIndex:2},{value:"string",paraId:8,tocIndex:3},{value:" = ",paraId:8,tocIndex:3},{value:"location.search",paraId:8,tocIndex:3},{value:"\u8981\u83B7\u53D6\u7684URL\uFF0C\u9ED8\u8BA4\u5F53\u524D\u5730\u5740",paraId:9,tocIndex:3},{value:"number",paraId:10,tocIndex:4}]},17251:function(n,e,a){"use strict";a.r(e),a.d(e,{texts:function(){return t}});const t=[{value:"youtil",paraId:0},{value:"youtil",paraId:1},{value:" / getParams",paraId:2},{value:"getParams",paraId:3,tocIndex:0},{value:"(",paraId:3,tocIndex:0},{value:"url",paraId:3,tocIndex:0},{value:"): ",paraId:3,tocIndex:0},{value:"any",paraId:3,tocIndex:0},{value:"Defined in: ",paraId:4,tocIndex:0},{value:"param.ts:29",paraId:4,tocIndex:0},{value:`\u83B7\u53D6\u67D0\u4E2AURL\u7684\u5168\u90E8\u53C2\u6570
|
|
148
|
-
getParams('?a=1&b=2#cc') // {a: '1', b: '2'}`,paraId:5,tocIndex:0},{value:"string",paraId:6,tocIndex:2},{value:" = ",paraId:6,tocIndex:2},{value:"location.search",paraId:6,tocIndex:2},{value:"any",paraId:7,tocIndex:3},{value:"\u53C2\u6570\u5BF9\u8C61",paraId:8,tocIndex:3}]},91072:function(n,e,a){"use strict";a.r(e),a.d(e,{texts:function(){return t}});const t=[{value:"youtil",paraId:0},{value:"youtil",paraId:1},{value:" / getRandom",paraId:2},{value:"getRandom",paraId:3,tocIndex:0},{value:"(",paraId:3,tocIndex:0},{value:"start",paraId:3,tocIndex:0},{value:"?, ",paraId:3,tocIndex:0},{value:"end",paraId:3,tocIndex:0},{value:"?): ",paraId:3,tocIndex:0},{value:"any",paraId:3,tocIndex:0},{value:"Defined in: ",paraId:4,tocIndex:0},{value:"string.ts:56",paraId:4,tocIndex:0},{value:`\u83B7\u53D6\u5404\u79CD\u968F\u673A\u6570\uFF0C\u652F\u6301\u5982\u4E0B\u51E0\u79CD\u8C03\u7528\u65B9\u5F0F\uFF1A
|
|
149
|
-
getRandom() \u8FD4\u56DE0-1\u7684\u968F\u673A\u5C0F\u6570\uFF0C\u7B49\u540C\u4E8EMath.random()\uFF0C0 <= result < 1
|
|
150
|
-
getRandom(start, end) \u8FD4\u56DEstart-end\u7684\u968F\u673A\u6574\u6570\uFF0Cstart <= result < end
|
|
151
|
-
getRandom(end) \u8FD4\u56DE0-end\u7684\u968F\u673A\u6574\u6570\uFF0C0 <= result < end
|
|
152
|
-
getRandom(array) \u968F\u673A\u8FD4\u56DE\u6570\u7EC4\u4E2D\u7684\u67D0\u4E00\u4E2A\u5185\u5BB9
|
|
153
|
-
getRandom(array, count) \u968F\u673A\u4ECE\u6570\u7EC4\u4E2D\u8FD4\u56DE\u957F\u5EA6\u4E3Acount\u7684\u4E0D\u91CD\u590D\u5185\u5BB9\u7EC4\u6210\u7684\u65B0\u6570\u7EC4\uFF0C\u5982\u679C\u4E0D\u8DB3count\u4E2A\uFF0C\u8FD4\u56DE\u5168\u90E8 \u5E76\u4E71\u5E8F`,paraId:5,tocIndex:0},{value:"any",paraId:6,tocIndex:2},{value:"any",paraId:7,tocIndex:3},{value:"any",paraId:8,tocIndex:4}]},46522:function(n,e,a){"use strict";a.r(e),a.d(e,{texts:function(){return t}});const t=[{value:"youtil",paraId:0},{value:"youtil",paraId:1},{value:" / getRandomStr",paraId:2},{value:"getRandomStr",paraId:3,tocIndex:0},{value:"(",paraId:3,tocIndex:0},{value:"length",paraId:3,tocIndex:0},{value:", ",paraId:3,tocIndex:0},{value:"type",paraId:3,tocIndex:0},{value:"?): ",paraId:3,tocIndex:0},{value:"string",paraId:3,tocIndex:0},{value:"Defined in: ",paraId:4,tocIndex:0},{value:"string.ts:82",paraId:4,tocIndex:0},{value:"\u83B7\u53D6\u968F\u673A\u5B57\u7B26\u4E32",paraId:5,tocIndex:0},{value:"number",paraId:6,tocIndex:2},{value:"\u5B57\u7B26\u4E32\u957F\u5EA6",paraId:7,tocIndex:2},{value:"all \u8868\u793A\u6240\u6709\uFF0Cnumber\u8868\u793A\u4EC5\u6570\u5B57\uFF0C\u9ED8\u8BA4\u6240\u6709",paraId:8,tocIndex:3},{value:'"number"',paraId:9,tocIndex:3},{value:" | ",paraId:9,tocIndex:3},{value:'"all"',paraId:9,tocIndex:3},{value:"string",paraId:10,tocIndex:4},{value:"string",paraId:11,tocIndex:4}]},76815:function(n,e,a){"use strict";a.r(e),a.d(e,{texts:function(){return t}});const t=[{value:"youtil",paraId:0},{value:"youtil",paraId:1},{value:" / hideLoading",paraId:2},{value:"hideLoading",paraId:3,tocIndex:0},{value:"(): ",paraId:3,tocIndex:0},{value:"void",paraId:3,tocIndex:0},{value:"Defined in: ",paraId:4,tocIndex:0},{value:"loading.ts:118",paraId:4,tocIndex:0},{value:"\u4E3B\u52A8\u5173\u95EDloading\u63D0\u793A",paraId:5,tocIndex:0},{value:"void",paraId:6,tocIndex:1}]},52974:function(n,e,a){"use strict";a.r(e),a.d(e,{texts:function(){return t}});const t=[{value:"youtil",paraId:0},{value:"youtil",paraId:1},{value:" / initWindowMessage",paraId:2},{value:"initWindowMessage",paraId:3,tocIndex:0},{value:"(",paraId:3,tocIndex:0},{value:"scene",paraId:3,tocIndex:0},{value:", ",paraId:3,tocIndex:0},{value:"targetWindow",paraId:3,tocIndex:0},{value:"?): ",paraId:3,tocIndex:0},{value:"object",paraId:3,tocIndex:0},{value:"Defined in: ",paraId:4,tocIndex:0},{value:"message.ts:9",paraId:4,tocIndex:0},{value:"\u521D\u59CB\u5316\u7A97\u53E3\u901A\u4FE1",paraId:5,tocIndex:0},{value:"string",paraId:6,tocIndex:2},{value:"\u573A\u666F\uFF0C\u5FC5\u4F20\uFF0C\u4E92\u76F8\u901A\u4FE1\u76842\u4E2A\u7A97\u53E3\u5FC5\u987B\u4FDD\u8BC1 scene \u76F8\u540C",paraId:7,tocIndex:2},{value:"Window",paraId:8,tocIndex:3},{value:"\u76EE\u6807\u7A97\u53E3\u5BF9\u8C61(\u7236\u7A97\u53E3\u6216\u5B50\u7A97\u53E3)\uFF0C\u4E92\u76F8\u901A\u4FE1\u65F6\u5141\u8BB8\u6709\u4E00\u65B9\u4E0D\u4F20\uFF0C\u81EA\u52A8\u4ECE event.source \u83B7\u53D6",paraId:9,tocIndex:3},{value:"object",paraId:10,tocIndex:4},{value:"\u8FD4\u56DEpostMessage\u548ConMessage\u65B9\u6CD5",paraId:11,tocIndex:4},{value:"onMessage",paraId:12,tocIndex:5},{value:": (",paraId:12,tocIndex:5},{value:"eventName",paraId:12,tocIndex:5},{value:", ",paraId:12,tocIndex:5},{value:"listener",paraId:12,tocIndex:5},{value:") => ",paraId:12,tocIndex:5},{value:"void",paraId:12,tocIndex:5},{value:"\u76D1\u542C\u6D88\u606F",paraId:13,tocIndex:5},{value:"string",paraId:14,tocIndex:7},{value:"\u4E8B\u4EF6\u540D\u79F0",paraId:15,tocIndex:7},{value:"onMessageListener",paraId:16,tocIndex:8},{value:"\u76D1\u542C\u51FD\u6570(\u652F\u6301\u5F02\u6B65)\uFF1A(...params) => callbackValue",paraId:17,tocIndex:8},{value:"void",paraId:18,tocIndex:9},{value:"postMessage",paraId:19,tocIndex:10},{value:": <",paraId:19,tocIndex:10},{value:"T",paraId:19,tocIndex:10},{value:">(",paraId:19,tocIndex:10},{value:"eventName",paraId:19,tocIndex:10},{value:", ...",paraId:19,tocIndex:10},{value:"payload",paraId:19,tocIndex:10},{value:"?) => ",paraId:19,tocIndex:10},{value:"void",paraId:19,tocIndex:10},{value:" | ",paraId:19,tocIndex:10},{value:"Promise",paraId:19,tocIndex:10},{value:"<",paraId:19,tocIndex:10},{value:"T",paraId:19,tocIndex:10},{value:">",paraId:19,tocIndex:10},{value:"\u53D1\u9001\u6D88\u606F\u5E76\u7B49\u5F85\u54CD\u5E94",paraId:20,tocIndex:10},{value:"T",paraId:21,tocIndex:12},{value:"string",paraId:22,tocIndex:14},{value:"\u4E8B\u4EF6\u540D\u79F0",paraId:23,tocIndex:14},{value:"...",paraId:24,tocIndex:15},{value:"any",paraId:24,tocIndex:15},{value:"[]",paraId:24,tocIndex:15},{value:"\u8D1F\u8F7D\u6570\u636E",paraId:25,tocIndex:15},{value:"void",paraId:26,tocIndex:16},{value:" | ",paraId:26,tocIndex:16},{value:"Promise",paraId:26,tocIndex:16},{value:"<",paraId:26,tocIndex:16},{value:"T",paraId:26,tocIndex:16},{value:">",paraId:26,tocIndex:16},{value:"\u8FD4\u56DE\u4E00\u4E2APromise\uFF0Cresolve\u63A5\u6536\u56DE\u8C03\u6570\u636E",paraId:27,tocIndex:16}]},80510:function(n,e,a){"use strict";a.r(e),a.d(e,{texts:function(){return t}});const t=[{value:"youtil",paraId:0},{value:"youtil",paraId:1},{value:" / parseDate",paraId:2},{value:"parseDate",paraId:3,tocIndex:0},{value:"(",paraId:3,tocIndex:0},{value:"str",paraId:3,tocIndex:0},{value:", ",paraId:3,tocIndex:0},{value:"fmt",paraId:3,tocIndex:0},{value:"?): ",paraId:3,tocIndex:0},{value:"Date",paraId:3,tocIndex:0},{value:"Defined in: ",paraId:4,tocIndex:0},{value:"time.ts:67",paraId:4,tocIndex:0},{value:"\u5C06\u5B57\u7B26\u4E32\u89E3\u6790\u6210\u65E5\u671F",paraId:5,tocIndex:0},{value:"string",paraId:6,tocIndex:2},{value:"\u8F93\u5165\u7684\u65E5\u671F\u5B57\u7B26\u4E32\uFF0C\u5982'2014-09-13'",paraId:7,tocIndex:2},{value:"string",paraId:8,tocIndex:3},{value:"\u5B57\u7B26\u4E32\u683C\u5F0F\uFF0C\u9ED8\u8BA4'yyyy-MM-dd'\uFF0C\u652F\u6301\u5982\u4E0B\uFF1Ay\u3001M\u3001d\u3001H\u3001m\u3001s\u3001S\uFF0C\u4E0D\u652F\u6301w\u548Cq",paraId:9,tocIndex:3},{value:"Date",paraId:10,tocIndex:4},{value:"\u89E3\u6790\u540E\u7684Date\u7C7B\u578B\u65E5\u671F",paraId:11,tocIndex:4}]},16839:function(n,e,a){"use strict";a.r(e),a.d(e,{texts:function(){return t}});const t=[{value:"youtil",paraId:0},{value:"youtil",paraId:1},{value:" / request",paraId:2},{value:"request",paraId:3,tocIndex:0},{value:"<",paraId:3,tocIndex:0},{value:"T",paraId:3,tocIndex:0},{value:">(",paraId:3,tocIndex:0},{value:"url",paraId:3,tocIndex:0},{value:", ",paraId:3,tocIndex:0},{value:"options",paraId:3,tocIndex:0},{value:"?): ",paraId:3,tocIndex:0},{value:"Promise",paraId:3,tocIndex:0},{value:"<",paraId:3,tocIndex:0},{value:"T",paraId:3,tocIndex:0},{value:">",paraId:3,tocIndex:0},{value:"Defined in: ",paraId:4,tocIndex:0},{value:"request.ts:69",paraId:4,tocIndex:0},{value:"\u901A\u7528\u7684API\u8BF7\u6C42\u65B9\u6CD5",paraId:5,tocIndex:0},{value:"T",paraId:6,tocIndex:2},{value:" = ",paraId:6,tocIndex:2},{value:"any",paraId:6,tocIndex:2},{value:"string",paraId:7,tocIndex:4},{value:"IRequestOptions",paraId:8},{value:"Promise",paraId:9,tocIndex:6},{value:"<",paraId:9,tocIndex:6},{value:"T",paraId:9,tocIndex:6},{value:">",paraId:9,tocIndex:6}]},64961:function(n,e,a){"use strict";a.r(e),a.d(e,{texts:function(){return t}});const t=[{value:"youtil",paraId:0},{value:"youtil",paraId:1},{value:" / setParam",paraId:2},{value:"setParam",paraId:3,tocIndex:0},{value:"(",paraId:3,tocIndex:0},{value:"name",paraId:3,tocIndex:0},{value:", ",paraId:3,tocIndex:0},{value:"value",paraId:3,tocIndex:0},{value:", ",paraId:3,tocIndex:0},{value:"url",paraId:3,tocIndex:0},{value:"?): ",paraId:3,tocIndex:0},{value:"string",paraId:3,tocIndex:0},{value:"Defined in: ",paraId:4,tocIndex:0},{value:"param.ts:46",paraId:4,tocIndex:0},{value:`\u7ED9URL\u8BBE\u7F6E\u53C2\u6570\uFF0C\u5982\u679C\u5DF2\u7ECF\u5B58\u5728\uFF0C\u66FF\u6362\u4E4B\uFF0C\u517C\u5BB9hash\u5B58\u5728\u7684\u60C5\u51B5
|
|
154
|
-
setParam('a', '123', '?a=1&b=2&a=3#d') // '?a=123&b=2&a=123#d'
|
|
155
|
-
setParam('d', '444', '?a=1&b=2&a=3#d') // '?a=1&b=2&a=3&d=444#d'`,paraId:5,tocIndex:0},{value:"string",paraId:6,tocIndex:2},{value:"\u53C2\u6570\u540D",paraId:7,tocIndex:2},{value:"\u53C2\u6570\u503C",paraId:8,tocIndex:3},{value:"string",paraId:9,tocIndex:3},{value:" | ",paraId:9,tocIndex:3},{value:"number",paraId:9,tocIndex:3},{value:"string",paraId:10,tocIndex:4},{value:"\u5982\u679C\u4E0D\u4F20\u9ED8\u8BA4\u5F53\u524D\u9875\u9762URL",paraId:11,tocIndex:4},{value:"string",paraId:12,tocIndex:5}]},71754:function(n,e,a){"use strict";a.r(e),a.d(e,{texts:function(){return t}});const t=[{value:"youtil",paraId:0},{value:"youtil",paraId:1},{value:" / showLoading",paraId:2},{value:"showLoading",paraId:3,tocIndex:0},{value:"(",paraId:3,tocIndex:0},{value:"text",paraId:3,tocIndex:0},{value:", ",paraId:3,tocIndex:0},{value:"seconds",paraId:3,tocIndex:0},{value:", ",paraId:3,tocIndex:0},{value:"config",paraId:3,tocIndex:0},{value:"): ",paraId:3,tocIndex:0},{value:"void",paraId:3,tocIndex:0},{value:"Defined in: ",paraId:4,tocIndex:0},{value:"loading.ts:16",paraId:4,tocIndex:0},{value:"\u663E\u793A\u5168\u5C40loading\uFF0C\u4E0D\u4F9D\u8D56\u4EFB\u4F55\u6846\u67B6",paraId:5,tocIndex:0},{value:"string",paraId:6,tocIndex:2},{value:" = ",paraId:6,tocIndex:2},{value:"'\u8BF7\u7A0D\u5019'",paraId:6,tocIndex:2},{value:"\u63D0\u793A\u6587\u6848",paraId:7,tocIndex:2},{value:"number",paraId:8,tocIndex:3},{value:" = ",paraId:8,tocIndex:3},{value:"10",paraId:8,tocIndex:3},{value:"\u8D85\u65F6\u81EA\u52A8\u5173\u95ED\u65F6\u95F4\uFF0C\u5355\u4F4D\u79D2",paraId:9,tocIndex:3},{value:"IShowLoadingConfig",paraId:10,tocIndex:4},{value:" = ",paraId:11,tocIndex:4},{value:"{}",paraId:11,tocIndex:4},{value:"void",paraId:12,tocIndex:5}]},63471:function(n,e,a){"use strict";a.r(e),a.d(e,{texts:function(){return t}});const t=[{value:"youtil",paraId:0},{value:"youtil",paraId:1},{value:" / sleep",paraId:2},{value:"sleep",paraId:3,tocIndex:0},{value:"(",paraId:3,tocIndex:0},{value:"ms",paraId:3,tocIndex:0},{value:"?): ",paraId:3,tocIndex:0},{value:"Promise",paraId:3,tocIndex:0},{value:"<",paraId:3,tocIndex:0},{value:"unknown",paraId:3,tocIndex:0},{value:">",paraId:3,tocIndex:0},{value:"Defined in: ",paraId:4,tocIndex:0},{value:"time.ts:91",paraId:4,tocIndex:0},{value:`\u4F11\u606F\u4E00\u6BB5\u65F6\u95F4\uFF0C\u5355\u4F4D\u6BEB\u79D2
|
|
156
|
-
\u793A\u4F8B\uFF1Aawait sleep(200); // \u4F11\u606F200\u6BEB\u79D2`,paraId:5,tocIndex:0},{value:"number",paraId:6,tocIndex:2},{value:"\u8981\u4F11\u606F\u7684\u65F6\u95F4\uFF0C\u5355\u4F4D\u6BEB\u79D2\uFF0C\u4E0D\u4F20\u9ED8\u8BA40",paraId:7,tocIndex:2},{value:"Promise",paraId:8,tocIndex:3},{value:"<",paraId:8,tocIndex:3},{value:"unknown",paraId:8,tocIndex:3},{value:">",paraId:8,tocIndex:3}]},268:function(n,e,a){"use strict";a.r(e),a.d(e,{texts:function(){return t}});const t=[{value:"youtil",paraId:0},{value:"youtil",paraId:1},{value:" / toHump",paraId:2},{value:"toHump",paraId:3,tocIndex:0},{value:"(",paraId:3,tocIndex:0},{value:"str",paraId:3,tocIndex:0},{value:", ",paraId:3,tocIndex:0},{value:"flag",paraId:3,tocIndex:0},{value:"?): ",paraId:3,tocIndex:0},{value:"string",paraId:3,tocIndex:0},{value:"Defined in: ",paraId:4,tocIndex:0},{value:"string.ts:107",paraId:4,tocIndex:0},{value:`\u5B57\u7B26\u4E32\u8F6C\u9A7C\u5CF0\u5F62\u5F0F
|
|
157
|
-
\u793A\u4F8B\u4E00\uFF1A toHump('get_param')\uFF0C\u8FD4\u56DEgetParam
|
|
158
|
-
\u793A\u4F8B\u4E8C\uFF1A toHump('font-size','-')\uFF0C\u8FD4\u56DEfontSize`,paraId:5,tocIndex:0},{value:"string",paraId:6,tocIndex:2},{value:"string",paraId:7,tocIndex:3},{value:"string",paraId:8,tocIndex:4}]},3834:function(n,e,a){"use strict";a.r(e),a.d(e,{texts:function(){return t}});const t=[{value:"youtil",paraId:0},{value:"youtil",paraId:1},{value:" / toUnderline",paraId:2},{value:"toUnderline",paraId:3,tocIndex:0},{value:"(",paraId:3,tocIndex:0},{value:"str",paraId:3,tocIndex:0},{value:", ",paraId:3,tocIndex:0},{value:"flag",paraId:3,tocIndex:0},{value:"?): ",paraId:3,tocIndex:0},{value:"string",paraId:3,tocIndex:0},{value:"Defined in: ",paraId:4,tocIndex:0},{value:"string.ts:96",paraId:4,tocIndex:0},{value:"\u5B57\u7B26\u4E32\u8F6C\u4E0B\u5212\u7EBF\u5F62\u5F0F\uFF0C\u793A\u4F8B\uFF1AgetParam \u8F6C get_param",paraId:5,tocIndex:0},{value:"string",paraId:6,tocIndex:2},{value:"\u8981\u8F6C\u6362\u7684\u5B57\u7B26\u4E32",paraId:7,tocIndex:2},{value:"string",paraId:8,tocIndex:3},{value:"\u9ED8\u8BA4\u4E0B\u5212\u7EBF-\uFF0C\u4E5F\u53EF\u4EE5\u4F20\u5176\u5B83\u5B57\u7B26",paraId:9,tocIndex:3},{value:"string",paraId:10,tocIndex:4}]},44884:function(n,e,a){"use strict";a.r(e),a.d(e,{texts:function(){return t}});const t=[{value:"youtil",paraId:0},{value:"youtil",paraId:1},{value:" / toUrlParams",paraId:2},{value:"toUrlParams",paraId:3,tocIndex:0},{value:"(",paraId:3,tocIndex:0},{value:"data",paraId:3,tocIndex:0},{value:"): ",paraId:3,tocIndex:0},{value:"string",paraId:3,tocIndex:0},{value:"Defined in: ",paraId:4,tocIndex:0},{value:"param.ts:75",paraId:4,tocIndex:0},{value:"\u5C06\u4E00\u4E2A\u666E\u901A\u5BF9\u8C61\u8F6C\u4E3A a=1&b=2 \u7684URL\u683C\u5F0F\uFF0C\u4F1A\u81EA\u52A8\u8FC7\u6EE4undefined\u7684\u503C",paraId:5,tocIndex:0},{value:"any",paraId:6,tocIndex:2},{value:"\u4E00\u4E2A\u666E\u901A\u5BF9\u8C61\uFF0C\u5982\u679C\u5BF9\u8C61\u5D4C\u5BF9\u8C61\u5219\u4F1A\u88AB\u81EA\u52A8\u8F6C\u4E3AJSON",paraId:7,tocIndex:2},{value:"string",paraId:8,tocIndex:3},{value:"\u8FD4\u56DE\u7C7B\u4F3C a=1&b=2 \u7684\u5B57\u7B26\u4E32",paraId:9,tocIndex:3}]},967:function(n,e,a){"use strict";a.r(e),a.d(e,{texts:function(){return t}});const t=[{value:"youtil",paraId:0},{value:"youtil",paraId:1},{value:" / validateIdCard",paraId:2},{value:"validateIdCard",paraId:3,tocIndex:0},{value:"(",paraId:3,tocIndex:0},{value:"cid",paraId:3,tocIndex:0},{value:"): ",paraId:3,tocIndex:0},{value:"boolean",paraId:3,tocIndex:0},{value:"Defined in: ",paraId:4,tocIndex:0},{value:"other.ts:114",paraId:4,tocIndex:0},{value:"\u68C0\u6D4B\u67D0\u4E2A\u8EAB\u4EFD\u8BC1ID\u662F\u5426\u5408\u6CD5\uFF0C\u5305\u62EC\u957F\u5EA6\u548C\u6700\u540E\u4E00\u4F4D\u6821\u9A8C\u7801\u68C0\u6D4B",paraId:5,tocIndex:0},{value:"string",paraId:6,tocIndex:2},{value:"boolean",paraId:7,tocIndex:3},{value:"cid \u8EAB\u4EFD\u8BC1\u53F7\u7801\uFF0C\u5FC5\u987B\u662F18\u4F4D",paraId:8,tocIndex:4}]},1975:function(n,e,a){"use strict";a.r(e),a.d(e,{texts:function(){return t}});const t=[{value:"youtil",paraId:0},{value:"IRequestOptions",paraId:1,tocIndex:1},{value:"IShowLoadingConfig",paraId:2,tocIndex:1},{value:"EnumItem",paraId:3,tocIndex:2},{value:"EnumType",paraId:4,tocIndex:2},{value:"keyCodes",paraId:5,tocIndex:3},{value:"Request",paraId:6,tocIndex:3},{value:"copyToClipboard",paraId:7,tocIndex:4},{value:"createEnum",paraId:8,tocIndex:4},{value:"decodeHtml",paraId:9,tocIndex:4},{value:"deepCopy",paraId:10,tocIndex:4},{value:"delParam",paraId:11,tocIndex:4},{value:"encodeHtml",paraId:12,tocIndex:4},{value:"formatDate",paraId:13,tocIndex:4},{value:"formatJson",paraId:14,tocIndex:4},{value:"getIdCardLastChar",paraId:15,tocIndex:4},{value:"getParam",paraId:16,tocIndex:4},{value:"getParamInt",paraId:17,tocIndex:4},{value:"getParams",paraId:18,tocIndex:4},{value:"getRandom",paraId:19,tocIndex:4},{value:"getRandomStr",paraId:20,tocIndex:4},{value:"hideLoading",paraId:21,tocIndex:4},{value:"initWindowMessage",paraId:22,tocIndex:4},{value:"parseDate",paraId:23,tocIndex:4},{value:"request",paraId:24,tocIndex:4},{value:"setParam",paraId:25,tocIndex:4},{value:"showLoading",paraId:26,tocIndex:4},{value:"sleep",paraId:27,tocIndex:4},{value:"toHump",paraId:28,tocIndex:4},{value:"toUnderline",paraId:29,tocIndex:4},{value:"toUrlParams",paraId:30,tocIndex:4},{value:"validateIdCard",paraId:31,tocIndex:4}]},58361:function(n,e,a){"use strict";a.r(e),a.d(e,{texts:function(){return t}});const t=[{value:"youtil",paraId:0},{value:"youtil",paraId:1},{value:" / IRequestOptions",paraId:2},{value:"Defined in: ",paraId:3,tocIndex:0},{value:"request.ts:4",paraId:3,tocIndex:0},{value:"requestAPI\u7684\u7B2C\u4E8C\u4E2A\u53C2\u6570\u7C7B\u578B",paraId:4,tocIndex:0},{value:"optional",paraId:5,tocIndex:2},{value:" ",paraId:5,tocIndex:2},{value:"afterRequest",paraId:5,tocIndex:2},{value:": (",paraId:5,tocIndex:2},{value:"success",paraId:5,tocIndex:2},{value:", ",paraId:5,tocIndex:2},{value:"resp",paraId:5,tocIndex:2},{value:"?) => ",paraId:5,tocIndex:2},{value:"void",paraId:5,tocIndex:2},{value:"Defined in: ",paraId:6,tocIndex:2},{value:"request.ts:22",paraId:6,tocIndex:2},{value:"\u8BF7\u6C42\u5B8C\u6210\u4E4B\u540E\u89E6\u53D1\u7684\u94A9\u5B50\uFF0C\u65E0\u8BBA\u6210\u529F\u4E0E\u5426\u5747\u4F1A\u89E6\u53D1",paraId:7,tocIndex:2},{value:"boolean",paraId:8,tocIndex:4},{value:"any",paraId:9,tocIndex:5},{value:"void",paraId:10,tocIndex:6},{value:"optional",paraId:11,tocIndex:7},{value:" ",paraId:11,tocIndex:7},{value:"baseUrl",paraId:11,tocIndex:7},{value:": ",paraId:11,tocIndex:7},{value:"string",paraId:11,tocIndex:7},{value:"Defined in: ",paraId:12,tocIndex:7},{value:"request.ts:14",paraId:12,tocIndex:7},{value:"API\u524D\u7F00\uFF0C\u4E0D\u4F20\u9ED8\u8BA4\u4E3A\u7A7A",paraId:13,tocIndex:7},{value:"optional",paraId:14,tocIndex:8},{value:" ",paraId:14,tocIndex:8},{value:"checkSuccess",paraId:14,tocIndex:8},{value:": (",paraId:14,tocIndex:8},{value:"resp",paraId:14,tocIndex:8},{value:") => ",paraId:14,tocIndex:8},{value:"boolean",paraId:14,tocIndex:8},{value:"Defined in: ",paraId:15,tocIndex:8},{value:"request.ts:24",paraId:15,tocIndex:8},{value:"\u5224\u65AD\u63A5\u53E3\u662F\u5426\u8C03\u7528\u6210\u529F\uFF0C\u9ED8\u8BA4\u89C4\u5219 resp => resp.code == 0 || resp.code == 200",paraId:16,tocIndex:8},{value:"any",paraId:17,tocIndex:10},{value:"boolean",paraId:18,tocIndex:11},{value:"optional",paraId:19,tocIndex:12},{value:" ",paraId:19,tocIndex:12},{value:"data",paraId:19,tocIndex:12},{value:": ",paraId:19,tocIndex:12},{value:"Record",paraId:19,tocIndex:12},{value:"<",paraId:19,tocIndex:12},{value:"string",paraId:19,tocIndex:12},{value:", ",paraId:19,tocIndex:12},{value:"any",paraId:19,tocIndex:12},{value:">",paraId:19,tocIndex:12},{value:"Defined in: ",paraId:20,tocIndex:12},{value:"request.ts:8",paraId:20,tocIndex:12},{value:"POST\u8BF7\u6C42\u65F6\u4F20\u9012\u7684\u53C2\u6570",paraId:21,tocIndex:12},{value:"optional",paraId:22,tocIndex:13},{value:" ",paraId:22,tocIndex:13},{value:"defaultErrorMessage",paraId:22,tocIndex:13},{value:": ",paraId:22,tocIndex:13},{value:"string",paraId:22,tocIndex:13},{value:"Defined in: ",paraId:23,tocIndex:13},{value:"request.ts:30",paraId:23,tocIndex:13},{value:"\u540E\u7AEF\u672A\u8FD4\u56DE message \u65F6\u7684\u9ED8\u8BA4\u5F02\u5E38\u6587\u6848",paraId:24,tocIndex:13},{value:"optional",paraId:25,tocIndex:14},{value:" ",paraId:25,tocIndex:14},{value:"errorHandler",paraId:25,tocIndex:14},{value:": (",paraId:25,tocIndex:14},{value:"message",paraId:25,tocIndex:14},{value:", ",paraId:25,tocIndex:14},{value:"resp",paraId:25,tocIndex:14},{value:", ",paraId:25,tocIndex:14},{value:"options",paraId:25,tocIndex:14},{value:") => ",paraId:25,tocIndex:14},{value:"void",paraId:25,tocIndex:14},{value:"Defined in: ",paraId:26,tocIndex:14},{value:"request.ts:32",paraId:26,tocIndex:14},{value:"\u53D1\u751F\u5F02\u5E38\u65F6\u7684\u5904\u7406\u65B9\u6CD5\uFF0C\u4E00\u822C\u4E0D\u592A\u5EFA\u8BAE\u91CD\u5199\u6B64\u65B9\u6CD5",paraId:27,tocIndex:14},{value:"string",paraId:28,tocIndex:16},{value:"any",paraId:29,tocIndex:17},{value:"IRequestOptions",paraId:30,tocIndex:18},{value:"void",paraId:31,tocIndex:19},{value:"errorMessage?",paraId:32},{value:"optional",paraId:33,tocIndex:20},{value:" ",paraId:33,tocIndex:20},{value:"errorMessage",paraId:33,tocIndex:20},{value:": ",paraId:33,tocIndex:20},{value:"string",paraId:33,tocIndex:20},{value:"Defined in: ",paraId:34,tocIndex:20},{value:"request.ts:28",paraId:34,tocIndex:20},{value:"\u540E\u7AEF\u672A\u8FD4\u56DE message \u65F6\u7684\u9ED8\u8BA4\u5F02\u5E38\u6587\u6848\uFF0C\u7531\u4E8E\u540D\u79F0\u7ECF\u5E38\u5F15\u53D1\u6B67\u4E49\uFF0C\u4F30\u6539\u540D\u4E3A defaultErrorMessage",paraId:35,tocIndex:21},{value:"optional",paraId:36,tocIndex:22},{value:" ",paraId:36,tocIndex:22},{value:"fetchOptions",paraId:36,tocIndex:22},{value:": ",paraId:36,tocIndex:22},{value:"RequestInit",paraId:36,tocIndex:22},{value:"Defined in: ",paraId:37,tocIndex:22},{value:"request.ts:20",paraId:37,tocIndex:22},{value:"\u5176\u5B83\u81EA\u5B9A\u4E49fetchOptions\uFF0C\u4F18\u5148\u7EA7\u9AD8\u4E8E\u4E0A\u9762\u6240\u6709\u53C2\u6570",paraId:38,tocIndex:22},{value:"optional",paraId:39,tocIndex:23},{value:" ",paraId:39,tocIndex:23},{value:"formData",paraId:39,tocIndex:23},{value:": ",paraId:39,tocIndex:23},{value:"Record",paraId:39,tocIndex:23},{value:"<",paraId:39,tocIndex:23},{value:"string",paraId:39,tocIndex:23},{value:", ",paraId:39,tocIndex:23},{value:"any",paraId:39,tocIndex:23},{value:">",paraId:39,tocIndex:23},{value:"Defined in: ",paraId:40,tocIndex:23},{value:"request.ts:10",paraId:40,tocIndex:23},{value:"\u91C7\u7528formData\u6A21\u5F0F\u8BF7\u6C42\uFF0C\u53EF\u4EE5\u4F20\u5165\u666E\u901A\u7684\u5BF9\u8C61\uFF0C\u4E5F\u53EF\u4EE5\u4F20\u5165\u6807\u51C6\u7684formData",paraId:41,tocIndex:23},{value:"optional",paraId:42,tocIndex:24},{value:" ",paraId:42,tocIndex:24},{value:"headers",paraId:42,tocIndex:24},{value:": ",paraId:42,tocIndex:24},{value:"Record",paraId:42,tocIndex:24},{value:"<",paraId:42,tocIndex:24},{value:"string",paraId:42,tocIndex:24},{value:", ",paraId:42,tocIndex:24},{value:"any",paraId:42,tocIndex:24},{value:">",paraId:42,tocIndex:24},{value:"Defined in: ",paraId:43,tocIndex:24},{value:"request.ts:18",paraId:43,tocIndex:24},{value:"headers",paraId:44,tocIndex:24},{value:"optional",paraId:45,tocIndex:25},{value:" ",paraId:45,tocIndex:25},{value:"json",paraId:45,tocIndex:25},{value:": ",paraId:45,tocIndex:25},{value:"Record",paraId:45,tocIndex:25},{value:"<",paraId:45,tocIndex:25},{value:"string",paraId:45,tocIndex:25},{value:", ",paraId:45,tocIndex:25},{value:"any",paraId:45,tocIndex:25},{value:">",paraId:45,tocIndex:25},{value:"Defined in: ",paraId:46,tocIndex:25},{value:"request.ts:12",paraId:46,tocIndex:25},{value:"postJson\u8BF7\u6C42\u65F6\u4F20\u9012\u7684\u53C2\u6570",paraId:47,tocIndex:25},{value:"optional",paraId:48,tocIndex:26},{value:" ",paraId:48,tocIndex:26},{value:"method",paraId:48,tocIndex:26},{value:": ",paraId:48,tocIndex:26},{value:"string",paraId:48,tocIndex:26},{value:"Defined in: ",paraId:49,tocIndex:26},{value:"request.ts:16",paraId:49,tocIndex:26},{value:"\u8BF7\u6C42\u65B9\u6CD5\uFF0C\u7EDD\u5927\u90E8\u5206\u60C5\u51B5\u65E0\u9700\u624B\u52A8\u6307\u5B9A",paraId:50,tocIndex:26},{value:"optional",paraId:51,tocIndex:27},{value:" ",paraId:51,tocIndex:27},{value:"onFetchResponse",paraId:51,tocIndex:27},{value:": (",paraId:51,tocIndex:27},{value:"response",paraId:51,tocIndex:27},{value:") => ",paraId:51,tocIndex:27},{value:"any",paraId:51,tocIndex:27},{value:"Defined in: ",paraId:52,tocIndex:27},{value:"request.ts:38",paraId:52,tocIndex:27},{value:"\u81EA\u5B9A\u4E49 fetch.then() \uFF0C\u975E\u5E38\u5E95\u5C42\u7684\u4E00\u4E2A\u65B9\u6CD5\uFF0C\u975E\u5FC5\u8981\u8BF7\u52FF\u4F7F\u7528",paraId:53,tocIndex:27},{value:"Response",paraId:54,tocIndex:29},{value:"any",paraId:55,tocIndex:30},{value:"optional",paraId:56,tocIndex:31},{value:" ",paraId:56,tocIndex:31},{value:"overrideMessage",paraId:56,tocIndex:31},{value:": ",paraId:56,tocIndex:31},{value:"string",paraId:56,tocIndex:31},{value:" | (",paraId:56,tocIndex:31},{value:"resp",paraId:56,tocIndex:31},{value:") => ",paraId:56,tocIndex:31},{value:"string",paraId:56,tocIndex:31},{value:"Defined in: ",paraId:57,tocIndex:31},{value:"request.ts:42",paraId:57,tocIndex:31},{value:"\u8986\u76D6\u9ED8\u8BA4\u7684 resp.message \u81EA\u5B9A\u4E49\u5F02\u5E38\u629B\u51FA\u6587\u6848\uFF0C\u4E5F\u652F\u6301\u4F20\u5165\u65B9\u6CD5\uFF0C\u6CE8\u610F\u8FD4\u56DE''\u548Cundefined\u6548\u679C\u4E0D\u540C",paraId:58,tocIndex:31},{value:"optional",paraId:59,tocIndex:32},{value:" ",paraId:59,tocIndex:32},{value:"params",paraId:59,tocIndex:32},{value:": ",paraId:59,tocIndex:32},{value:"Record",paraId:59,tocIndex:32},{value:"<",paraId:59,tocIndex:32},{value:"string",paraId:59,tocIndex:32},{value:", ",paraId:59,tocIndex:32},{value:"any",paraId:59,tocIndex:32},{value:">",paraId:59,tocIndex:32},{value:"Defined in: ",paraId:60,tocIndex:32},{value:"request.ts:6",paraId:60,tocIndex:32},{value:"GET\u8BF7\u6C42\u65F6\u4F20\u9012\u7684\u53C2\u6570",paraId:61,tocIndex:32},{value:"optional",paraId:62,tocIndex:33},{value:" ",paraId:62,tocIndex:33},{value:"responseConverter",paraId:62,tocIndex:33},{value:": (",paraId:62,tocIndex:33},{value:"resp",paraId:62,tocIndex:33},{value:") => ",paraId:62,tocIndex:33},{value:"any",paraId:62,tocIndex:33},{value:"Defined in: ",paraId:63,tocIndex:33},{value:"request.ts:26",paraId:63,tocIndex:33},{value:"\u5BF9\u54CD\u5E94\u8FDB\u884C\u81EA\u5B9A\u4E49\u683C\u5F0F\u5316\u5904\u7406\uFF0C\u5305\u542B checkSuccess \u5168\u90E8\u80FD\u529B",paraId:64,tocIndex:33},{value:"any",paraId:65,tocIndex:35},{value:"any",paraId:66,tocIndex:36},{value:"optional",paraId:67,tocIndex:37},{value:" ",paraId:67,tocIndex:37},{value:"setLoading",paraId:67,tocIndex:37},{value:": (",paraId:67,tocIndex:37},{value:"loading",paraId:67,tocIndex:37},{value:"?) => ",paraId:67,tocIndex:37},{value:"void",paraId:67,tocIndex:37},{value:"Defined in: ",paraId:68,tocIndex:37},{value:"request.ts:40",paraId:68,tocIndex:37},{value:"\u5207\u6362loading\u72B6\u6001\u7684\u65B9\u6CD5\uFF0C\u4F1A\u5728\u5F00\u59CB\u8BF7\u6C42\u524D\u7F6E\u4E3Atrue\uFF0C\u7ED3\u675F\u65F6\u7F6E\u4E3Afalse\u3002\u4E3A\u4EC0\u4E48\u8BBE\u8BA1\u8FD9\u4E2A\u65B9\u6CD5\uFF1F\u5728\u975Ehooks\u573A\u666F\u4E0B\u66F4\u65B9\u4FBF\u7684\u5207\u6362loading\u72B6\u6001",paraId:69,tocIndex:37},{value:"boolean",paraId:70,tocIndex:39},{value:"void",paraId:71,tocIndex:40},{value:"optional",paraId:72,tocIndex:41},{value:" ",paraId:72,tocIndex:41},{value:"silent",paraId:72,tocIndex:41},{value:": ",paraId:72,tocIndex:41},{value:"boolean",paraId:72,tocIndex:41},{value:"Defined in: ",paraId:73,tocIndex:41},{value:"request.ts:36",paraId:73,tocIndex:41},{value:"\u662F\u5426\u5173\u95ED\u9ED8\u8BA4\u7684\u5F02\u5E38toast",paraId:74,tocIndex:41},{value:"optional",paraId:75,tocIndex:42},{value:" ",paraId:75,tocIndex:42},{value:"toastHandler",paraId:75,tocIndex:42},{value:": (",paraId:75,tocIndex:42},{value:"message",paraId:75,tocIndex:42},{value:") => ",paraId:75,tocIndex:42},{value:"void",paraId:75,tocIndex:42},{value:"Defined in: ",paraId:76,tocIndex:42},{value:"request.ts:34",paraId:76,tocIndex:42},{value:"\u81EA\u5B9A\u4E49toast\u5B9E\u73B0\uFF0C\u4E3A\u4E86\u548CUI\u89E3\u8026\uFF0C\u65B9\u6CD5\u9ED8\u8BA4\u4E0D\u5305\u542BUI\u5904\u7406\u4EE3\u7801",paraId:77,tocIndex:42},{value:"string",paraId:78,tocIndex:44},{value:"void",paraId:79,tocIndex:45}]},25457:function(n,e,a){"use strict";a.r(e),a.d(e,{texts:function(){return t}});const t=[{value:"youtil",paraId:0},{value:"youtil",paraId:1},{value:" / IShowLoadingConfig",paraId:2},{value:"Defined in: ",paraId:3,tocIndex:0},{value:"loading.ts:2",paraId:3,tocIndex:0},{value:"showLoading\u914D\u7F6E",paraId:4,tocIndex:0},{value:"optional",paraId:5,tocIndex:2},{value:" ",paraId:5,tocIndex:2},{value:"cancelInline",paraId:5,tocIndex:2},{value:": ",paraId:5,tocIndex:2},{value:"boolean",paraId:5,tocIndex:2},{value:"Defined in: ",paraId:6,tocIndex:2},{value:"loading.ts:5",paraId:6,tocIndex:2},{value:"optional",paraId:7,tocIndex:3},{value:" ",paraId:7,tocIndex:3},{value:"hasMask",paraId:7,tocIndex:3},{value:": ",paraId:7,tocIndex:3},{value:"boolean",paraId:7,tocIndex:3},{value:"Defined in: ",paraId:8,tocIndex:3},{value:"loading.ts:3",paraId:8,tocIndex:3},{value:"optional",paraId:9,tocIndex:4},{value:" ",paraId:9,tocIndex:4},{value:"id",paraId:9,tocIndex:4},{value:": ",paraId:9,tocIndex:4},{value:"string",paraId:9,tocIndex:4},{value:"Defined in: ",paraId:10,tocIndex:4},{value:"loading.ts:7",paraId:10,tocIndex:4},{value:"optional",paraId:11,tocIndex:5},{value:" ",paraId:11,tocIndex:5},{value:"maskColor",paraId:11,tocIndex:5},{value:": ",paraId:11,tocIndex:5},{value:"string",paraId:11,tocIndex:5},{value:"Defined in: ",paraId:12,tocIndex:5},{value:"loading.ts:4",paraId:12,tocIndex:5},{value:"optional",paraId:13,tocIndex:6},{value:" ",paraId:13,tocIndex:6},{value:"onCancel",paraId:13,tocIndex:6},{value:": ",paraId:13,tocIndex:6},{value:"Function",paraId:13,tocIndex:6},{value:"Defined in: ",paraId:14,tocIndex:6},{value:"loading.ts:6",paraId:14,tocIndex:6}]},33526:function(n,e,a){"use strict";a.r(e),a.d(e,{texts:function(){return t}});const t=[{value:"youtil",paraId:0},{value:"youtil",paraId:1},{value:" / EnumItem",paraId:2},{value:"EnumItem",paraId:3,tocIndex:0},{value:"<",paraId:3,tocIndex:0},{value:"K",paraId:3,tocIndex:0},{value:", ",paraId:3,tocIndex:0},{value:"V",paraId:3,tocIndex:0},{value:"> = ",paraId:3,tocIndex:0},{value:"object",paraId:3,tocIndex:0},{value:"Defined in: ",paraId:4,tocIndex:0},{value:"enum.ts:1",paraId:4,tocIndex:0},{value:"K",paraId:5,tocIndex:2},{value:" ",paraId:5,tocIndex:2},{value:"extends",paraId:5,tocIndex:2},{value:" ",paraId:5,tocIndex:2},{value:"string",paraId:5,tocIndex:2},{value:"V",paraId:6,tocIndex:3},{value:" ",paraId:6,tocIndex:3},{value:"extends",paraId:6,tocIndex:3},{value:" ",paraId:6,tocIndex:3},{value:"string",paraId:6,tocIndex:3},{value:" | ",paraId:6,tocIndex:3},{value:"number",paraId:6,tocIndex:3},{value:"[",paraId:7,tocIndex:4},{value:"key",paraId:7,tocIndex:4},{value:": ",paraId:7,tocIndex:4},{value:"string",paraId:7,tocIndex:4},{value:"]: ",paraId:7,tocIndex:4},{value:"any",paraId:7,tocIndex:4},{value:"optional",paraId:8,tocIndex:6},{value:" ",paraId:8,tocIndex:6},{value:"key",paraId:8,tocIndex:6},{value:": ",paraId:8,tocIndex:6},{value:"K",paraId:8,tocIndex:6},{value:"Defined in: ",paraId:9,tocIndex:6},{value:"enum.ts:7",paraId:9,tocIndex:6},{value:"\u65B9\u4FBF\u8BB0\u5FC6\u7684\u82F1\u6587\u522B\u540D\uFF0C\u53EF\u9009",paraId:10,tocIndex:6},{value:"label",paraId:11,tocIndex:7},{value:": ",paraId:11,tocIndex:7},{value:"string",paraId:11,tocIndex:7},{value:"Defined in: ",paraId:12,tocIndex:7},{value:"enum.ts:3",paraId:12,tocIndex:7},{value:"\u663E\u793A\u51FA\u6765\u7684\u540D\u79F0",paraId:13,tocIndex:7},{value:"value",paraId:14,tocIndex:8},{value:": ",paraId:14,tocIndex:8},{value:"V",paraId:14,tocIndex:8},{value:"Defined in: ",paraId:15,tocIndex:8},{value:"enum.ts:5",paraId:15,tocIndex:8},{value:"\u5B9E\u9645\u4F20\u9012\u7684\u503C",paraId:16,tocIndex:8}]},62377:function(n,e,a){"use strict";a.r(e),a.d(e,{texts:function(){return t}});const t=[{value:"youtil",paraId:0},{value:"youtil",paraId:1},{value:" / EnumType",paraId:2},{value:"EnumType",paraId:3,tocIndex:0},{value:"<",paraId:3,tocIndex:0},{value:"T",paraId:3,tocIndex:0},{value:"> = ",paraId:3,tocIndex:0},{value:"T",paraId:3,tocIndex:0},{value:" & ",paraId:3,tocIndex:0},{value:'{ [K in T[number]["key"]]: Extract<T[number], { key: K }>["value"] }',paraId:3,tocIndex:0},{value:" & ",paraId:3,tocIndex:0},{value:"object",paraId:3,tocIndex:0},{value:"Defined in: ",paraId:4,tocIndex:0},{value:"enum.ts:11",paraId:4,tocIndex:0},{value:"pick",paraId:5,tocIndex:2},{value:": (",paraId:5,tocIndex:2},{value:"keyOrValue",paraId:5,tocIndex:2},{value:") => ",paraId:5,tocIndex:2},{value:"T",paraId:5,tocIndex:2},{value:"[",paraId:5,tocIndex:2},{value:"number",paraId:5,tocIndex:2},{value:"] | ",paraId:5,tocIndex:2},{value:"undefined",paraId:5,tocIndex:2},{value:"\u6839\u636E key \u6216\u8005 value \u67E5\u627E\u6574\u4E2A\u5BF9\u8C61",paraId:6,tocIndex:2},{value:"string",paraId:7,tocIndex:4},{value:" | ",paraId:7,tocIndex:4},{value:"number",paraId:7,tocIndex:4},{value:"T",paraId:8,tocIndex:5},{value:"[",paraId:8,tocIndex:5},{value:"number",paraId:8,tocIndex:5},{value:"] | ",paraId:8,tocIndex:5},{value:"undefined",paraId:8,tocIndex:5},{value:"pickByLabel",paraId:9,tocIndex:6},{value:": (",paraId:9,tocIndex:6},{value:"label",paraId:9,tocIndex:6},{value:") => ",paraId:9,tocIndex:6},{value:"T",paraId:9,tocIndex:6},{value:"[",paraId:9,tocIndex:6},{value:"number",paraId:9,tocIndex:6},{value:"] | ",paraId:9,tocIndex:6},{value:"undefined",paraId:9,tocIndex:6},{value:"\u6839\u636E label \u67E5\u627E\u6574\u4E2A\u5BF9\u8C61",paraId:10,tocIndex:6},{value:"string",paraId:11,tocIndex:8},{value:"T",paraId:12,tocIndex:9},{value:"[",paraId:12,tocIndex:9},{value:"number",paraId:12,tocIndex:9},{value:"] | ",paraId:12,tocIndex:9},{value:"undefined",paraId:12,tocIndex:9},{value:"pickKey",paraId:13,tocIndex:10},{value:": (",paraId:13,tocIndex:10},{value:"keyOrValue",paraId:13,tocIndex:10},{value:") => ",paraId:13,tocIndex:10},{value:"T",paraId:13,tocIndex:10},{value:"[",paraId:13,tocIndex:10},{value:"number",paraId:13,tocIndex:10},{value:"][",paraId:13,tocIndex:10},{value:'"key"',paraId:13,tocIndex:10},{value:"] | ",paraId:13,tocIndex:10},{value:"undefined",paraId:13,tocIndex:10},{value:"\u6839\u636E value \u67E5\u627E key",paraId:14,tocIndex:10},{value:"string",paraId:15,tocIndex:12},{value:" | ",paraId:15,tocIndex:12},{value:"number",paraId:15,tocIndex:12},{value:"T",paraId:16,tocIndex:13},{value:"[",paraId:16,tocIndex:13},{value:"number",paraId:16,tocIndex:13},{value:"][",paraId:16,tocIndex:13},{value:'"key"',paraId:16,tocIndex:13},{value:"] | ",paraId:16,tocIndex:13},{value:"undefined",paraId:16,tocIndex:13},{value:"pickLabel",paraId:17,tocIndex:14},{value:": (",paraId:17,tocIndex:14},{value:"keyOrValue",paraId:17,tocIndex:14},{value:") => ",paraId:17,tocIndex:14},{value:"T",paraId:17,tocIndex:14},{value:"[",paraId:17,tocIndex:14},{value:"number",paraId:17,tocIndex:14},{value:"][",paraId:17,tocIndex:14},{value:'"label"',paraId:17,tocIndex:14},{value:"] | ",paraId:17,tocIndex:14},{value:"undefined",paraId:17,tocIndex:14},{value:"\u6839\u636E key \u6216\u8005 value \u67E5\u627E label",paraId:18,tocIndex:14},{value:"string",paraId:19,tocIndex:16},{value:" | ",paraId:19,tocIndex:16},{value:"number",paraId:19,tocIndex:16},{value:"T",paraId:20,tocIndex:17},{value:"[",paraId:20,tocIndex:17},{value:"number",paraId:20,tocIndex:17},{value:"][",paraId:20,tocIndex:17},{value:'"label"',paraId:20,tocIndex:17},{value:"] | ",paraId:20,tocIndex:17},{value:"undefined",paraId:20,tocIndex:17},{value:"pickValue",paraId:21,tocIndex:18},{value:": (",paraId:21,tocIndex:18},{value:"keyOrValue",paraId:21,tocIndex:18},{value:") => ",paraId:21,tocIndex:18},{value:"T",paraId:21,tocIndex:18},{value:"[",paraId:21,tocIndex:18},{value:"number",paraId:21,tocIndex:18},{value:"][",paraId:21,tocIndex:18},{value:'"value"',paraId:21,tocIndex:18},{value:"] | ",paraId:21,tocIndex:18},{value:"undefined",paraId:21,tocIndex:18},{value:"\u6839\u636E key \u67E5\u627E value",paraId:22,tocIndex:18},{value:"string",paraId:23,tocIndex:20},{value:" | ",paraId:23,tocIndex:20},{value:"number",paraId:23,tocIndex:20},{value:"T",paraId:24,tocIndex:21},{value:"[",paraId:24,tocIndex:21},{value:"number",paraId:24,tocIndex:21},{value:"][",paraId:24,tocIndex:21},{value:'"value"',paraId:24,tocIndex:21},{value:"] | ",paraId:24,tocIndex:21},{value:"undefined",paraId:24,tocIndex:21},{value:"T",paraId:25,tocIndex:23},{value:" ",paraId:25,tocIndex:23},{value:"extends",paraId:25,tocIndex:23},{value:" ",paraId:25,tocIndex:23},{value:"ReadonlyArray",paraId:25,tocIndex:23},{value:"<",paraId:25,tocIndex:23},{value:"EnumItem",paraId:26,tocIndex:23},{value:"<",paraId:25,tocIndex:23},{value:"string",paraId:25,tocIndex:23},{value:", ",paraId:25,tocIndex:23},{value:"string",paraId:25,tocIndex:23},{value:" | ",paraId:25,tocIndex:23},{value:"number",paraId:25,tocIndex:23},{value:">>",paraId:25,tocIndex:23}]},44976:function(n,e,a){"use strict";a.r(e),a.d(e,{texts:function(){return t}});const t=[{value:"youtil",paraId:0},{value:"youtil",paraId:1},{value:" / Request",paraId:2},{value:"Request",paraId:3},{value:"const",paraId:4,tocIndex:0},{value:" ",paraId:4,tocIndex:0},{value:"Request",paraId:4,tocIndex:0},{value:": ",paraId:4,tocIndex:0},{value:"RequestConstructor",paraId:4,tocIndex:0},{value:"Defined in: ",paraId:5,tocIndex:0},{value:"request.ts:219",paraId:5,tocIndex:0},{value:"\u652F\u6301\u5B9E\u4F8B\u5316\u4E00\u4E2A\u65B0\u7684request\u65B9\u6CD5\uFF0C\u8986\u76D6\u9ED8\u8BA4\u7684\u90E8\u5206\u914D\u7F6E\u9879",paraId:6,tocIndex:0},{value:"\u63A8\u8350\u4F7F\u7528 request.create() \u5B9E\u4F8B\u5316\u65B0\u7684request",paraId:7,tocIndex:1}]},32672:function(n,e,a){"use strict";a.r(e),a.d(e,{texts:function(){return t}});const t=[{value:"youtil",paraId:0},{value:"youtil",paraId:1},{value:" / keyCodes",paraId:2},{value:"const",paraId:3,tocIndex:0},{value:" ",paraId:3,tocIndex:0},{value:"keyCodes",paraId:3,tocIndex:0},{value:": ",paraId:3,tocIndex:0},{value:"Record",paraId:3,tocIndex:0},{value:"<",paraId:3,tocIndex:0},{value:"string",paraId:3,tocIndex:0},{value:", ",paraId:3,tocIndex:0},{value:"number",paraId:3,tocIndex:0},{value:">",paraId:3,tocIndex:0},{value:"Defined in: ",paraId:4,tocIndex:0},{value:"other.ts:125",paraId:4,tocIndex:0},{value:"\u952E\u76D8\u952E\u503C\u6620\u5C04\uFF0C\u5982: keyCodes.ctrl == 17",paraId:5,tocIndex:0}]},44591:function(n,e,a){"use strict";a.r(e),a.d(e,{texts:function(){return t}});const t=[{value:"\u4F60\u662F\u5426\u9047\u5230\u8FC7\u8FD9\u6837\u7684\u70E6\u607C\uFF1F\u5B9A\u4E49\u597D\u4E86\u4E00\u4E2A",paraId:0,tocIndex:1},{value:"[{ label: '\u6210\u529F', value: 1 }]",paraId:0,tocIndex:1},{value:"\u6570\u7EC4\uFF0C\u6709\u65F6\u5019\u9700\u8981\u6839\u636E",paraId:0,tocIndex:1},{value:"label",paraId:0,tocIndex:1},{value:"\u627Evalue\uFF0C\u6709\u65F6\u5019\u9700\u8981\u6839\u636E",paraId:0,tocIndex:1},{value:"value",paraId:0,tocIndex:1},{value:"\u627Elabel\u3001\u6216\u8005\u627E\u6574\u4E2A\u5BF9\u8C61\uFF0C\u6709\u65F6\u5019value\u592A\u591A\u4E86\u65E0\u610F\u4E49\u9700\u8981\u53D6\u4E00\u4E2A\u522B\u540D\uFF0C\u4F7F\u7528",paraId:0,tocIndex:1},{value:"createEnum()",paraId:0,tocIndex:1},{value:"\u51FD\u6570\u53EF\u4EE5\u7EC8\u7ED3\u4E0A\u8FF0\u70E6\u607C\u3002",paraId:0,tocIndex:1},{value:"\u70B9\u6B64\u67E5\u770B",paraId:1,tocIndex:2},{value:"API",paraId:2,tocIndex:2},{value:"\u6587\u6863\u3002",paraId:1,tocIndex:2}]},1335:function(n,e,a){"use strict";a.r(e),a.d(e,{texts:function(){return t}});const t=[{value:"youtil",paraId:0,tocIndex:0},{value:"\uFF0C\u53D1\u97F3\u540C",paraId:0,tocIndex:0},{value:"util",paraId:0,tocIndex:0},{value:"\uFF0C\u4E2D\u6587\u53EF\u4EE5\u53EB\u505A",paraId:0,tocIndex:0},{value:"\u6CB9\u68AF",paraId:0,tocIndex:0},{value:"\uFF0C\u4E00\u4E2A\u4E0E\u6846\u67B6\uFF08",paraId:0,tocIndex:0},{value:"Vue",paraId:0,tocIndex:0},{value:"\u3001",paraId:0,tocIndex:0},{value:"React",paraId:0,tocIndex:0},{value:"\u7B49\uFF09\u3001\u73AF\u5883\uFF08",paraId:0,tocIndex:0},{value:"Nodejs",paraId:0,tocIndex:0},{value:"\u3001",paraId:0,tocIndex:0},{value:"Browser",paraId:0,tocIndex:0},{value:"\u7B49\uFF09\u65E0\u5173\u7684\u5C0F\u5DE7\u3001\u7CBE\u7B80\u3001\u5B9E\u7528\u3001\u4E0D\u4F9D\u8D56\u4EFB\u4F55\u7B2C\u4E09\u65B9\u5E93\u7684",paraId:0,tocIndex:0},{value:"JavaScript",paraId:0,tocIndex:0},{value:"\u5DE5\u5177\u5E93\uFF0C\u5B98\u7F51\uFF1A",paraId:0,tocIndex:0},{value:"youtil.haoji.me",paraId:0,tocIndex:0},{value:"\u3002",paraId:0,tocIndex:0},{value:"\u4EE3\u7801\u8FD8\u5728\u4E0D\u65AD\u8865\u5145\u5B8C\u5584\uFF0C\u656C\u8BF7\u671F\u5F85\uFF01",paraId:1,tocIndex:0},{value:"\u5C11\u6570\u65B9\u6CD5\u53EF\u80FD\u4F9D\u8D56DOM\uFF0C\u4F8B\u5982",paraId:1,tocIndex:0},{value:"showLoading",paraId:1,tocIndex:0},{value:"\uFF1B",paraId:1,tocIndex:0},{value:"\u5B89\u88C5\uFF1A",paraId:2,tocIndex:1},{value:"npm i youtil -S",paraId:2,tocIndex:1},{value:"\u4F7F\u7528\u793A\u4F8B\uFF1A",paraId:3,tocIndex:1},{value:`import { formatDate, parseDate } from youtil;
|
|
159
|
-
console.log(formatDate(Date.now()));
|
|
160
|
-
conssole.log(parseDate('2023-02-14', 'yyyy-MM-dd'));
|
|
161
|
-
`,paraId:4,tocIndex:1},{value:"\u672C\u6587\u6863\u4EC5\u5BF9\u4E00\u4E9B\u91CD\u70B9\u6A21\u5757\u8FDB\u884C\u5355\u72EC\u4ECB\u7ECD\uFF0C\u5F88\u591A\u7B80\u5355\u51FD\u6570\u672A\u505A\u4E00\u4E00\u4ECB\u7ECD\uFF0C\u5B8C\u6574\u51FD\u6570\u5217\u8868\u8BF7\u53C2\u89C1",paraId:5,tocIndex:2},{value:"API\u6587\u6863",paraId:5,tocIndex:2},{value:"\u3002",paraId:5,tocIndex:2},{value:"\u4E4B\u524D\u60F3\u4E86\u5F88\u591A\u540D\u5B57\uFF0C\u5305\u62EC",paraId:6,tocIndex:3},{value:"autil",paraId:6,tocIndex:3},{value:"\u3001",paraId:6,tocIndex:3},{value:"zutil",paraId:6,tocIndex:3},{value:"\u3001",paraId:6,tocIndex:3},{value:"feutil",paraId:6,tocIndex:3},{value:"\u7B49\uFF0C\u4ECEa-z\u8BD5\u4E0B\u6765\u53EA\u6709\u51E0\u4E2A\u6CA1\u6709\u88AB\u6CE8\u518C\uFF0C\u4F46\u662F\u4E0D\u597D\u8BB0\uFF0C\u6700\u540E\u624D\u53D6\u4E86\u8FD9\u4E2A\u540D\u5B57\uFF0C\u56E0\u4E3A\u6BD4\u8F83\u597D\u8BB0\u3002",paraId:6,tocIndex:3},{value:"\u4F9D\u8D56",paraId:7,tocIndex:4},{value:"node@18",paraId:7,tocIndex:4},{value:"\u73AF\u5883\uFF0C\u6267\u884C",paraId:7,tocIndex:4},{value:"cnpm run dev",paraId:7,tocIndex:4},{value:"\u5C06\u81EA\u52A8\u6253\u5F00\u672C\u5730\u9884\u89C8\u3002",paraId:7,tocIndex:4},{value:"src\uFF1A \u6E90\u6587\u4EF6\uFF1B",paraId:8,tocIndex:5},{value:"docs\uFF1A \u6587\u6863\uFF1B",paraId:8,tocIndex:5},{value:"test\uFF1A\u6D4B\u8BD5\u7528\u4F8B\uFF1B",paraId:8,tocIndex:5},{value:"dist\uFF1A\u4F9B\u6D4F\u89C8\u5668\u76F4\u63A5\u4F7F\u7528\u7684bundle\u6A21\u5F0F\u4EA7\u7269\uFF1B",paraId:8,tocIndex:5},{value:"esm\uFF1A\u4F9B\u5176\u4ED6\u9879\u76EE\u5F15\u5165\uFF1B",paraId:8,tocIndex:5},{value:"build\uFF1A\u6587\u6863\u4E4B\u7C7B\u7684\u6784\u5EFA\u4EA7\u7269\uFF1B",paraId:8,tocIndex:5},{value:"\u66F4\u65B0\u4EE3\u7801\uFF1B",paraId:9,tocIndex:6},{value:"\u66F4\u65B0",paraId:9,tocIndex:6},{value:"package.json",paraId:9,tocIndex:6},{value:"\u548C",paraId:9,tocIndex:6},{value:"changelog",paraId:9,tocIndex:6},{value:"\uFF1B",paraId:9,tocIndex:6},{value:"npm run build:docs",paraId:9,tocIndex:6},{value:"\uFF0C\u7136\u540E\u5408\u5E76master\uFF1B",paraId:9,tocIndex:6},{value:"npm publish",paraId:9,tocIndex:6},{value:"\uFF1B",paraId:9,tocIndex:6},{value:"\u6CE8\u610F\uFF1A@ice/pkg\u548C@swc/helpers \u5347\u7EA7\u52300.5.0\u4EE5\u4E0A\u7248\u672C\u65F6\u5176\u4ED6\u4E1A\u52A1\u53EF\u80FD\u62A5\u9519\uFF0C\u975E\u5E38\u5751\uFF01\u76EE\u524D\u5199\u6B7B\u7248\u672C",paraId:10,tocIndex:6},{value:"@swc/helper",paraId:11,tocIndex:7},{value:"\u5728\u5347\u7EA7\u52300.5.0\u4E4B\u540E\u6709\u4E00\u4E9B\u517C\u5BB9\u6027\u95EE\u9898\uFF0C\u4E00\u4E9B\u8001\u5DE5\u7A0B\uFF08\u5982node14+webpack4\uFF09\u6784\u5EFA\u4F1A\u5931\u8D25\u3002",paraId:11,tocIndex:7},{value:"\u76EE\u524D\u6CA1\u6709\u95EE\u9898\u7684\u7248\u672C\uFF1A",paraId:12,tocIndex:7},{value:"@swc/helper",paraId:13,tocIndex:7},{value:"\u5199\u6B7B",paraId:13,tocIndex:7},{value:"0.4.14",paraId:13,tocIndex:7},{value:"\uFF08\u90E8\u5206\u6784\u5EFA\u4EA7\u7269\uFF1A",paraId:13,tocIndex:7},{value:'import _instanceof from "@swc/helpers/src/_instanceof.mjs"',paraId:13,tocIndex:7},{value:"\uFF09\uFF1B",paraId:13,tocIndex:7},{value:"@ice/pkg",paraId:13,tocIndex:7},{value:"\u5199\u6B7B",paraId:13,tocIndex:7},{value:"1.5.5",paraId:13,tocIndex:7},{value:"\uFF1B",paraId:13,tocIndex:7},{value:"\u6709\u95EE\u9898\u7684\u7248\u672C\uFF1A",paraId:14,tocIndex:7},{value:"@swc/helper",paraId:15,tocIndex:7},{value:"\u5199\u6B7B",paraId:15,tocIndex:7},{value:"^0.5.0",paraId:15,tocIndex:7},{value:"\uFF08\u90E8\u5206\u6784\u5EFA\u4EA7\u7269\uFF1A",paraId:15,tocIndex:7},{value:'import { _ as _instanceof } from "@swc/helpers/_/_instanceof"',paraId:15,tocIndex:7},{value:"\uFF09\uFF1B",paraId:15,tocIndex:7},{value:"@ice/pkg",paraId:15,tocIndex:7},{value:"\u5199\u6B7B",paraId:15,tocIndex:7},{value:"^1.5.5",paraId:15,tocIndex:7},{value:"\uFF1B",paraId:15,tocIndex:7},{value:"\u4ED3\u5E93\u811A\u624B\u67B6\u6765\u6E90\uFF1A",paraId:16,tocIndex:8},{value:`npm install -g cnpm --registry=https://registry.npmmirror.com
|
|
162
|
-
cnpm init @ice/pkg youtil # \u9009\u62E9\u524D\u7AEF\u7C7B\u5E93
|
|
163
|
-
# \u9ED8\u8BA4\u4E0D\u652F\u6301\u6587\u6863\u9884\u89C8\uFF0C\u9700\u624B\u52A8\u5F00\u542F
|
|
164
|
-
cnpm i @ice/pkg-plugin-docusaurus react react-dom -D
|
|
165
|
-
# \u53C2\u8003 https://pkg.ice.work/guide/preview \u8FDB\u884C build.config.mts \u914D\u7F6E
|
|
166
|
-
cd youtil
|
|
167
|
-
mkdir docs
|
|
168
|
-
vim index.md
|
|
169
|
-
cnpm start
|
|
170
|
-
`,paraId:17,tocIndex:8}]},27253:function(n,e,a){"use strict";a.r(e),a.d(e,{texts:function(){return t}});const t=[{value:"loading",paraId:0,tocIndex:0},{value:"\u662Fweb\u4E2D\u975E\u5E38\u5E38\u89C1\u7684\u4E00\u79CD\u4EA4\u4E92\uFF0C\u4F46\u662F\u5F88\u591A\u65F6\u5019\u4E3A\u4E86\u4E00\u4E2A",paraId:0,tocIndex:0},{value:"loading",paraId:0,tocIndex:0},{value:"\u53BB\u5F15\u5165\u975E\u5E38\u91CD\u7684\u7EC4\u4EF6\u5E93\u5F97\u4E0D\u507F\u5931\uFF0C\u672C\u65B9\u6CD5\u5F25\u8865\u4E86\u6B64\u7C7B\u4E0D\u8DB3\u3002\u53EA\u67092\u4E2A\u65B9\u6CD5\uFF0C\u4E00\u4E2A",paraId:0,tocIndex:0},{value:"showLoading()",paraId:0,tocIndex:0},{value:"\uFF0C\u4E00\u4E2A",paraId:0,tocIndex:0},{value:"hideLoading()",paraId:0,tocIndex:0},{value:"\uFF0C\u5E76\u4E14\u5B83\u662F\u5355\u4F8B\u6A21\u5F0F\u3002",paraId:0,tocIndex:0}]},43429:function(n,e,a){"use strict";a.r(e),a.d(e,{texts:function(){return t}});const t=[{value:"\u4F17\u6240\u5468\u77E5\uFF0C\u8DE8\u57DF\u7A97\u53E3\u901A\u4FE1\uFF08\u4F8B\u5982\u7236\u9875\u9762\u548Ciframe\u5B50\u9875\u9762\u3001\u5F53\u524D\u9875\u548Cwindow.oepn\u6253\u5F00\u9875\u7B49\uFF09\u4E00\u822C\u90FD\u662F\u901A\u8FC7",paraId:0,tocIndex:0},{value:"window.postMessage",paraId:0,tocIndex:0},{value:"\u548C",paraId:0,tocIndex:0},{value:"window.onmessage",paraId:0,tocIndex:0},{value:"\u5B9E\u73B0\uFF0C\u4E00\u4E2A\u7528\u6765\u53D1\u9001\u6D88\u606F\uFF0C\u4E00\u4E2A\u7528\u6765\u63A5\u6536\u6D88\u606F\uFF0C\u4ED6\u4EEC\u65E2\u4E0D\u652F\u6301\u56DE\u8C03\uFF0C\u4E5F\u4E0D\u652F\u6301\u5F02\u6B65\uFF0C\u66F4\u6709\u4E00\u5806\u7684\u4F7F\u7528\u9650\u5236\uFF08\u4F8B\u5982\u53EA\u80FD\u4F20\u9012\u666E\u901A\u6570\u636E\uFF0C\u65E0\u6CD5\u5E8F\u5217\u5316\u7684\u6570\u636E\u4E0D\u80FD\u88AB\u53D1\u9001\uFF09\uFF0C\u76F4\u63A5\u4F7F\u7528\u975E\u5E38\u4E0D\u65B9\u4FBF\u3002",paraId:0,tocIndex:0},{value:"Chrome\u63D2\u4EF6\u5F00\u53D1\u4E2D\u7684contentScripts\u548C\u666E\u901Ascripts\u4E5F\u662F\u57FA\u4E8E",paraId:1,tocIndex:0},{value:"postMessage",paraId:1,tocIndex:0},{value:"\u901A\u4FE1\u3002",paraId:1,tocIndex:0},{value:"\u57FA\u4E8E\u4EE5\u4E0A\u75DB\u70B9\uFF0C\u7B14\u8005\u5BF9\u6D88\u606F\u901A\u4FE1\u8FDB\u884C\u4E86\u6574\u4F53\u5C01\u88C5\uFF0C\u5C01\u88C5\u4F7F\u7528\u975E\u5E38\u7B80\u5355\uFF0C\u5E76\u4E14\u5177\u6709\u4EE5\u4E0B\u7279\u70B9\uFF1A",paraId:2,tocIndex:1},{value:"\u652F\u6301\u56DE\u8C03\uFF1B",paraId:3,tocIndex:1},{value:"\u652F\u6301\u5F02\u6B65\uFF1B",paraId:3,tocIndex:1},{value:"\u652F\u6301\u629B\u51FA\u5F02\u5E38\uFF1B",paraId:3,tocIndex:1},{value:"\u652F\u6301\u5C06\u51FD\u6570\u4F5C\u4E3A\u53C2\u6570\u4F20\u9012\uFF1B",paraId:3,tocIndex:1},{value:"\u65E0\u9700\u624B\u52A8\u8BBE\u7F6E",paraId:3,tocIndex:1},{value:"targetWindow",paraId:3,tocIndex:1},{value:"\uFF0C90%\u573A\u666F\u81EA\u52A8\u6355\u83B7\uFF1B",paraId:3,tocIndex:1},{value:"\u6D88\u606F\u76D1\u542C\u540C\u65F6\u652F\u6301\u7CBE\u786E\u5339\u914D\u548C\u6A21\u7CCA\u5339\u914D\uFF1B",paraId:3,tocIndex:1},{value:"\u884C\u4E86\uFF0C\u4E0D\u5439\u725B\u903C\u4E86\uFF0C\u76F4\u63A5\u4E0A\u83DC\u3002\u53EA\u6709\u4E00\u4E2A\u65B9\u6CD5 ",paraId:4,tocIndex:1},{value:"initWindowMessage(scene)",paraId:4,tocIndex:1},{value:"\uFF1A",paraId:4,tocIndex:1},{value:`import { initWindowMessage } from 'youtil';
|
|
171
|
-
// scene\u7528\u6765\u6807\u8BC6\u573A\u666F\uFF0C\u53EA\u6709scene\u76F8\u540C\u76842\u4E2A\u7A97\u53E3\u53D1\u9001\u6D88\u606F\u624D\u80FD\u63A5\u6536\u5230
|
|
172
|
-
const { postMessage, onMessage } = initWindowMessage('your_scene');
|
|
173
|
-
`,paraId:5,tocIndex:1},{value:"\u5B8C\u6574\u5B9A\u4E49\uFF1A",paraId:6,tocIndex:1},{value:`type onMessageListener = (eventName?: string, ...payload: any[]) => Promise<any> | any | void;
|
|
174
|
-
|
|
175
|
-
function initWindowMessage(scene: string, targetWindow?: Window): {
|
|
176
|
-
postMessage: <T>(eventName: string, ...payload: any[]) => Promise<T>;
|
|
177
|
-
onMessage: (eventName: string, listener: onMessageListener) => void;
|
|
178
|
-
}
|
|
179
|
-
`,paraId:7,tocIndex:1},{value:"\u5148\u770B\u4F7F\u7528\uFF0C\u518D\u770B\u539F\u7406\u3002",paraId:8,tocIndex:2},{value:"\u4EE5\u6700\u5178\u578B\u7684iframe\u7236\u5B50\u9875\u9762\u901A\u4FE1\u4E3A\u4F8B\uFF08\u5176\u5B83\u573A\u666F\u7C7B\u4F3C\uFF09\uFF1A",paraId:9,tocIndex:3},{value:"\u7236\u9875\u9762\uFF1A",paraId:10,tocIndex:3},{value:`const { postMessage, onMessage } = initWindowMessage('test_iframe');
|
|
180
|
-
// \u5047\u8BBE\u7236\u9875\u9762\u6709\u4E00\u4E2A\u540D\u4E3Atest\u7684\u5F02\u6B65\u65B9\u6CD5\uFF0C\u6211\u4EEC\u5E0C\u671B\u5B50iframe\u4E5F\u80FD\u591F\u8C03\u7528
|
|
181
|
-
const test = async (a, b) => {
|
|
182
|
-
await sleep(1000);
|
|
183
|
-
return a + b;
|
|
184
|
-
};
|
|
185
|
-
onMessage('test', test);
|
|
186
|
-
`,paraId:11,tocIndex:3},{value:"\u5B50iframe\u9875\u9762\uFF1A",paraId:12,tocIndex:3},{value:`const { postMessage, onMessage } = initWindowMessage('test_iframe');
|
|
187
|
-
const result = await postMessage('test', 2, 3);
|
|
188
|
-
console.log(result); // \u5EF6\u8FDF1\u79D2\u8F93\u51FA5
|
|
189
|
-
`,paraId:13,tocIndex:3},{value:"\u7EE7\u7EED\u5B8C\u5584\u4E0A\u9762\u7684\u4F8B\u5B50\uFF0C\u7236\u9875\u9762\uFF1A",paraId:14,tocIndex:4},{value:`const { postMessage, onMessage } = initWindowMessage('test_iframe');
|
|
190
|
-
// \u5047\u8BBE\u7236\u9875\u9762\u6709\u4E00\u4E2A\u540D\u4E3Atest\u7684\u5F02\u6B65\u65B9\u6CD5
|
|
191
|
-
const test = async (a, b) => {
|
|
192
|
-
await sleep(1000);
|
|
193
|
-
if (typeof a !== 'number' || typeof b !== 'number') {
|
|
194
|
-
throw new Error('\u53C2\u6570\u4E0D\u662F\u6570\u5B57')
|
|
195
|
-
}
|
|
196
|
-
return a + b;
|
|
197
|
-
};
|
|
198
|
-
onMessage('test', test)
|
|
199
|
-
`,paraId:15,tocIndex:4},{value:"\u5B50iframe\u9875\u9762\uFF1A",paraId:16,tocIndex:4},{value:`const { postMessage, onMessage } = initWindowMessage('test_iframe');
|
|
200
|
-
try {
|
|
201
|
-
const result = await postMessage('test', 'aaa', 3);
|
|
202
|
-
console.log(result);
|
|
203
|
-
} catch (e) {
|
|
204
|
-
console.error(e); // \u5EF6\u8FDF1\u79D2\u629B\u51FA\u5F02\u5E38\uFF1A\u53C2\u6570\u4E0D\u662F\u6570\u5B57
|
|
205
|
-
}
|
|
206
|
-
`,paraId:17,tocIndex:4},{value:"\u9ED8\u8BA4\u60C5\u51B5\u4E0B\uFF0C",paraId:18,tocIndex:5},{value:"postMessage",paraId:18,tocIndex:5},{value:"\u4F20\u9012\u7684\u53C2\u6570\u5FC5\u987B\u662F\u53EF\u4EE5\u5E8F\u5217\u5316\u7684\uFF0C\u4EFB\u4F55\u4E0D\u80FD\u5E8F\u5217\u5316\u7684\u6570\u636E\uFF08\u6BD4\u5982\u67D0\u4E2A",paraId:18,tocIndex:5},{value:"DOM",paraId:18,tocIndex:5},{value:"\u5BF9\u8C61\u3001\u51FD\u6570\u3001\u5FAA\u73AF\u5F15\u7528\u5BF9\u8C61\u3001\u751A\u81F3\u662F",paraId:18,tocIndex:5},{value:"moment()",paraId:18,tocIndex:5},{value:"\u8FD4\u56DE\u7684\u5BF9\u8C61\uFF09\u90FD\u4F1A\u62A5\u5982\u4E0B\u5F02\u5E38\uFF1A",paraId:18,tocIndex:5},{value:`Uncaught (in promise) DataCloneError: Failed to execute 'postMessage' on 'Window'
|
|
207
|
-
`,paraId:19,tocIndex:5},{value:"\u65E0\u6CD5\u4F20\u9012\u7279\u6B8A\u5BF9\u8C61\u8FD9\u4E2A\u8FD8\u80FD\u63A5\u53D7\uFF0C\u552F\u72EC\u4E0D\u80FD\u4F20\u9012\u51FD\u6570\u8FD9\u4E2A\u7740\u5B9E\u975E\u5E38\u4E0D\u65B9\u4FBF\uFF0C\u8981\u77E5\u9053\u6211\u4EEC\u7ECF\u5E38\u4F1A\u628A\u4E00\u4E9B\u7C7B\u4F3C",paraId:20,tocIndex:5},{value:"onOk",paraId:20,tocIndex:5},{value:"\u3001",paraId:20,tocIndex:5},{value:"onCancel",paraId:20,tocIndex:5},{value:"\u3001",paraId:20,tocIndex:5},{value:"onUpdate",paraId:20,tocIndex:5},{value:"\u7B49\u4F5C\u4E3A\u53C2\u6570\u4F20\u9012\u3002\u4F46\u662F\u5728\u6211\u4EEC\u8FD9\u91CC\u51FD\u6570\u53C2\u6570\u4E0D\u53D7\u4EFB\u4F55\u5F71\u54CD\uFF0C\u4F9D\u7136\u53EF\u4EE5\u6B63\u5E38\u4F20\u9012\uFF1A",paraId:20,tocIndex:5},{value:"\u7236\u9875\u9762\uFF1A",paraId:21,tocIndex:5},{value:`const { postMessage, onMessage } = initWindowMessage('test_iframe');
|
|
208
|
-
const showDialog = async ({ title, content, onOk }) => {
|
|
209
|
-
Modal.confirm({
|
|
210
|
-
title,
|
|
211
|
-
content,
|
|
212
|
-
onOk,
|
|
213
|
-
});
|
|
214
|
-
};
|
|
215
|
-
onMessage('showDialog', showDialog)
|
|
216
|
-
`,paraId:22,tocIndex:5},{value:"\u5B50iframe\u9875\u9762\uFF1A",paraId:23,tocIndex:5},{value:`const { postMessage, onMessage } = initWindowMessage('test_iframe');
|
|
217
|
-
postMessage('showDialog', {
|
|
218
|
-
title: '\u6211\u662F\u6807\u9898',
|
|
219
|
-
// \u51FD\u6570\u4E0D\u53D7\u5F71\u54CD\uFF0C\u53EF\u4EE5\u6B63\u5E38\u4F5C\u4E3A\u53C2\u6570\u4F20\u9012
|
|
220
|
-
onOk: async () => {
|
|
221
|
-
await sleep(1000);
|
|
222
|
-
console.log('\u70B9\u51FB\u4E86\u786E\u5B9A\u6309\u94AE');
|
|
223
|
-
}
|
|
224
|
-
});
|
|
225
|
-
`,paraId:24,tocIndex:5},{value:"\u5177\u4F53\u5B9E\u73B0\u539F\u7406\u89C1\u540E\u6587\u3002",paraId:25,tocIndex:5},{value:"\u9664\u6B64\u4E4B\u5916\u8FD8\u652F\u6301",paraId:26,tocIndex:6},{value:"*",paraId:26,tocIndex:6},{value:"\u6A21\u7CCA\u5339\u914D\uFF0C\u4E00\u822C\u5EFA\u8BAE\u6700\u591A\u53EA\u76D1\u542C\u4E00\u6B21\uFF1A",paraId:26,tocIndex:6},{value:`onMessage('*', (eventName, ...params) => {
|
|
226
|
-
console.log(eventName, ...params);
|
|
227
|
-
});
|
|
228
|
-
`,paraId:27,tocIndex:6},{value:"\u548C\u666E\u901AonMessage\u4E0D\u540C\u7684\u5730\u65B9\uFF1A",paraId:28,tocIndex:6},{value:"\u7B2C\u4E00\u4E2A\u53C2\u6570\u53D8\u6210\u4E86",paraId:29,tocIndex:6},{value:"eventName",paraId:29,tocIndex:6},{value:"\uFF1B",paraId:29,tocIndex:6},{value:"\u5FC5\u987B\u8981\u6709\u8FD4\u56DE\u503C\u624D\u4F1A\u89E6\u53D1\u56DE\u8C03\uFF1B",paraId:29,tocIndex:6},{value:"\u5982\u4F55\u89E3\u51B3\u5462\uFF1F\u9996\u5148\u60F3\u5230\u7684\u662F\u5F3A\u884C\u5E8F\u5217\u5316\uFF0C\u6BD4\u5982\u76F4\u63A5\u4F20\u9012",paraId:30,tocIndex:8},{value:"function test(a, b) { return a + b; }",paraId:30,tocIndex:8},{value:"\u8FD9\u6837\u7684\u5B57\u7B26\u4E32\uFF0C\u63A5\u6536\u5230\u540E\u518D",paraId:30,tocIndex:8},{value:"new Function",paraId:30,tocIndex:8},{value:"\u5B9E\u4F8B\u5316\uFF0C\u8FD9\u79CD\u65B9\u5F0F\u4F7F\u7528\u9650\u5236\u975E\u5E38\u591A\uFF0C\u4E00\u4E2A\u51FD\u6570\u53EF\u80FD\u4F9D\u8D56\u5176\u5B83\u65B9\u6CD5\u3001\u4F9D\u8D56\u5916\u90E8npm\u5305\uFF0C\u751A\u81F3\u53EF\u80FD\u4F9D\u8D56\u672C\u5730\u67D0\u4E2A\u65E0\u6CD5\u5E8F\u5217\u5316\u7684\u6570\u636E\uFF0C\u6240\u4EE5\u6B64\u8DEF\u4E0D\u901A\u3002",paraId:30,tocIndex:8},{value:"\u8003\u8651\u5230\u51FD\u6570\u7684\u4E3B\u8981\u4F5C\u7528\u8FD8\u662F\u6267\u884C\u4E00\u6BB5\u903B\u8F91\u518D\u8FD4\u56DE\u7ED3\u679C\uFF0C\u65E2\u7136\u6211\u4EEC\u65E0\u6CD5\u76F4\u63A5\u4F20\u9012\u51FD\u6570\uFF0C\u90A3\u4E48\u6211\u4EEC\u53EF\u4EE5\u53D8\u76F8\u7684\u4F20\u9012\u51FD\u6570\u6267\u884C\u7ED3\u679C\uFF0C\u51FD\u6570\u6267\u884C\u4F9D\u7136\u5728\u539F\u6765\u7684\u7A97\u53E3\uFF0C",paraId:31,tocIndex:8},{value:"postMessage",paraId:31,tocIndex:8},{value:"\u524D\u5148\u628A\u51FD\u6570\u5728\u672C\u5730\u7F13\u5B58\u8D77\u6765\u3001\u5E76\u7528\u4E00\u4E2A\u968F\u673A\u7684",paraId:31,tocIndex:8},{value:"functionId",paraId:31,tocIndex:8},{value:"\u6807\u8BC6\uFF0C\u6267\u884C\u7684\u65F6\u5019\u518D\u901A\u8FC7\u8FD9\u4E2A",paraId:31,tocIndex:8},{value:"functionId",paraId:31,tocIndex:8},{value:"\u628A\u7F13\u5B58\u7684\u51FD\u6570\u53D6\u51FA\u6765\uFF01",paraId:31,tocIndex:8},{value:"\u5047\u8BBE\u6709\u4E00\u4E2A",paraId:32,tocIndex:8},{value:"onUpdate",paraId:32,tocIndex:8},{value:"\u65B9\u6CD5\u9700\u8981\u4F20\u9012\uFF1A",paraId:32,tocIndex:8},{value:`postMessage('someMethod', onUpdate);
|
|
229
|
-
`,paraId:33,tocIndex:8},{value:"\u5927\u81F4\u539F\u7406\u5982\u4E0B\u56FE\uFF1A",paraId:34,tocIndex:8},{value:"\u53D1\u9001\u524D\u6211\u4EEC\u5148\u628AonUpdate\u5728\u672C\u5730\u5B58\u50A8\u8D77\u6765\uFF0C\u5E76\u7528\u4E00\u4E2A\u552F\u4E00\u7684functionId\u505A\u6807\u8BC6\uFF1A",paraId:35,tocIndex:8},{value:`const localFunctions: Record<string, Function> = {};
|
|
230
|
-
const fnPrefix = '_local_function_';
|
|
231
|
-
// \u5B58\u50A8\u51FD\u6570
|
|
232
|
-
function storageFunction(fn: Function) {
|
|
233
|
-
const functionId = \`\${fnPrefix}\${getRandomId()}\`;
|
|
234
|
-
localFunctions[functionId] = fn;
|
|
235
|
-
return functionId;
|
|
236
|
-
}
|
|
237
|
-
`,paraId:36,tocIndex:8},{value:"\u5E95\u5C42\u4F20\u9012\u8FC7\u53BB\u7684",paraId:37,tocIndex:8},{value:"onUpdate",paraId:37,tocIndex:8},{value:"\u5B9E\u9645\u4E0A\u4E00\u4E2A\u5B57\u7B26\u4E32\uFF0C\u7C7B\u4F3C\u8FD9\u6837",paraId:37,tocIndex:8},{value:"_local_function_xxxx",paraId:37,tocIndex:8},{value:"\uFF0C\u4F46\u7528\u6237\u4F7F\u7528\u6211\u4EEC\u7684onMessage\u63A5\u6536\u5230\u7684\u4ECD\u7136\u662F\u4E00\u4E2A\u6B63\u5E38\u7684\u51FD\u6570\uFF0C\u53EA\u4E0D\u8FC7\u88AB\u6211\u4EEC\u5305\u88C5\u4E86\u4E00\u5C42\uFF1A",paraId:37,tocIndex:8},{value:`const onUpdate = (...params) => {
|
|
238
|
-
// \u518D\u6B21\u8C03\u7528\u5C01\u88C5\u597D\u7684postMessage\u53D1\u9001\u6D88\u606F\u5230\u539F\u7A97\u53E3\u83B7\u53D6\u5E76\u6267\u884C\u672C\u5730\u7F13\u5B58\u7684\u51FD\u6570
|
|
239
|
-
return postMessage('executeLocalFunction', '_local_function_xxxx', ...params)
|
|
240
|
-
}
|
|
241
|
-
`,paraId:38,tocIndex:8},{value:"executeLocalFunction",paraId:39,tocIndex:8},{value:"\u5927\u81F4\u903B\u8F91\u5982\u4E0B:",paraId:39,tocIndex:8},{value:`onMessage('executeLocalFunction', (functionId, ...params) => {
|
|
242
|
-
if (!localFunctions[functionId]) throw new Error('\u672A\u627E\u5230\u672C\u5730\u7F13\u5B58\u65B9\u6CD5\uFF1A' + functionId);
|
|
243
|
-
return localFunctions[functionId](...params);
|
|
244
|
-
});
|
|
245
|
-
`,paraId:40,tocIndex:8},{value:"\u81F3\u6B64\uFF0C\u6211\u4EEC\u5B8C\u7F8E\u5730\u5B9E\u73B0\u4E86\u4EFB\u610F\u51FD\u6570\u53C2\u6570\u4F20\u9012\uFF0C\u5E76\u4E14\u540C\u6837\u652F\u6301\u5F02\u6B65\u56DE\u8C03\uFF0C",paraId:41,tocIndex:8},{value:"\u4E0A\u8FF0\u8F6C\u6362\u8FC7\u7A0B\u7528\u6237\u4E0D\u9700\u8981\u505A\u4EFB\u4F55\u5904\u7406\u4E5F\u6CA1\u6709\u4EFB\u4F55\u611F\u77E5\uFF01\uFF01\uFF01",paraId:41,tocIndex:8},{value:" \u7ED9\u7528\u6237\u7684\u611F\u89C9\u5C31\u662F\u51FD\u6570\u88AB\u76F4\u63A5\u4F20\u9012\u8FC7\u53BB\u4E86\uFF01",paraId:41,tocIndex:8},{value:"\u4E3A\u4E86\u8FDB\u4E00\u6B65\u4F7F\u7528\u65B9\u4FBF\uFF0C\u8FD8\u53EF\u4EE5\u7ED9\u5BF9\u8C61\u7C7B\u578B\u52A0\u4E0A\u9012\u5F52\u5224\u65AD\u5904\u7406\u3002",paraId:42,tocIndex:8},{value:"\u9996\u5148\uFF0C\u901A\u8FC7window.parent\u6216\u8005window.opener\u53EF\u4EE5\u81EA\u52A8\u62FF\u5230\u53E6\u5916\u4E00\u65B9\u7684target\uFF1A",paraId:43,tocIndex:9},{value:`// iframe\u6A21\u5F0F\u4E0B\u81EA\u52A8\u8BBE\u7F6E\u76EE\u6807\u7A97\u53E3
|
|
246
|
-
if (!targetWindow && window !== window.parent) {
|
|
247
|
-
targetWindow = window.parent;
|
|
248
|
-
}
|
|
249
|
-
// window.open\u6A21\u5F0F\u4E0B\u81EA\u52A8\u8BBE\u7F6E\u76EE\u6807\u7A97\u53E3
|
|
250
|
-
if (!targetWindow && window.opener) {
|
|
251
|
-
targetWindow = window.opener;
|
|
252
|
-
}
|
|
253
|
-
`,paraId:44,tocIndex:9},{value:"\u7136\u540E\u6BCF\u6B21\u521D\u59CB\u5316\u65F6\u5E95\u5C42\u4F1A\u81EA\u52A8\u4E92\u76F8\u53D1\u9001\u4E00\u6761",paraId:45,tocIndex:9},{value:"auto-connect",paraId:45,tocIndex:9},{value:"\u6D88\u606F\uFF0C2\u4E2A\u7A97\u53E3\u521D\u59CB\u5316\u4E00\u5B9A\u6709\u4E00\u4E2A\u5148\u540E\u987A\u5E8F\uFF0C\u540E\u521D\u59CB\u5316\u7684\u53D1\u9001\u6D88\u606F\u540E\u4E00\u5B9A\u4F1A\u88AB\u76D1\u542C\uFF0C\u76D1\u542C\u7684\u65F6\u5019\u6211\u4EEC\u628A",paraId:45,tocIndex:9},{value:"event.source",paraId:45,tocIndex:9},{value:"\u5B58\u50A8\u8D77\u6765\u4F5C\u4E3A\u4E0B\u6B21",paraId:45,tocIndex:9},{value:"postMessage",paraId:45,tocIndex:9},{value:"\u7684",paraId:45,tocIndex:9},{value:"targetWindow",paraId:45,tocIndex:9},{value:"\u4F7F\u7528\uFF0C\u8FD9\u6837\u5C31\u53EF\u4EE5\u5B9E\u73B0\u76EE\u6807\u7A97\u53E3\u81EA\u52A8\u6355\u83B7\u3002",paraId:45,tocIndex:9},{value:"\u4E00\u4E2A\u5178\u578B\u573A\u666F\u662F\u7236\u9875\u9762\u4FDD\u6301\u4E0D\u53D8\uFF0C\u5B50iframe\u4F1A\u7ECF\u5E38\u8DF3\u6765\u8DF3\u53BB\uFF0C\u8FD9\u4E2A\u65F6\u5019\u9700\u8981\u91CD\u590D\u521D\u59CB\u5316",paraId:46,tocIndex:10},{value:"initWindowMessage",paraId:46,tocIndex:10},{value:"\u4E48\uFF1F\u6CA1\u5173\u7CFB\uFF0C\u5F97\u76CA\u4E8E\u76EE\u6807\u7A97\u53E3\u7684\u81EA\u52A8\u6355\u83B7\uFF0C\u8FD9\u4E9B\u90FD\u4F1A\u88AB\u81EA\u52A8\u5904\u7406\u3002",paraId:46,tocIndex:10},{value:"\u70B9\u6B64\u67E5\u770B",paraId:47,tocIndex:11},{value:"API",paraId:48,tocIndex:11},{value:"\u6587\u6863\u3002",paraId:47,tocIndex:11}]},811:function(n,e,a){"use strict";a.r(e),a.d(e,{texts:function(){return t}});const t=[{value:"request",paraId:0,tocIndex:0},{value:"\u662F\u4E00\u4E2A\u529F\u80FD\u5F3A\u5927\u7684API\u8BF7\u6C42\u51FD\u6570\uFF0C\u4E3B\u8981\u7279\u70B9\uFF1A",paraId:0,tocIndex:0},{value:"\u4F7F\u7528\u7B80\u5355\uFF0C\u9AD8\u5EA6\u96C6\u6210\uFF0C\u53EA\u66B4\u9732\u51E0\u4E2A\u7B80\u5355\u7684\u53C2\u6570\uFF0C\u5185\u7F6E\u4E86\u53C2\u6570\u5904\u7406\u3001\u5F02\u5E38\u515C\u5E95\u5904\u7406\u7B49\uFF1B",paraId:1,tocIndex:0},{value:"\u57FA\u4E8E\u73B0\u4EE3\u5316\u7684",paraId:1,tocIndex:0},{value:"fetch",paraId:1,tocIndex:0},{value:"\uFF0C\u5E76\u5F00\u653E\u6240\u6709\u5E95\u5C42\u914D\u7F6E\uFF1B",paraId:1,tocIndex:0},{value:"\u5021\u5BFC\u7528\u201C\u540C\u6B65\u201D\u7684\u601D\u60F3\u53BB\u5199\u5F02\u6B65\u4EE3\u7801\uFF0C\u53D1\u751F\u5F02\u5E38\u9ED8\u8BA4\u4E2D\u65AD\u6267\u884C\uFF0C\u5F00\u53D1\u8005\u53EA\u9700\u8981\u5173\u6CE8\u6210\u529F\u5904\u7406\u903B\u8F91\uFF0C\u7406\u60F3\u60C5\u51B5\u4E0B\u65E0\u9700\u5173\u5FC3\u5F02\u5E38\u515C\u5E95\uFF0C\u65E0\u9700",paraId:1,tocIndex:0},{value:"try-catch",paraId:1,tocIndex:0},{value:"\uFF1B",paraId:1,tocIndex:0},{value:"requestOptions",paraId:2,tocIndex:1},{value:"\u5B8C\u6574\u53C2\u6570\u8BE6\u89C1",paraId:2,tocIndex:1},{value:"\u8FD9\u91CC",paraId:3,tocIndex:1},{value:"\u3002",paraId:2,tocIndex:1},{value:`import { request } from 'youtil';
|
|
254
|
-
const data = await requestAPI(url, requestOptions);
|
|
255
|
-
`,paraId:4,tocIndex:1},{value:`await requestAPI('xxx', { errorMessage: '\u7CFB\u7EDF\u7E41\u5FD9\uFF0C\u7A0D\u540E\u518D\u8BD5\uFF01' });
|
|
256
|
-
`,paraId:5,tocIndex:3},{value:`const errorHandler = (message: string, resp: any) => {
|
|
257
|
-
if (resp?.busiCode === '3') {
|
|
258
|
-
Toast.show({ title: '\u6211\u662F\u81EA\u5B9A\u4E49\u7279\u6B8A\u5F02\u5E38', icon: 'error' });
|
|
259
|
-
}
|
|
260
|
-
Toast.show({ title: message, icon: 'error' });
|
|
261
|
-
// \u629B\u51FA\u5F02\u5E38\uFF0C\u963B\u6B62\u6267\u884C\u4E4B\u540E\u7684\u64CD\u4F5C
|
|
262
|
-
throw new Error(message);
|
|
263
|
-
}
|
|
264
|
-
await requestAPI('xxx', { errorHandler });
|
|
265
|
-
`,paraId:6,tocIndex:4},{value:"\u6709\u4E9B\u65F6\u5019\u53EF\u80FD\u4E0D\u5173\u6CE8\u8BF7\u6C42\u5F02\u5E38\uFF0C\u671F\u671B\u53D1\u751F\u5F02\u5E38\u65F6\u4E0D\u544A\u77E5\u7528\u6237\uFF1A",paraId:7,tocIndex:5},{value:`await requestAPI('xxx', { silent: true });
|
|
266
|
-
`,paraId:8,tocIndex:5},{value:"\u4E00\u822C\u5728\u8BF7\u6C42\u5F00\u59CB\u663E\u793Aloading\uFF0C\u8BF7\u6C42\u7ED3\u675F\u65E0\u8BBA\u6210\u529F\u4E0E\u5426\u5173\u95EDloading\uFF0C\u53EF\u4EE5\u4F7F\u7528",paraId:9,tocIndex:6},{value:"afterRequest",paraId:9,tocIndex:6},{value:"\u94A9\u5B50\uFF1A",paraId:9,tocIndex:6},{value:`setLoading(true);
|
|
267
|
-
const afterRequest = (success: boolean, resp: any) => setLoading(false);
|
|
268
|
-
await requestAPI('xxx', { afterRequest });
|
|
269
|
-
`,paraId:10,tocIndex:6},{value:`setLoading(true);
|
|
270
|
-
const baseURL= '//xxx.jd.com';
|
|
271
|
-
await requestAPI('xxx', { baseURL });
|
|
272
|
-
`,paraId:11,tocIndex:7},{value:`setLoading(true);
|
|
273
|
-
const axiosOptions = {
|
|
274
|
-
timeout: 30000,
|
|
275
|
-
};
|
|
276
|
-
await requestAPI('xxx', { axiosOptions });
|
|
277
|
-
`,paraId:12,tocIndex:8},{value:"requestAPI\u9ED8\u8BA4\u8981\u6C42\u54CD\u5E94\u9700\u8981\u6EE1\u8DB3\uFF1A",paraId:13,tocIndex:9},{value:`export interface IResponse {
|
|
278
|
-
// \u4E3A0\u8868\u793A\u6210\u529F
|
|
279
|
-
busiCode?: string;
|
|
280
|
-
// \u4E3A0\u8868\u793A\u6210\u529F
|
|
281
|
-
resultCode?: string;
|
|
282
|
-
data: any;
|
|
283
|
-
message?: string;
|
|
284
|
-
}
|
|
285
|
-
`,paraId:14,tocIndex:9},{value:"\u5BF9\u4E8E\u975E\u6807\u8FD4\u56DE\u53EF\u4EE5\u901A\u8FC7",paraId:15,tocIndex:9},{value:"responseConverter",paraId:15,tocIndex:9},{value:"\u8FDB\u884C\u683C\u5F0F\u5316\u540E\u517C\u5BB9\uFF1A",paraId:15,tocIndex:9},{value:`const responseConverter = resp => {
|
|
286
|
-
if (resp) {
|
|
287
|
-
resp.resultCode = resp.xxxCode;
|
|
288
|
-
}
|
|
289
|
-
return resp;
|
|
290
|
-
};
|
|
291
|
-
await requestAPI('xxx', { responseConverter });
|
|
292
|
-
`,paraId:16,tocIndex:9},{value:"\u5F02\u5E38\u4E2D\u65AD\u6267\u884C\u662F\u901A\u8FC7",paraId:17,tocIndex:10},{value:"errorHandler",paraId:17,tocIndex:10},{value:"\u4E2D\u7684",paraId:17,tocIndex:10},{value:"throw new Error",paraId:17,tocIndex:10},{value:"\u5B9E\u73B0\u7684\uFF1A",paraId:17,tocIndex:10},{value:`await requestAPI('xxx');
|
|
293
|
-
console.log('\u5982\u679C\u53D1\u751F\u5F02\u5E38\uFF0C\u8FD9\u6761console.log\u4E0D\u4F1A\u6267\u884C');
|
|
294
|
-
`,paraId:18,tocIndex:10},{value:"\u8FD9\u79CD\u60C5\u51B5\u4E0B\u63A7\u5236\u53F0\u4F1A\u4EA7\u751F\u4E00\u6761\u672A\u5904\u7406\u7684\u5F02\u5E38\u65E5\u5FD7\uFF0C\u5982\u679C\u786E\u5B9E\u6709\u5F3A\u8FEB\u75C7\u4E0D\u559C\u6B22\u8FD9\u79CD\u6A21\u5F0F\uFF0C",paraId:19,tocIndex:10},{value:"requestAPI",paraId:19,tocIndex:10},{value:"\u4E5F\u662F\u652F\u6301",paraId:19,tocIndex:10},{value:"try-catch",paraId:19,tocIndex:10},{value:"\u7684\uFF1A",paraId:19,tocIndex:10},{value:`try {
|
|
295
|
-
await requestAPI('xxx');
|
|
296
|
-
} catch (e) {
|
|
297
|
-
}
|
|
298
|
-
console.log('\u5982\u679C\u53D1\u751F\u5F02\u5E38\uFF0C\u8FD9\u6761console.log\u4ECD\u7136\u4F1A\u6267\u884C');
|
|
299
|
-
`,paraId:20,tocIndex:10},{value:"\u4F20\u5165",paraId:21,tocIndex:11},{value:"params",paraId:21,tocIndex:11},{value:"\u53C2\u6570\u4F1A\u9ED8\u8BA4\u6309\u7167",paraId:21,tocIndex:11},{value:"GET",paraId:21,tocIndex:11},{value:"\u5904\u7406\uFF1A",paraId:21,tocIndex:11},{value:`const params = {};
|
|
300
|
-
await requestAPI('xxx', { params });
|
|
301
|
-
`,paraId:22,tocIndex:11},{value:"\u4F20\u5165",paraId:23,tocIndex:12},{value:"data",paraId:23,tocIndex:12},{value:"\u53C2\u6570\u4F1A\u9ED8\u8BA4\u6309\u7167",paraId:23,tocIndex:12},{value:"POST",paraId:23,tocIndex:12},{value:"\u5904\u7406\uFF1A",paraId:23,tocIndex:12},{value:`const data = {};
|
|
302
|
-
await requestAPI('xxx', { data });
|
|
303
|
-
`,paraId:24,tocIndex:12},{value:"\u4F20\u5165",paraId:25,tocIndex:13},{value:"formData",paraId:25,tocIndex:13},{value:"\u53C2\u6570\uFF1A",paraId:25,tocIndex:13},{value:`const formData = {
|
|
304
|
-
file: SomeFile,
|
|
305
|
-
};
|
|
306
|
-
await requestAPI('xxx', { formData });
|
|
307
|
-
`,paraId:26,tocIndex:13},{value:"\u4F20\u5165",paraId:27,tocIndex:14},{value:"json",paraId:27,tocIndex:14},{value:"\u53C2\u6570\u4F1A\u9ED8\u8BA4\u6309\u7167",paraId:27,tocIndex:14},{value:"postJson",paraId:27,tocIndex:14},{value:"\u6A21\u5F0F\u5904\u7406\uFF1A",paraId:27,tocIndex:14},{value:"\u6240\u8C13",paraId:28,tocIndex:14},{value:"postJson",paraId:28,tocIndex:14},{value:"\u6A21\u5F0F\uFF1A",paraId:28,tocIndex:14},{value:"POST",paraId:28,tocIndex:14},{value:" + ",paraId:28,tocIndex:14},{value:"Content-Type: 'application/json'",paraId:28,tocIndex:14},{value:"\uFF1A",paraId:28,tocIndex:14},{value:`const json = {};
|
|
308
|
-
await requestAPI('xxx', { json });
|
|
309
|
-
`,paraId:29,tocIndex:14}]},47897:function(n,e,a){"use strict";a.r(e),a.d(e,{texts:function(){return t}});const t=[{value:"youtil",paraId:0}]},96446:function(n,e,a){var t=a(37923);function r(l){if(Array.isArray(l))return t(l)}n.exports=r,n.exports.__esModule=!0,n.exports.default=n.exports},25098:function(n){function e(a){if(a===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}n.exports=e,n.exports.__esModule=!0,n.exports.default=n.exports},42672:function(n,e,a){var t=a(21314),r=a(21771);function l(P,g,p){return r()?(n.exports=l=Reflect.construct.bind(),n.exports.__esModule=!0,n.exports.default=n.exports):(n.exports=l=function(H,h,M){var E=[null];E.push.apply(E,h);var O=Function.bind.apply(H,E),m=new O;return M&&t(m,M.prototype),m},n.exports.__esModule=!0,n.exports.default=n.exports),l.apply(null,arguments)}n.exports=l,n.exports.__esModule=!0,n.exports.default=n.exports},26037:function(n,e,a){var t=a(48374),r=a(21771),l=a(73408);function P(g){var p=r();return function(){var H=t(g),h;if(p){var M=t(this).constructor;h=Reflect.construct(H,arguments,M)}else h=H.apply(this,arguments);return l(this,h)}}n.exports=P,n.exports.__esModule=!0,n.exports.default=n.exports},48374:function(n){function e(a){return n.exports=e=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},n.exports.__esModule=!0,n.exports.default=n.exports,e(a)}n.exports=e,n.exports.__esModule=!0,n.exports.default=n.exports},31996:function(n,e,a){var t=a(21314);function r(l,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function");l.prototype=Object.create(P&&P.prototype,{constructor:{value:l,writable:!0,configurable:!0}}),Object.defineProperty(l,"prototype",{writable:!1}),P&&t(l,P)}n.exports=r,n.exports.__esModule=!0,n.exports.default=n.exports},15143:function(n){function e(a){try{return Function.toString.call(a).indexOf("[native code]")!==-1}catch(t){return typeof a=="function"}}n.exports=e,n.exports.__esModule=!0,n.exports.default=n.exports},21771:function(n){function e(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}n.exports=e,n.exports.__esModule=!0,n.exports.default=n.exports},96936:function(n){function e(a){if(typeof Symbol!="undefined"&&a[Symbol.iterator]!=null||a["@@iterator"]!=null)return Array.from(a)}n.exports=e,n.exports.__esModule=!0,n.exports.default=n.exports},88619:function(n){function e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
310
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}n.exports=e,n.exports.__esModule=!0,n.exports.default=n.exports},73408:function(n,e,a){var t=a(52677).default,r=a(25098);function l(P,g){if(g&&(t(g)==="object"||typeof g=="function"))return g;if(g!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return r(P)}n.exports=l,n.exports.__esModule=!0,n.exports.default=n.exports},21314:function(n){function e(a,t){return n.exports=e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(l,P){return l.__proto__=P,l},n.exports.__esModule=!0,n.exports.default=n.exports,e(a,t)}n.exports=e,n.exports.__esModule=!0,n.exports.default=n.exports},19632:function(n,e,a){var t=a(96446),r=a(96936),l=a(96263),P=a(88619);function g(p){return t(p)||r(p)||l(p)||P()}n.exports=g,n.exports.__esModule=!0,n.exports.default=n.exports},12665:function(n,e,a){var t=a(48374),r=a(21314),l=a(15143),P=a(42672);function g(p){var A=typeof Map=="function"?new Map:void 0;return n.exports=g=function(h){if(h===null||!l(h))return h;if(typeof h!="function")throw new TypeError("Super expression must either be null or a function");if(typeof A!="undefined"){if(A.has(h))return A.get(h);A.set(h,M)}function M(){return P(h,arguments,t(this).constructor)}return M.prototype=Object.create(h.prototype,{constructor:{value:M,enumerable:!1,writable:!0,configurable:!0}}),r(M,h)},n.exports.__esModule=!0,n.exports.default=n.exports,g(p)}n.exports=g,n.exports.__esModule=!0,n.exports.default=n.exports}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkyoutil=self.webpackChunkyoutil||[]).push([[65],{16166:function(s,n,e){e.r(n),e.d(n,{default:function(){return o}});var t=e(53683),a=e(67294),r=function(){var u=(0,t.YB)(),l=(0,t.bU)();return a.createElement("div",{className:"dumi-default-not-found"},a.createElement("h1",null,u.formatMessage({id:"404.title"})),a.createElement(t.rU,{to:"base"in l?l.base:"/",replace:!0},u.formatMessage({id:"404.back"})," \u2192"))},o=r}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.dumi-default-not-found{display:flex;flex-direction:column;height:65vh;align-items:center;justify-content:center}.dumi-default-not-found>h1{position:relative;margin:24px 0;color:#e4e9ec;font-size:78px;font-weight:700;text-shadow:-1px -1px 0 #d0d5d8}[data-prefers-color=dark] .dumi-default-not-found>h1{color:#2a353c;text-shadow:-1px -1px 0 #1c2022}.dumi-default-not-found>a{color:#1677ff}[data-prefers-color=dark] .dumi-default-not-found>a{color:#0053c8}.dumi-default-not-found>a:not(:hover){text-decoration:none}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkyoutil=self.webpackChunkyoutil||[]).push([[9],{65149:function(y,s,e){e.r(s),e.d(s,{default:function(){return E}});var o=e(53683),n=e(67294),D=e(52289),g=function(){var O=(0,o.UO)(),t=O.id,a=(0,o.FO)(t),R=(0,D.m)({id:t,component:a.component,renderOpts:a.renderOpts}),h=R.canvasRef,v=a||{},m=v.component,d=v.renderOpts,r=(0,o.kw)(t),u=r.node,l=r.setSource,i=r.error,c=r.loading,w=u||(d!=null&&d.renderer?(0,n.createElement)("div",{ref:h}):m&&(0,n.createElement)(m));return(0,n.useEffect)(function(){var f=function(p){p.data.type==="dumi.liveDemo.setSource"&&l(p.data.value)};return window.addEventListener("message",f),function(){return window.removeEventListener("message",f)}},[l]),(0,n.useEffect)(function(){!c&&(i||u)&&window.postMessage({type:"dumi.liveDemo.compileDone",value:{err:i}})},[i,u,c]),w},E=g}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
body{margin:0;padding:0}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkyoutil=self.webpackChunkyoutil||[]).push([[519],{87171:function(e,n,_){_.d(n,{Z:function(){return u.Z}});var u=_(76012)},21266:function(e,n,_){_.d(n,{Z:function(){return u.Z}});var u=_(79646)},45356:function(e,n,_){_.d(n,{Z:function(){return u.Z}});var u=_(10222)},95044:function(e,n,_){_.d(n,{Z:function(){return u.Z}});var u=_(3933)},23240:function(e,n,_){_.d(n,{Z:function(){return u.Z}});var u=_(51969)},48301:function(e,n,_){_.d(n,{Z:function(){return u.Z}});var u=_(60974)},21209:function(e,n,_){_.d(n,{Z:function(){return u.Z}});var u=_(34814)},86225:function(e,n,_){_.d(n,{Z:function(){return u.Z}});var u=_(25272)},21521:function(e,n,_){_.d(n,{Z:function(){return u.Z}});var u=_(10339)},26871:function(e,n,_){_.d(n,{Z:function(){return u.Z}});var u=_(76777)},63721:function(e,n,_){_.d(n,{Z:function(){return u.Z}});var u=_(55212)},78406:function(e,n,_){_.d(n,{Z:function(){return u.Z}});var u=_(71482)},42515:function(e,n,_){_.d(n,{Z:function(){return u.Z}});var u=_(40123)},983:function(e,n,_){_.d(n,{Z:function(){return u.Z}});var u=_(47332)},96157:function(e,n,_){_.d(n,{ZP:function(){return u.ZP}});var u=_(78181)},47727:function(e,n,_){_.d(n,{Z:function(){return u.Z}});var u=_(59082)},38569:function(e,n,_){_.d(n,{Z:function(){return u.Z}});var u=_(11136)},24733:function(e,n,_){_.d(n,{Z:function(){return u.Z}});var u=_(41318)},26687:function(e,n,_){_.d(n,{Z:function(){return u.Z}});var u=_(69978)}}]);
|