repeat-request.html 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176
  1. <!doctype html>
  2. <html lang="zh" class="no-js">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width,initial-scale=1">
  6. <meta name="description" content="Net document">
  7. <meta name="author" content="劉強東">
  8. <link rel="prev" href="cancel.html">
  9. <link rel="next" href="debounce.html">
  10. <link rel="icon" href="img/book-open.svg">
  11. <meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.5.48">
  12. <title>重复请求 - Net</title>
  13. <link rel="stylesheet" href="assets/stylesheets/main.6f8fc17f.min.css">
  14. <link rel="stylesheet" href="assets/stylesheets/palette.06af60db.min.css">
  15. <script src="https://unpkg.com/iframe-worker/shim"></script>
  16. <link rel="stylesheet" href="css/extra.css">
  17. <script>__md_scope=new URL(".",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
  18. </head>
  19. <body dir="ltr" data-md-color-scheme="default" data-md-color-primary="white" data-md-color-accent="indigo">
  20. <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
  21. <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
  22. <label class="md-overlay" for="__drawer"></label>
  23. <div data-md-component="skip">
  24. </div>
  25. <div data-md-component="announce">
  26. </div>
  27. <header class="md-header md-header--shadow" data-md-component="header">
  28. <nav class="md-header__inner md-grid" aria-label="页眉">
  29. <a href="index.html" title="Net" class="md-header__button md-logo" aria-label="Net" data-md-component="logo">
  30. <img src="img/book-open.svg" alt="logo">
  31. </a>
  32. <label class="md-header__button md-icon" for="__drawer">
  33. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"/></svg>
  34. </label>
  35. <div class="md-header__title" data-md-component="header-title">
  36. <div class="md-header__ellipsis">
  37. <div class="md-header__topic">
  38. <span class="md-ellipsis">
  39. Net
  40. </span>
  41. </div>
  42. <div class="md-header__topic" data-md-component="header-topic">
  43. <span class="md-ellipsis">
  44. 重复请求
  45. </span>
  46. </div>
  47. </div>
  48. </div>
  49. <form class="md-header__option" data-md-component="palette">
  50. <input class="md-option" data-md-color-media="(prefers-color-scheme: light)" data-md-color-scheme="default" data-md-color-primary="white" data-md-color-accent="indigo" aria-hidden="true" type="radio" name="__palette" id="__palette_0">
  51. </form>
  52. <script>var palette=__md_get("__palette");if(palette&&palette.color){if("(prefers-color-scheme)"===palette.color.media){var media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']");palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.getAttribute("data-md-color-primary"),palette.color.accent=input.getAttribute("data-md-color-accent")}for(var[key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)}</script>
  53. <label class="md-header__button md-icon" for="__search">
  54. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
  55. </label>
  56. <div class="md-search" data-md-component="search" role="dialog">
  57. <label class="md-search__overlay" for="__search"></label>
  58. <div class="md-search__inner" role="search">
  59. <form class="md-search__form" name="search">
  60. <input type="text" class="md-search__input" name="query" aria-label="搜索" placeholder="搜索" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
  61. <label class="md-search__icon md-icon" for="__search">
  62. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
  63. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11z"/></svg>
  64. </label>
  65. <nav class="md-search__options" aria-label="查找">
  66. <a href="javascript:void(0)" class="md-search__icon md-icon" title="分享" aria-label="分享" data-clipboard data-clipboard-text="" data-md-component="search-share" tabindex="-1">
  67. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9a3 3 0 0 0-3 3 3 3 0 0 0 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.15c-.05.21-.08.43-.08.66 0 1.61 1.31 2.91 2.92 2.91s2.92-1.3 2.92-2.91A2.92 2.92 0 0 0 18 16.08"/></svg>
  68. </a>
  69. <button type="reset" class="md-search__icon md-icon" title="清空当前内容" aria-label="清空当前内容" tabindex="-1">
  70. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>
  71. </button>
  72. </nav>
  73. <div class="md-search__suggest" data-md-component="search-suggest"></div>
  74. </form>
  75. <div class="md-search__output">
  76. <div class="md-search__scrollwrap" tabindex="0" data-md-scrollfix>
  77. <div class="md-search-result" data-md-component="search-result">
  78. <div class="md-search-result__meta">
  79. 正在初始化搜索引擎
  80. </div>
  81. <ol class="md-search-result__list" role="presentation"></ol>
  82. </div>
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. <div class="md-header__source">
  88. <a href="https://github.com/liangjingkanji/Net" title="前往仓库" class="md-source" data-md-component="source">
  89. <div class="md-source__icon md-icon">
  90. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.7.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81"/></svg>
  91. </div>
  92. <div class="md-source__repository">
  93. GitHub
  94. </div>
  95. </a>
  96. </div>
  97. </nav>
  98. </header>
  99. <div class="md-container" data-md-component="container">
  100. <main class="md-main" data-md-component="main">
  101. <div class="md-main__inner md-grid">
  102. <div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
  103. <div class="md-sidebar__scrollwrap">
  104. <div class="md-sidebar__inner">
  105. <nav class="md-nav md-nav--primary" aria-label="导航栏" data-md-level="0">
  106. <label class="md-nav__title" for="__drawer">
  107. <a href="index.html" title="Net" class="md-nav__button md-logo" aria-label="Net" data-md-component="logo">
  108. <img src="img/book-open.svg" alt="logo">
  109. </a>
  110. Net
  111. </label>
  112. <div class="md-nav__source">
  113. <a href="https://github.com/liangjingkanji/Net" title="前往仓库" class="md-source" data-md-component="source">
  114. <div class="md-source__icon md-icon">
  115. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.7.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81"/></svg>
  116. </div>
  117. <div class="md-source__repository">
  118. GitHub
  119. </div>
  120. </a>
  121. </div>
  122. <ul class="md-nav__list" data-md-scrollfix>
  123. <li class="md-nav__item">
  124. <a href="index.html" class="md-nav__link">
  125. <span class="md-ellipsis">
  126. 使用
  127. </span>
  128. </a>
  129. </li>
  130. <li class="md-nav__item">
  131. <a href="coroutine-request.html" class="md-nav__link">
  132. <span class="md-ellipsis">
  133. 协程请求
  134. </span>
  135. </a>
  136. </li>
  137. <li class="md-nav__item">
  138. <a href="scope.html" class="md-nav__link">
  139. <span class="md-ellipsis">
  140. 作用域
  141. </span>
  142. </a>
  143. </li>
  144. <li class="md-nav__item">
  145. <a href="sync-request.html" class="md-nav__link">
  146. <span class="md-ellipsis">
  147. 同步请求
  148. </span>
  149. </a>
  150. </li>
  151. <li class="md-nav__item">
  152. <a href="request.html" class="md-nav__link">
  153. <span class="md-ellipsis">
  154. 请求参数
  155. </span>
  156. </a>
  157. </li>
  158. <li class="md-nav__item">
  159. <a href="config.html" class="md-nav__link">
  160. <span class="md-ellipsis">
  161. 全局配置
  162. </span>
  163. </a>
  164. </li>
  165. <li class="md-nav__item md-nav__item--pruned md-nav__item--nested">
  166. <a href="converter.html" class="md-nav__link">
  167. <span class="md-ellipsis">
  168. 请求结果
  169. </span>
  170. <span class="md-nav__icon md-icon"></span>
  171. </a>
  172. </li>
  173. <li class="md-nav__item md-nav__item--pruned md-nav__item--nested">
  174. <a href="auto-dialog.html" class="md-nav__link">
  175. <span class="md-ellipsis">
  176. 自动化
  177. </span>
  178. <span class="md-nav__icon md-icon"></span>
  179. </a>
  180. </li>
  181. <li class="md-nav__item">
  182. <a href="thread.html" class="md-nav__link">
  183. <span class="md-ellipsis">
  184. 切换线程
  185. </span>
  186. </a>
  187. </li>
  188. <li class="md-nav__item">
  189. <a href="view-model.html" class="md-nav__link">
  190. <span class="md-ellipsis">
  191. ViewModel
  192. </span>
  193. </a>
  194. </li>
  195. <li class="md-nav__item">
  196. <a href="track.html" class="md-nav__link">
  197. <span class="md-ellipsis">
  198. 异常追踪
  199. </span>
  200. </a>
  201. </li>
  202. <li class="md-nav__item md-nav__item--pruned md-nav__item--nested">
  203. <a href="error.html" class="md-nav__link">
  204. <span class="md-ellipsis">
  205. 错误处理
  206. </span>
  207. <span class="md-nav__icon md-icon"></span>
  208. </a>
  209. </li>
  210. <li class="md-nav__item">
  211. <a href="okhttp-client.html" class="md-nav__link">
  212. <span class="md-ellipsis">
  213. OkHttpClient
  214. </span>
  215. </a>
  216. </li>
  217. <li class="md-nav__item">
  218. <a href="interceptor.html" class="md-nav__link">
  219. <span class="md-ellipsis">
  220. 拦截器
  221. </span>
  222. </a>
  223. </li>
  224. <li class="md-nav__item">
  225. <a href="https.html" class="md-nav__link">
  226. <span class="md-ellipsis">
  227. Https证书
  228. </span>
  229. </a>
  230. </li>
  231. <li class="md-nav__item">
  232. <a href="cookie.html" class="md-nav__link">
  233. <span class="md-ellipsis">
  234. Cookie
  235. </span>
  236. </a>
  237. </li>
  238. <li class="md-nav__item">
  239. <a href="cache.html" class="md-nav__link">
  240. <span class="md-ellipsis">
  241. 缓存
  242. </span>
  243. </a>
  244. </li>
  245. <li class="md-nav__item">
  246. <a href="tag.html" class="md-nav__link">
  247. <span class="md-ellipsis">
  248. 标签/额外
  249. </span>
  250. </a>
  251. </li>
  252. <li class="md-nav__item">
  253. <a href="upload-file.html" class="md-nav__link">
  254. <span class="md-ellipsis">
  255. 上传文件
  256. </span>
  257. </a>
  258. </li>
  259. <li class="md-nav__item">
  260. <a href="download-file.html" class="md-nav__link">
  261. <span class="md-ellipsis">
  262. 下载文件
  263. </span>
  264. </a>
  265. </li>
  266. <li class="md-nav__item">
  267. <a href="progress.html" class="md-nav__link">
  268. <span class="md-ellipsis">
  269. 进度监听
  270. </span>
  271. </a>
  272. </li>
  273. <li class="md-nav__item">
  274. <a href="cancel.html" class="md-nav__link">
  275. <span class="md-ellipsis">
  276. 取消请求
  277. </span>
  278. </a>
  279. </li>
  280. <li class="md-nav__item md-nav__item--active">
  281. <input class="md-nav__toggle md-toggle" type="checkbox" id="__toc">
  282. <a href="repeat-request.html" class="md-nav__link md-nav__link--active">
  283. <span class="md-ellipsis">
  284. 重复请求
  285. </span>
  286. </a>
  287. </li>
  288. <li class="md-nav__item">
  289. <a href="debounce.html" class="md-nav__link">
  290. <span class="md-ellipsis">
  291. 搜索节流
  292. </span>
  293. </a>
  294. </li>
  295. <li class="md-nav__item">
  296. <a href="fastest.html" class="md-nav__link">
  297. <span class="md-ellipsis">
  298. 最快请求结果
  299. </span>
  300. </a>
  301. </li>
  302. <li class="md-nav__item">
  303. <a href="log-recorder.html" class="md-nav__link">
  304. <span class="md-ellipsis">
  305. 日志插件
  306. </span>
  307. </a>
  308. </li>
  309. <li class="md-nav__item">
  310. <a href="log-notice.html" class="md-nav__link">
  311. <span class="md-ellipsis">
  312. 日志通知
  313. </span>
  314. </a>
  315. </li>
  316. <li class="md-nav__item">
  317. <a href="timing.html" class="md-nav__link">
  318. <span class="md-ellipsis">
  319. 限时/定时请求
  320. </span>
  321. </a>
  322. </li>
  323. <li class="md-nav__item">
  324. <a href="callback.html" class="md-nav__link">
  325. <span class="md-ellipsis">
  326. Callback
  327. </span>
  328. </a>
  329. </li>
  330. <li class="md-nav__item">
  331. <a href="interval.html" class="md-nav__link">
  332. <span class="md-ellipsis">
  333. 轮询器/倒计时
  334. </span>
  335. </a>
  336. </li>
  337. <li class="md-nav__item">
  338. <a href="https://github.com/liangjingkanji/Net/discussions" class="md-nav__link">
  339. <span class="md-ellipsis">
  340. 社区讨论
  341. </span>
  342. </a>
  343. </li>
  344. <li class="md-nav__item">
  345. <a href="issues.html" class="md-nav__link">
  346. <span class="md-ellipsis">
  347. 常见问题
  348. </span>
  349. </a>
  350. </li>
  351. <li class="md-nav__item">
  352. <a href="updates.html" class="md-nav__link">
  353. <span class="md-ellipsis">
  354. 更新日志
  355. </span>
  356. </a>
  357. </li>
  358. <li class="md-nav__item">
  359. <a href="api/index.html" class="md-nav__link">
  360. <span class="md-ellipsis">
  361. 3.x文档
  362. </span>
  363. </a>
  364. </li>
  365. </ul>
  366. </nav>
  367. </div>
  368. </div>
  369. </div>
  370. <div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
  371. <div class="md-sidebar__scrollwrap">
  372. <div class="md-sidebar__inner">
  373. <nav class="md-nav md-nav--secondary" aria-label="目录">
  374. </nav>
  375. </div>
  376. </div>
  377. </div>
  378. <div class="md-content" data-md-component="content">
  379. <article class="md-content__inner md-typeset">
  380. <h1>重复请求</h1>
  381. <p>常用于筛选列表请求, 选择新的筛选条件时应将上次未完成的取消后再发起请求</p>
  382. <p>在Net禁止重复请求仅2行代码</p>
  383. <div class="language-kotlin highlight"><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="kd">var</span><span class="w"> </span><span class="nv">scope</span><span class="p">:</span><span class="w"> </span><span class="n">AndroidScope? </span><span class="o">=</span><span class="w"> </span><span class="kc">null</span>
  384. </span><span id="__span-0-2"><a id="__codelineno-0-2" name="__codelineno-0-2" href="#__codelineno-0-2"></a>
  385. </span><span id="__span-0-3"><a id="__codelineno-0-3" name="__codelineno-0-3" href="#__codelineno-0-3"></a><span class="n">btnFilter</span><span class="p">.</span><span class="na">setOnClickListener</span><span class="w"> </span><span class="p">{</span>
  386. </span><span id="__span-0-4"><a id="__codelineno-0-4" name="__codelineno-0-4" href="#__codelineno-0-4"></a><span class="hll"><span class="w"> </span><span class="n">scope</span><span class="o">?.</span><span class="na">cancel</span><span class="p">()</span>
  387. </span></span><span id="__span-0-5"><a id="__codelineno-0-5" name="__codelineno-0-5" href="#__codelineno-0-5"></a>
  388. </span><span id="__span-0-6"><a id="__codelineno-0-6" name="__codelineno-0-6" href="#__codelineno-0-6"></a><span class="w"> </span><span class="n">scope</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">scopeNetLife</span><span class="w"> </span><span class="p">{</span>
  389. </span><span id="__span-0-7"><a id="__codelineno-0-7" name="__codelineno-0-7" href="#__codelineno-0-7"></a><span class="w"> </span><span class="kd">val</span><span class="w"> </span><span class="nv">result</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">Post</span><span class="o">&lt;</span><span class="kt">String</span><span class="o">&gt;</span><span class="p">(</span><span class="n">Api</span><span class="p">.</span><span class="na">PATH</span><span class="p">).</span><span class="na">await</span><span class="p">()</span>
  390. </span><span id="__span-0-8"><a id="__codelineno-0-8" name="__codelineno-0-8" href="#__codelineno-0-8"></a><span class="w"> </span><span class="p">}</span>
  391. </span><span id="__span-0-9"><a id="__codelineno-0-9" name="__codelineno-0-9" href="#__codelineno-0-9"></a><span class="p">}</span>
  392. </span></code></pre></div>
  393. <p>当<code>scope</code>不为空时表示存在旧请求, 无论旧请求是否完成都可以调用<code>cancel()</code>保证取消即可</p>
  394. <ol>
  395. <li><a href="cancel.html">取消请求</a> <br></li>
  396. <li>限制时间强制使用缓存, <a href="cache.html#_3">配置缓存有效期</a></li>
  397. </ol>
  398. </article>
  399. </div>
  400. <script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
  401. </div>
  402. <button type="button" class="md-top md-icon" data-md-component="top" hidden>
  403. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8z"/></svg>
  404. 回到页面顶部
  405. </button>
  406. </main>
  407. <!-- Footer -->
  408. <footer class="md-footer">
  409. <!-- Link to previous and/or next page -->
  410. <nav class="md-footer__inner md-grid" aria-label="footer.title">
  411. <!-- Link to previous page -->
  412. <a href="cancel.html" class="md-footer__link md-footer__link--prev" rel="prev">
  413. <div class="md-footer__button md-icon">
  414. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11z"/></svg>
  415. </div>
  416. <div class="md-footer__title">
  417. <div class="md-ellipsis">
  418. <span class="md-footer__direction">
  419. 上一页
  420. </span>
  421. 取消请求
  422. </div>
  423. </div>
  424. </a>
  425. <!-- Link to next page -->
  426. <a href="debounce.html" class="md-footer__link md-footer__link--next" rel="next">
  427. <div class="md-footer__title">
  428. <div class="md-ellipsis">
  429. <span class="md-footer__direction">
  430. 下一页
  431. </span>
  432. 搜索节流
  433. </div>
  434. </div>
  435. <div class="md-footer__button md-icon">
  436. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11z"/></svg>
  437. </div>
  438. </a>
  439. </nav>
  440. <!-- Further information -->
  441. <div class="md-footer-meta md-typeset">
  442. <div class="md-footer-meta__inner md-grid">
  443. <!-- Copyright and theme information -->
  444. <div class="md-footer-copyright">
  445. <a href="https://github.com/liangjingkanji" target="_blank" rel="noopener">
  446. <div class="md-footer-copyright__highlight">
  447. Copyright &copy; 2018 - 2023 劉強東
  448. </div>
  449. </a>
  450. </div>
  451. <!-- Social links -->
  452. <div class="md-social">
  453. <a href="https://github.com/liangjingkanji" target="_blank" rel="noopener" title="github.com" class="md-social__link">
  454. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><!--! Font Awesome Free 6.7.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6m-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3m44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9M244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8M97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1m-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7m32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1m-11.4-14.7c-1.6 1-1.6 3.6 0 5.9s4.3 3.3 5.6 2.3c1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2"/></svg>
  455. </a>
  456. <a href="https://raw.githubusercontent.com/liangjingkanji/liangjingkanji/master/img/group-qrcode.png" target="_blank" rel="noopener" title="raw.githubusercontent.com" class="md-social__link">
  457. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.7.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M433.754 420.445c-11.526 1.393-44.86-52.741-44.86-52.741 0 31.345-16.136 72.247-51.051 101.786 16.842 5.192 54.843 19.167 45.803 34.421-7.316 12.343-125.51 7.881-159.632 4.037-34.122 3.844-152.316 8.306-159.632-4.037-9.045-15.25 28.918-29.214 45.783-34.415-34.92-29.539-51.059-70.445-51.059-101.792 0 0-33.334 54.134-44.859 52.741-5.37-.65-12.424-29.644 9.347-99.704 10.261-33.024 21.995-60.478 40.144-105.779C60.683 98.063 108.982.006 224 0c113.737.006 163.156 96.133 160.264 214.963 18.118 45.223 29.912 72.85 40.144 105.778 21.768 70.06 14.716 99.053 9.346 99.704"/></svg>
  458. </a>
  459. <a href="https://github.com/liangjingkanji/Net/discussions" target="_blank" rel="noopener" title="github.com" class="md-social__link">
  460. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Free 6.7.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M391.17 103.47h-38.63v109.7h38.63ZM285 103h-38.63v109.75H285ZM120.83 0 24.31 91.42v329.16h115.83V512l96.53-91.42h77.25L487.69 256V0Zm328.24 237.75-77.22 73.12h-77.24l-67.6 64v-64h-86.87V36.58h308.93Z"/></svg>
  461. </a>
  462. </div>
  463. </div>
  464. </div>
  465. </footer>
  466. </div>
  467. <div class="md-dialog" data-md-component="dialog">
  468. <div class="md-dialog__inner md-typeset"></div>
  469. </div>
  470. <script id="__config" type="application/json">{"base": ".", "features": ["navigation.top", "navigation.prune", "navigation.footer", "navigation.instant", "search.highlight", "search.suggest", "search.share", "content.code.copy", "content.code.annotate"], "search": "assets/javascripts/workers/search.6ce7567c.min.js", "translations": {"clipboard.copied": "\u5df2\u590d\u5236", "clipboard.copy": "\u590d\u5236", "search.result.more.one": "\u5728\u8be5\u9875\u4e0a\u8fd8\u6709 1 \u4e2a\u7b26\u5408\u6761\u4ef6\u7684\u7ed3\u679c", "search.result.more.other": "\u5728\u8be5\u9875\u4e0a\u8fd8\u6709 # \u4e2a\u7b26\u5408\u6761\u4ef6\u7684\u7ed3\u679c", "search.result.none": "\u6ca1\u6709\u627e\u5230\u7b26\u5408\u6761\u4ef6\u7684\u7ed3\u679c", "search.result.one": "\u627e\u5230 1 \u4e2a\u7b26\u5408\u6761\u4ef6\u7684\u7ed3\u679c", "search.result.other": "# \u4e2a\u7b26\u5408\u6761\u4ef6\u7684\u7ed3\u679c", "search.result.placeholder": "\u952e\u5165\u4ee5\u5f00\u59cb\u641c\u7d22", "search.result.term.missing": "\u7f3a\u5c11", "select.version": "\u9009\u62e9\u5f53\u524d\u7248\u672c"}}</script>
  471. <script src="assets/javascripts/bundle.83f73b43.min.js"></script>
  472. </body>
  473. </html>