This repository has been archived by the owner on Aug 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
11-es2015.cc91d5da6ccfb7fe67aa.js
1 lines (1 loc) · 59.5 KB
/
11-es2015.cc91d5da6ccfb7fe67aa.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[11],{"93kg":function(e,o,t){"use strict";t.r(o);var n=t("8Y7J"),a=t("0qEG");class c{constructor(){this.item={cols:1,urls:{"en-US":"packages/auth/docs/get.en-US.md","zh-CN":"packages/auth/docs/get.zh-CN.md"},content:{"en-US":{content:'<section class="markdown"><article><p>Token\'s acquisition is divided into two categories, one is its own user authentication center, and the other is social login (essentially, it needs to go to its own user authentication center).</p><h2 id="User-authentication-center">User authentication center<a onclick="window.location.hash = \'User-authentication-center\'" class="anchor">#</a></h2><p>Generally speaking, the backend will provide a URL authentication address. We can send the user name and password entered by the user to the user authentication center just like a normal HTTP request. Finally, we will return a user information containing the Token. Therefore, you only need to use this <a href="/auth/set" data-url="/auth/set">Token Information Store</a>.</p><h2 id="Social-login">Social login<a onclick="window.location.hash = \'Social-login\'" class="anchor">#</a></h2><p>A complete social login takes about two steps:</p><ul><li><p>Open a third-party authorization box</p></li><li><p>Get the authentication information after the callback and <a href="/auth/set" data-url="/auth/set">Token Information Store</a></p></li></ul><h3 id="Turn-on">Turn on<a onclick="window.location.hash = \'Turn-on\'" class="anchor">#</a></h3><p><code>SocialService</code> provides a <code>open()</code> method to open a login box. By default it is not registered in any module, because <code>@delon/auth</code> thinks that such a service is usually only generated during the login process, so there is no need to inject it globally; only need to use the <code>SocialService</code> component Inject it, of course you have to be willing to inject it in the root module.</p><pre class="hljs language-ts"><code>@Component({\n providers: [ SocialService ]\n})\nexport class ProUserLoginComponent {\n constructor(private socialService: SocialService) {}\n}</code></pre><p>Finally, use the <code>type</code> attribute to specify what form to open an authorization box:</p><pre class="hljs language-ts"><code>this.socialService.login(`//github.com/login/oauth/authorize?xxxxxx`, \'/\', { type: \'href\' });\n// Or use window.open to open the authorization window and subscribe to the results\nthis.socialService.login(`//github.com/login/oauth/authorize?xxxxxx`, \'/\', {\n type: \'window\'\n}).subscribe(res => {\n\n});</code></pre><h3 id="Callback">Callback<a onclick="window.location.hash = \'Callback\'" class="anchor">#</a></h3><p>The callback page refers to the authentication information that is carried after the authorization is successful. In the past, you may write the authentication information directly to the cookie on the backend, and it will automatically write to the browser after the request ends. For the single page such as Angular, especially the front and rear ends. This approach becomes unachievable when deployed separately.</p><p>So <code>@delon/auth</code> is to take the information from the callback page URL address as the source of the acquisition, of course it will be limited by the URL itself (eg length); but I want to be a long enough Token value, you can get Token, then get user information.</p><p>You need to create a page for the callback, and the only thing the page has to do is call the <code>callback()</code> method on <code>ngOnInit</code> (for example: <a target="_blank" href="https://github.com/ng-alain/ng-alain/blob/master/src/app/routes/callback/callback.component.ts#L24" data-url="https://github.com/ng-alain/ng-alain/blob/master/src/app/routes/callback/callback.component.ts#L24">callback.component.ts</a>):</p><pre class="hljs language-ts"><code>// 1, default based on the current URL address\nthis.socialService.callback();\n// 2, without `{ useHash: true }` routing\nthis.socialService.callback(`/callback?token=40SOJV-L8oOwwUIs&name=cipchk&uid=1`);\n// 3, with `{ useHash: true }` route\nthis.socialService.callback(`/?token=40SOJV-L8oOwwUIs&name=cipchk&uid=1#/callback`);\n// 4, specify the `ITokenModel` object\nthis.socialService.callback(<ITokenModel>{\n token: \'123456789\',\n name: \'cipchk\',\n id: 10000,\n time: +new Date\n});</code></pre><p><code>callback()</code> will automatically convert the URL to the effect of <code>ITokenModel</code>.</p><blockquote><p>Note: The route for <code>{ useHash: true }</code> does not support callbacks in many third-party authorization boxes. If it is your own account system, you can still use the URL form in the third example.</p></blockquote></article></section>',meta:{order:10,title:{"en-US":"Get Token","zh-CN":"\u83b7\u53d6Token"},type:"Documents"},toc:[{id:"User-authentication-center",title:"User authentication center",h:2},{id:"Social-login",title:"Social login",h:2},{id:"Turn-on",title:"Turn on",h:3},{id:"Callback",title:"Callback",h:3}]},"zh-CN":{content:'<section class="markdown"><article><p>Token \u7684\u83b7\u53d6\u5206\u4e3a\u4e24\u5927\u7c7b\uff0c\u4e00\u662f\u81ea\u5df1\u7684\u7528\u6237\u8ba4\u8bc1\u4e2d\u5fc3\uff0c\u4e8c\u662f\u793e\u4f1a\u5316\u767b\u5f55\uff08\u672c\u8d28\u4e0a\u8fd8\u662f\u9700\u8981\u8d70\u81ea\u5df1\u7684\u7528\u6237\u8ba4\u8bc1\u4e2d\u5fc3\uff09\u3002</p><h2 id="\u7528\u6237\u8ba4\u8bc1\u4e2d\u5fc3">\u7528\u6237\u8ba4\u8bc1\u4e2d\u5fc3<a onclick="window.location.hash = \'\u7528\u6237\u8ba4\u8bc1\u4e2d\u5fc3\'" class="anchor">#</a></h2><p>\u4e00\u822c\u6765\u8bf4\u540e\u7aef\u4f1a\u63d0\u4f9b\u4e00\u4e2aURL\u8ba4\u8bc1\u5730\u5740\uff0c\u6211\u4eec\u53ef\u4ee5\u50cf\u5e73\u5e38\u8bbf\u95ee\u4e00\u4e2a\u666e\u901a HTTP \u8bf7\u6c42\u4e00\u6837\uff0c\u5c06\u7528\u6237\u8f93\u5165\u7684\u7528\u6237\u540d\u548c\u5bc6\u7801\u7b49\u4fe1\u606f\u53d1\u9001\u7ed9\u7528\u6237\u8ba4\u8bc1\u4e2d\u5fc3\uff0c\u6700\u540e\u4f1a\u8fd4\u56de\u4e00\u4e2a\u7528\u6237\u4fe1\u606f\u5305\u542b Token\u3002\u56e0\u6b64\uff0c\u5bf9\u4e8e\u53ea\u9700\u8981\u5c06\u8fd9\u6b64<a href="/auth/set" data-url="/auth/set">Token\u4fe1\u606f\u5b58\u50a8</a>\u8d77\u6765\u5373\u53ef\u3002</p><h2 id="\u793e\u4f1a\u5316\u767b\u5f55">\u793e\u4f1a\u5316\u767b\u5f55<a onclick="window.location.hash = \'\u793e\u4f1a\u5316\u767b\u5f55\'" class="anchor">#</a></h2><p>\u4e00\u4e2a\u5b8c\u6574\u7684\u793e\u4f1a\u5316\u767b\u5f55\u5927\u6982\u9700\u8981\u4e24\u4e2a\u6b65\u9aa4\uff1a</p><ul><li><p>\u6253\u5f00\u7b2c\u4e09\u65b9\u6388\u6743\u6846</p></li><li><p>\u56de\u8c03\u540e\u83b7\u53d6\u8ba4\u8bc1\u4fe1\u606f\u5e76\u5bf9<a href="/auth/set" data-url="/auth/set">Token\u4fe1\u606f\u5b58\u50a8</a></p></li></ul><h3 id="\u6253\u5f00">\u6253\u5f00<a onclick="window.location.hash = \'\u6253\u5f00\'" class="anchor">#</a></h3><p><code>SocialService</code> \u63d0\u4f9b\u4e86 <code>open()</code> \u65b9\u6cd5\uff0c\u7528\u4e8e\u6253\u5f00\u4e00\u4e2a\u767b\u5f55\u6846\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u5b83\u672c\u8eab\u5e76\u4e0d\u5728\u6ce8\u518c\u5230\u4efb\u4f55\u6a21\u5757\u5f53\u4e2d\uff0c\u56e0\u4e3a <code>@delon/auth</code> \u8ba4\u4e3a\u9700\u8981\u8fd9\u7c7b\u670d\u52a1\u901a\u5e38\u53ea\u4f1a\u5728\u767b\u5f55\u8fc7\u7a0b\u4e2d\u4ea7\u751f\uff0c\u56e0\u6b64\u6ca1\u6709\u5fc5\u8981\u5728\u5168\u5c40\u6ce8\u5165\uff1b\u53ea\u9700\u8981\u5728\u4f7f\u7528 <code>SocialService</code> \u5bf9\u5e94\u7ec4\u4ef6\u4e2d\u6ce8\u5165\u5373\u53ef\uff0c\u5f53\u7136\u4f60\u8981\u613f\u610f\u4e5f\u53ef\u4ee5\u5728\u6839\u6a21\u5757\u4e2d\u6ce8\u5165\u3002</p><pre class="hljs language-ts"><code>@Component({\n providers: [ SocialService ]\n})\nexport class ProUserLoginComponent {\n constructor(private socialService: SocialService) {}\n}</code></pre><p>\u6700\u540e\uff0c\u5229\u7528 <code>type</code> \u5c5e\u6027\u6307\u5b9a\u4ee5\u91c7\u7528\u4ec0\u4e48\u5f62\u5f0f\u6253\u5f00\u4e00\u4e2a\u6388\u6743\u6846\uff1a</p><pre class="hljs language-ts"><code>this.socialService.login(`//github.com/login/oauth/authorize?xxxxxx`, \'/\', { type: \'href\' });\n// \u6216\u4f7f\u7528 window.open \u6253\u5f00\u6388\u6743\u6846\u5e76\u8ba2\u9605\u7ed3\u679c\nthis.socialService.login(`//github.com/login/oauth/authorize?xxxxxx`, \'/\', {\n type: \'window\'\n}).subscribe(res => {\n\n});</code></pre><h3 id="\u56de\u8c03">\u56de\u8c03<a onclick="window.location.hash = \'\u56de\u8c03\'" class="anchor">#</a></h3><p>\u56de\u8c03\u9875\u9762\u662f\u6307\u6388\u6743\u6210\u529f\u540e\u643a\u5e26\u7684\u8ba4\u8bc1\u4fe1\u606f\uff1b\u4ee5\u5f80\u4f60\u53ef\u80fd\u76f4\u63a5\u5728\u540e\u7aef\u5c06\u8ba4\u8bc1\u4fe1\u606f\u5199\u5165 Cookie \u4f1a\u81ea\u52a8\u5728\u8bf7\u6c42\u7ed3\u675f\u540e\u5199\u5165\u6d4f\u89c8\u5668\uff0c\u800c\u5bf9\u4e8e Angular \u8fd9\u7c7b\u5355\u9875\u800c\u8a00\uff0c\u7279\u522b\u662f\u524d\u540e\u7aef\u5206\u79bb\u90e8\u7f72\u65f6\uff0c\u8fd9\u79cd\u65b9\u5f0f\u53d8\u6210\u65e0\u6cd5\u5b9e\u73b0\u3002</p><p>\u56e0\u6b64 <code>@delon/auth</code> \u662f\u4ece\u56de\u8c03\u9875 URL \u5730\u5740\u4e0a\u643a\u5e26\u4fe1\u606f\u4f5c\u4e3a\u83b7\u53d6\u6e90\uff0c\u5f53\u7136\u5b83\u4f1a\u53d7 URL \u672c\u8eab\u53d7\u9650\uff08\u4f8b\u5982\uff1a\u957f\u5ea6\uff09\uff1b\u4f46\u6211\u60f3\u5bf9\u4e00\u4e2a Token \u503c\u662f\u8db3\u591f\u957f\u7684\uff0c\u4f60\u53ef\u4ee5\u83b7\u53d6\u5230 Token\uff0c\u518d\u83b7\u53d6\u7528\u6237\u4fe1\u606f\u3002</p><p>\u9700\u8981\u521b\u5efa\u4e00\u4e2a\u7528\u4e8e\u56de\u8c03\u7684\u9875\u9762\uff0c\u800c\u9875\u9762\u552f\u4e00\u8981\u505a\u7684\u5c31\u662f\u5728 <code>ngOnInit</code> \u65f6\u8c03\u7528 <code>callback()</code> \u65b9\u6cd5\uff08\u4f8b\u5982\uff1a<a target="_blank" href="https://github.com/ng-alain/ng-alain/blob/master/src/app/routes/callback/callback.component.ts#L24" data-url="https://github.com/ng-alain/ng-alain/blob/master/src/app/routes/callback/callback.component.ts#L24">callback.component.ts</a>\uff09\uff1a</p><pre class="hljs language-ts"><code>// 1\u3001\u9ed8\u8ba4\u6839\u636e\u5f53\u524dURL\u5730\u5740\nthis.socialService.callback();\n// 2\u3001\u975e `{ useHash: true }` \u8def\u7531\nthis.socialService.callback(`/callback?token=40SOJV-L8oOwwUIs&name=cipchk&uid=1`);\n// 3\u3001\u5e26\u6709 `{ useHash: true }` \u8def\u7531\nthis.socialService.callback(`/?token=40SOJV-L8oOwwUIs&name=cipchk&uid=1#/callback`);\n// 4\u3001\u6307\u5b9a `ITokenModel` \u5bf9\u8c61\nthis.socialService.callback(<ITokenModel>{\n token: \'123456789\',\n name: \'cipchk\',\n id: 10000,\n time: +new Date\n});</code></pre><p><code>callback()</code> \u4f1a\u628aURL\u81ea\u52a8\u8f6c\u6362\u6210\u6548\u7684 <code>ITokenModel</code>\u3002</p><blockquote><p>\u6ce8\uff1a\u5bf9\u4e8e <code>{ useHash: true }</code> \u7684\u8def\u7531\u5728\u5f88\u591a\u7b2c\u4e09\u65b9\u6388\u6743\u6846\u662f\u4e0d\u652f\u6301\u56de\u8c03\uff0c\u82e5\u662f\u81ea\u5df1\u7684\u8d26\u53f7\u4f53\u7cfb\uff0c\u4f60\u4f9d\u7136\u53ef\u4ee5\u4f7f\u7528\u7b2c3\u79cd\u793a\u4f8b\u4e2d\u7684URL\u5f62\u5f0f\u3002</p></blockquote></article></section>',meta:{order:10,title:{"en-US":"Get Token","zh-CN":"\u83b7\u53d6Token"},type:"Documents"},toc:[{id:"\u7528\u6237\u8ba4\u8bc1\u4e2d\u5fc3",title:"\u7528\u6237\u8ba4\u8bc1\u4e2d\u5fc3",h:2},{id:"\u793e\u4f1a\u5316\u767b\u5f55",title:"\u793e\u4f1a\u5316\u767b\u5f55",h:2},{id:"\u6253\u5f00",title:"\u6253\u5f00",h:3},{id:"\u56de\u8c03",title:"\u56de\u8c03",h:3}]}},demo:!1},this.codes=[]}}class l{constructor(){this.item={cols:1,urls:{"en-US":"packages/auth/docs/getting-started.en-US.md","zh-CN":"packages/auth/docs/getting-started.zh-CN.md"},content:{"en-US":{content:'<section class="markdown"><article><h2 id="Foreword">Foreword<a onclick="window.location.hash = \'Foreword\'" class="anchor">#</a></h2><p>@delon/auth is further processing of the authentication process, with a focus on three issues:</p><ul><li><p>How to get the behavior of authentication information, such as: account, social login (Github, Facebook, etc.)</p></li><li><p>How to access authentication information and monitor changes in authentication information</p></li><li><p>When to use authentication information, for example: JWT</p></li></ul><p>@delon/auth does not care about the user interface, it only needs to convert the Token information to the <code>ITokenService</code> type when the login is successful. It will be stored in <code>localStorage</code> (by default). When you manipulate an HTTP request, it automatically adds Token information to <code>header</code> (or elsewhere).</p><p>So, @delon/auth is not limited to ng-alain scaffolding, can be used with any Angular project.</p><blockquote><p>@delon/auth just solution authentication process. You can use <a href="/acl" data-url="/acl">@delon/acl</a> for permission control.</p></blockquote><h3 id="Process">Process<a onclick="window.location.hash = \'Process\'" class="anchor">#</a></h3><ul><li><p>Get Token</p></li><li><p>Store Token</p></li><li><p>Send Token to the backend using the HTTP interceptor</p></li></ul><h2 id="Definition">Definition<a onclick="window.location.hash = \'Definition\'" class="anchor">#</a></h2><h3 id="Token">Token<a onclick="window.location.hash = \'Token\'" class="anchor">#</a></h3><p>@delon/auth thinks that the encrypted string that needs to be sent when requesting is called the Token value, whether it is JWT <code>Authorization</code> parameter or OAuth2 <code>access_token</code> value, which is also the value carried by each HTTP request. Therefore, the <code>ITokenModel</code> interface is used to represent authentication information and has only one <code>token</code> attribute.</p><blockquote><p>Note: The token value must be a string type.</p></blockquote><h3 id="Authentication-Style">Authentication Style<a onclick="window.location.hash = \'Authentication-Style\'" class="anchor">#</a></h3><p>There are currently two styles: Simple Web Token (using <code>SimpleTokenModel</code>) and Json Web Token (using <code>JWTTokenModel</code>) with parsing <code>payload</code> capabilities. The <code>ITokenModel</code> interface can be customized if you have special requirements.</p><h2 id="Usage">Usage<a onclick="window.location.hash = \'Usage\'" class="anchor">#</a></h2><p>Install <code>@delon/auth</code>:</p><pre class="hljs language-bash"><code>yarn add @delon/auth</code></pre><p>Import <code>DelonAuthModule</code> to your AppModule.</p><pre class="hljs language-typescript"><code>import { DelonAuthModule, SimpleInterceptor } from \'@delon/auth\';\n\n@NgModule({\n imports: [\n DelonAuthModule\n ],\n providers: [\n // Specify the HTTP interceptor corresponding to the authentication style\n { provide: HTTP_INTERCEPTORS, useClass: SimpleInterceptor, multi: true}\n ]\n})\nexport class AppModule { }</code></pre><h2 id="DelonAuthConfig">DelonAuthConfig<a onclick="window.location.hash = \'DelonAuthConfig\'" class="anchor">#</a></h2><table><thead><tr><th>Name</th><th>Type</th><th>Default</th><th>Description</th></tr></thead><tbody><tr><td><code>[store_key]</code></td><td><code>string</code></td><td><code>_token</code></td><td><code>localStorage</code> storage KEY value</td></tr><tr><td><code>[token_invalid_redirect]</code></td><td><code>boolean</code></td><td><code>true</code></td><td>Jump to login page if invalid, includs: invalid token, token expired (Only: JWT)</td></tr><tr><td><code>[token_exp_offset]</code></td><td><code>number</code></td><td><code>10</code></td><td>JWT token expiration time offset value (unit: second)</td></tr><tr><td><code>[token_send_key]</code></td><td><code>string</code></td><td>Token</td><td>Send token parameter name</td></tr><tr><td><code>[token_send_template]</code></td><td><code>string</code></td><td><code>${token}</code></td><td>Send a token template with a <code>${property name}</code> placeholder</td></tr><tr><td><code>[token_send_place]</code></td><td><code>header,body,url</code></td><td><code>header</code></td><td>Send token parameter position</td></tr><tr><td><code>[login_url]</code></td><td><code>string</code></td><td><code>/login</code></td><td>Login page routing address</td></tr><tr><td><code>[ignores]</code></td><td><code>RegExp[]</code></td><td><code>[ /\\/login/, /assets\\// ]</code></td><td>Ignore the list of URL addresses</td></tr><tr><td><code>[allow_anonymous_key]</code></td><td><code>string</code></td><td><code>_allow_anonymous</code></td><td>Anonymous login KEY identification, if the request parameter with the KEY is to ignore token</td></tr><tr><td><code>[executeOtherInterceptors]</code></td><td><code>boolean</code></td><td><code>true</code></td><td>Whether continue to call other interceptor <code>intercept</code> method after token missing</td></tr></tbody></table><p>You can override them, for example:</p><pre class="hljs language-ts"><code>// delon.module.ts\nimport { DelonAuthConfig } from \'@delon/auth\';\nexport function delonAuthConfig(): DelonAuthConfig {\n return Object.assign(new DelonAuthConfig(), <DelonAuthConfig>{\n login_url: \'/passport/login\'\n });\n}\n\n@NgModule({})\nexport class DelonModule {\n static forRoot(): ModuleWithProviders {\n return {\n ngModule: DelonModule,\n providers: [\n { provide: DelonAuthConfig, useFactory: delonAuthConfig}\n ]\n };\n }\n}</code></pre></article></section>',meta:{order:1,title:"Getting Started",type:"Documents",module:"DelonAuthModule",config:"DelonAuthConfig"},toc:[{id:"Foreword",title:"Foreword",h:2},{id:"Process",title:"Process",h:3},{id:"Definition",title:"Definition",h:2},{id:"Token",title:"Token",h:3},{id:"Authentication-Style",title:"Authentication Style",h:3},{id:"Usage",title:"Usage",h:2},{id:"DelonAuthConfig",title:"DelonAuthConfig",h:2}]},"zh-CN":{content:'<section class="markdown"><article><h2 id="\u5199\u5728\u524d\u9762">\u5199\u5728\u524d\u9762<a onclick="window.location.hash = \'\u5199\u5728\u524d\u9762\'" class="anchor">#</a></h2><p>@delon/auth \u662f\u5bf9\u8ba4\u8bc1\u8fc7\u7a0b\u8fdb\u4e00\u6b65\u5904\u7406\uff0c\u901a\u5e38\u5176\u6838\u5fc3\u5728\u4e8e Access token \u7684\u83b7\u53d6\u3001\u4f7f\u7528\u73af\u8282\uff0c\u56e0\u6b64\u5c06\u96c6\u4e2d\u89e3\u51b3\u4ee5\u4e0b\u4e09\u4e2a\u95ee\u9898\uff1a</p><ul><li><p>\u5982\u4f55\u83b7\u53d6\u8ba4\u8bc1\u4fe1\u606f\u884c\u4e3a\u65b9\u5f0f\uff0c\u4f8b\u5982\uff1a\u8d26\u5bc6\u3001\u793e\u4f1a\u5316\u767b\u5f55Github\u7b49</p></li><li><p>\u5982\u4f55\u5b58\u53d6\u8ba4\u8bc1\u4fe1\u606f\uff0c\u76d1\u542c\u8ba4\u8bc1\u4fe1\u606f\u53d8\u5316</p></li><li><p>\u4f55\u65f6\u4f7f\u7528\u8ba4\u8bc1\u4fe1\u606f\uff0c\u533a\u5206\u4e0d\u540c\u7684\u8ba4\u8bc1\u65b9\u5f0f\u7684\u4f7f\u7528\u89c4\u5219\uff0c\u4f8b\u5982\uff1aJWT</p></li></ul><p>@delon/auth \u5e76\u4e0d\u4f1a\u5173\u5fc3\u7528\u6237\u754c\u9762\u662f\u600e\u4e48\u6837\uff0c\u53ea\u9700\u8981\u5f53\u767b\u5f55\u6210\u529f\u540e\u5c06 Token \u4fe1\u606f\u8f6c\u5316\u4e3a <code>ITokenService</code> \u7c7b\u578b\uff0c\u5b83\u4f1a\u5b58\u50a8\u5728 <code>localStorage</code> \u5f53\u4e2d\uff08\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff09\u3002\u5f53\u4f60\u64cd\u4f5c HTTP \u8bf7\u6c42\u65f6\uff0c\u5b83\u4f1a\u81ea\u52a8\u5728 <code>header</code> \uff08\u6216\u5176\u4ed6\u5730\u65b9\uff09 \u91cc\u52a0\u5165 Token \u4fe1\u606f\u3002</p><p>\u56e0\u6b64\uff0c@delon/auth \u4e0d\u9650\u4e8e ng-alain \u811a\u624b\u67b6\uff0c\u4efb\u4f55 Angular \u9879\u76ee\u90fd\u53ef\u4ee5\u4f7f\u7528\u5b83\u3002</p><blockquote><p>@delon/auth \u53ea\u662f\u89e3\u51b3\u8ba4\u8bc1\u73af\u8282\uff0c\u6709\u5173\u4e8e\u6743\u9650\u63a7\u5236\u53ef\u4ee5\u4f7f\u7528 <a href="/acl" data-url="/acl">@delon/acl</a>\u3002</p></blockquote><h3 id="\u6d41\u7a0b">\u6d41\u7a0b<a onclick="window.location.hash = \'\u6d41\u7a0b\'" class="anchor">#</a></h3><ul><li><p>\u83b7\u53d6 Token</p></li><li><p>\u5b58\u50a8 Token</p></li><li><p>\u5229\u7528HTTP\u62e6\u622a\u5668\uff0c\u5c06 Token \u53d1\u9001\u7ed9\u540e\u7aef</p></li></ul><h2 id="\u540d\u8bcd\u89e3\u91ca">\u540d\u8bcd\u89e3\u91ca<a onclick="window.location.hash = \'\u540d\u8bcd\u89e3\u91ca\'" class="anchor">#</a></h2><h3 id="Token">Token<a onclick="window.location.hash = \'Token\'" class="anchor">#</a></h3><p>@delon/auth \u8ba4\u4e3a\u8bf7\u6c42\u65f6\u9700\u8981\u53d1\u9001\u7684\u52a0\u5bc6\u5b57\u7b26\u4e32\u79f0\u5b83\u4e3a Token \u503c\uff0c\u4e0d\u7ba1\u662f\u91c7\u7528 JWT \u7684 <code>Authorization</code> \u53c2\u6570\uff0c\u8fd8\u662f OAuth2 \u7684 <code>access_token</code>\uff0c\u8fd9\u4e5f\u662f\u6bcf\u4e2a HTTP \u8bf7\u6c42\u65f6\u6240\u643a\u5e26\u7684\u503c\u3002 \u56e0\u6b64\uff0c<code>ITokenModel</code> \u63a5\u53e3\u7528\u4e8e\u8868\u8ff0\u8ba4\u8bc1\u4fe1\u606f\uff0c\u4e14\u53ea\u6709\u4e00\u4e2a <code>token</code> \u5c5e\u6027\u3002</p><blockquote><p>\u6ce8\u610f\uff1aToken \u503c\u52a1\u5fc5\u662f\u4e00\u4e2a\u5b57\u7b26\u4e32\u503c\u3002</p></blockquote><h3 id="\u8ba4\u8bc1\u98ce\u683c">\u8ba4\u8bc1\u98ce\u683c<a onclick="window.location.hash = \'\u8ba4\u8bc1\u98ce\u683c\'" class="anchor">#</a></h3><p>\u76ee\u524d\u884d\u751f\u4e24\u79cd\u98ce\u683c\uff1aSimple Web Token \uff08\u4f7f\u7528 <code>SimpleTokenModel</code>\uff09\u3001Json Web Token\uff08\u4f7f\u7528 <code>JWTTokenModel</code>\uff09\u5177\u6709\u89e3\u6790 <code>payload</code> \u80fd\u529b\u3002\u5982\u679c\u6709\u7279\u6b8a\u9700\u6c42\u4e5f\u53ef\u4ee5\u81ea\u5b9a\u4e49\u5b9e\u73b0 <code>ITokenModel</code> \u63a5\u53e3\u3002</p><h2 id="\u5982\u4f55\u4f7f\u7528">\u5982\u4f55\u4f7f\u7528<a onclick="window.location.hash = \'\u5982\u4f55\u4f7f\u7528\'" class="anchor">#</a></h2><p>\u5b89\u88c5 <code>@delon/auth</code> \u4f9d\u8d56\u5305\uff1a</p><pre class="hljs language-bash"><code>yarn add @delon/auth</code></pre><p>\u5bfc\u5165 <code>DelonAuthModule</code> \u6a21\u5757\uff1a</p><pre class="hljs language-typescript"><code>import { DelonAuthModule, SimpleInterceptor } from \'@delon/auth\';\n\n@NgModule({\n imports: [\n DelonAuthModule\n ],\n providers: [\n // \u6307\u5b9a\u8ba4\u8bc1\u98ce\u683c\u5bf9\u5e94\u7684HTTP\u62e6\u622a\u5668\n { provide: HTTP_INTERCEPTORS, useClass: SimpleInterceptor, multi: true}\n ]\n})\nexport class AppModule { }</code></pre><p><strong>\u4e3a\u4ec0\u4e48\u9700\u8981HTTP_INTERCEPTORS</strong></p><p>\u9ed8\u8ba4 <code>DelonAuthModule</code> \u5e76\u4e0d\u4f1a\u6ce8\u518c\u4efb\u4f55HTTP\u62e6\u622a\u5668\uff0c\u4e3b\u8981\u662f\u56e0\u4e3a @delon/auth \u63d0\u4f9b\u4e86\u591a\u79cd\u4e0d\u540c<a href="/auth/getting-started#\u8ba4\u8bc1\u98ce\u683c" data-url="/auth/getting-started#\u8ba4\u8bc1\u98ce\u683c">\u8ba4\u8bc1\u98ce\u683c</a>\u3002</p><h2 id="DelonAuthConfig">DelonAuthConfig<a onclick="window.location.hash = \'DelonAuthConfig\'" class="anchor">#</a></h2><table><thead><tr><th>\u53c2\u6570\u540d</th><th>\u7c7b\u578b</th><th>\u9ed8\u8ba4\u503c</th><th>\u63cf\u8ff0</th></tr></thead><tbody><tr><td><code>[store_key]</code></td><td><code>string</code></td><td><code>_token</code></td><td><code>localStorage</code> \u7684\u5b58\u50a8KEY\u503c</td></tr><tr><td><code>[token_invalid_redirect]</code></td><td><code>boolean</code></td><td><code>true</code></td><td>\u65e0\u6548\u65f6\u8df3\u8f6c\u81f3\u767b\u5f55\u9875\uff0c\u5305\u62ec\uff1a\u65e0\u6548token\u503c\u3001token\u5df2\u8fc7\u671f\uff08\u9650JWT\uff09</td></tr><tr><td><code>[token_exp_offset]</code></td><td><code>number</code></td><td><code>10</code></td><td>JWT token\u8fc7\u671f\u65f6\u95f4\u504f\u79fb\u503c\uff08\u5355\u4f4d\uff1a\u79d2\uff09</td></tr><tr><td><code>[token_send_key]</code></td><td><code>string</code></td><td>Token</td><td>\u53d1\u9001token\u53c2\u6570\u540d</td></tr><tr><td><code>[token_send_template]</code></td><td><code>string</code></td><td><code>${token}</code></td><td>\u53d1\u9001token\u6a21\u677f\uff0c\u4ee5 <code>${\u5c5e\u6027\u540d}</code> \u8868\u793a\u5360\u4f4d\u7b26\uff0c\u5c5e\u6027\u540d\u8981\u786e\u4fdd\u5b58\u5728\u5426\u5219\u4ee5\u7a7a\u5b57\u7b26\u4ee3\u66ff</td></tr><tr><td><code>[token_send_place]</code></td><td><code>header,body,url</code></td><td><code>header</code></td><td>\u53d1\u9001token\u53c2\u6570\u4f4d\u7f6e</td></tr><tr><td><code>[login_url]</code></td><td><code>string</code></td><td><code>/login</code></td><td>\u767b\u5f55\u9875\u8def\u7531\u5730\u5740</td></tr><tr><td><code>[ignores]</code></td><td><code>RegExp[]</code></td><td><code>[ /\\/login/, /assets\\// ]</code></td><td>\u5ffd\u7565 URL \u5730\u5740\u6e05\u5355</td></tr><tr><td><code>[allow_anonymous_key]</code></td><td><code>string</code></td><td><code>_allow_anonymous</code></td><td>\u5141\u8bb8\u533f\u540d\u767b\u5f55\u6807\u8bc6\u53f7\uff0c\u82e5\u8bf7\u6c42\u53c2\u6570\u4e2d\u5e26\u6709\u8be5KEY\u8868\u793a\u5ffd\u7565TOKEN</td></tr><tr><td><code>[executeOtherInterceptors]</code></td><td><code>boolean</code></td><td><code>true</code></td><td>\u662f\u5426\u6821\u9a8c\u5931\u6548\u65f6\u547d\u4e2d\u540e\u7ee7\u7eed\u8c03\u7528\u540e\u7eed\u62e6\u622a\u5668\u7684 <code>intercept</code> \u65b9\u6cd5</td></tr></tbody></table><p>\u4f60\u53ef\u4ee5\u8986\u76d6\u5b83\u4eec\uff0c\u4f8b\u5982\uff1a</p><pre class="hljs language-ts"><code>// delon.module.ts\nimport { DelonAuthConfig } from \'@delon/auth\';\nexport function delonAuthConfig(): DelonAuthConfig {\n return Object.assign(new DelonAuthConfig(), <DelonAuthConfig>{\n login_url: \'/passport/login\'\n });\n}\n\n@NgModule({})\nexport class DelonModule {\n static forRoot(): ModuleWithProviders {\n return {\n ngModule: DelonModule,\n providers: [\n { provide: DelonAuthConfig, useFactory: delonAuthConfig}\n ]\n };\n }\n}</code></pre></article></section>',meta:{order:1,title:"\u5f00\u59cb\u4f7f\u7528",type:"Documents",module:"DelonAuthModule",config:"DelonAuthConfig"},toc:[{id:"\u5199\u5728\u524d\u9762",title:"\u5199\u5728\u524d\u9762",h:2},{id:"\u6d41\u7a0b",title:"\u6d41\u7a0b",h:3},{id:"\u540d\u8bcd\u89e3\u91ca",title:"\u540d\u8bcd\u89e3\u91ca",h:2},{id:"Token",title:"Token",h:3},{id:"\u8ba4\u8bc1\u98ce\u683c",title:"\u8ba4\u8bc1\u98ce\u683c",h:3},{id:"\u5982\u4f55\u4f7f\u7528",title:"\u5982\u4f55\u4f7f\u7528",h:2},{id:"DelonAuthConfig",title:"DelonAuthConfig",h:2}]}},demo:!1},this.codes=[]}}class d{constructor(){this.item={cols:1,urls:{"en-US":"packages/auth/docs/guard.en-US.md","zh-CN":"packages/auth/docs/guard.zh-CN.md"},content:{"en-US":{content:'<section class="markdown"><article><h2 id="Written-in-front">Written in front<a onclick="window.location.hash = \'Written-in-front\'" class="anchor">#</a></h2><p>When a route does not initiate a request, it means that the Token validity cannot be verified in the interceptor, and the routing guard can solve the problem, for example, in your root path:</p><pre class="hljs language-ts"><code>[\n {\n path: \'home\',\n component: MockComponent,\n canActivate: [JWTGuard],\n },\n {\n path: \'my\',\n canActivateChild: [JWTGuard],\n children: [\n { path: \'profile\', component: MockComponent }\n ],\n },\n {\n path: \'login\',\n component: MockComponent,\n },\n]</code></pre><h2 id="How-to-choose?">How to choose?<a onclick="window.location.hash = \'How-to-choose?\'" class="anchor">#</a></h2><p>Similarly, the different authentication styles are:</p><ul><li><p><code>SimpleGuard</code> based on Simple Web Token authentication style</p></li><li><p><code>JWTGuard</code> based on Json Web Token authentication style</p></li></ul></article></section>',meta:{order:25,title:{"en-US":"Routing guard","zh-CN":"\u8def\u7531\u5b88\u536b"},type:"Documents"},toc:[{id:"Written-in-front",title:"Written in front",h:2},{id:"How-to-choose?",title:"How to choose?",h:2}]},"zh-CN":{content:'<section class="markdown"><article><h2 id="\u5199\u5728\u524d\u9762">\u5199\u5728\u524d\u9762<a onclick="window.location.hash = \'\u5199\u5728\u524d\u9762\'" class="anchor">#</a></h2><p>\u5f53\u67d0\u4e2a\u8def\u7531\u672a\u53d1\u8d77\u8bf7\u6c42\u65f6\uff0c\u610f\u5473\u7740\u65e0\u6cd5\u5728\u62e6\u622a\u5668\u91cc\u9762\u5bf9\u5176\u8fdb\u884c Token \u6709\u6548\u6027\u7684\u9a8c\u8bc1\uff0c\u800c\u8def\u7531\u5b88\u536b\u53ef\u4ee5\u89e3\u51b3\u8fd9\u4e00\u95ee\u9898\uff0c\u4f8b\u5982\u5728\u4f60\u7684\u6839\u8def\u5f84\u91cc\uff1a</p><pre class="hljs language-ts"><code>[\n {\n path: \'home\',\n component: MockComponent,\n canActivate: [JWTGuard],\n },\n {\n path: \'my\',\n canActivateChild: [JWTGuard],\n children: [\n { path: \'profile\', component: MockComponent }\n ],\n },\n {\n path: \'login\',\n component: MockComponent,\n },\n]</code></pre><h2 id="\u5982\u4f55\u9009\u62e9\uff1f">\u5982\u4f55\u9009\u62e9\uff1f<a onclick="window.location.hash = \'\u5982\u4f55\u9009\u62e9\uff1f\'" class="anchor">#</a></h2><p>\u540c\u6837\uff0c\u9488\u5bf9\u4e0d\u540c\u8ba4\u8bc1\u98ce\u683c\u5206\u522b\u4e3a\uff1a</p><ul><li><p><code>SimpleGuard</code> \u57fa\u4e8e Simple Web Token \u8ba4\u8bc1\u98ce\u683c</p></li><li><p><code>JWTGuard</code> \u57fa\u4e8e Json Web Token \u8ba4\u8bc1\u98ce\u683c</p></li></ul></article></section>',meta:{order:25,title:"\u8def\u7531\u5b88\u536b",type:"Documents"},toc:[{id:"\u5199\u5728\u524d\u9762",title:"\u5199\u5728\u524d\u9762",h:2},{id:"\u5982\u4f55\u9009\u62e9\uff1f",title:"\u5982\u4f55\u9009\u62e9\uff1f",h:2}]}},demo:!1},this.codes=[]}}class i{constructor(){this.item={cols:1,urls:{"en-US":"packages/auth/docs/qa.en-US.md","zh-CN":"packages/auth/docs/qa.zh-CN.md"},content:{"en-US":{content:"<section class=\"markdown\"><article><h2 id=\"How-to-capture-intercepted-information-when-there-is-no-Token?\">How to capture intercepted information when there is no Token?<a onclick=\"window.location.hash = 'How-to-capture-intercepted-information-when-there-is-no-Token?'\" class=\"anchor\">#</a></h2><pre class=\"hljs language-ts\"><code>// Use subscription Error\nthis.http.get('/user').subscribe(\n res => console.log('success', res),\n err => console.error('error', err)\n);\n// Or use catchError\nthis.http.get('/user').pipe(\n catchError(err => {\n console.error('error', err);\n return of({});\n })\n).subscribe();</code></pre></article></section>",meta:{order:10,title:{"zh-CN":"\u5e38\u89c1\u95ee\u9898","en-US":"common problem"},type:"Documents"},toc:[{id:"How-to-capture-intercepted-information-when-there-is-no-Token?",title:"How to capture intercepted information when there is no Token?",h:2}]},"zh-CN":{content:"<section class=\"markdown\"><article><h2 id=\"\u5982\u4f55\u6355\u83b7\u65e0Token\u65f6\u88ab\u62e6\u622a\u4fe1\u606f\uff1f\">\u5982\u4f55\u6355\u83b7\u65e0Token\u65f6\u88ab\u62e6\u622a\u4fe1\u606f\uff1f<a onclick=\"window.location.hash = '\u5982\u4f55\u6355\u83b7\u65e0Token\u65f6\u88ab\u62e6\u622a\u4fe1\u606f\uff1f'\" class=\"anchor\">#</a></h2><pre class=\"hljs language-ts\"><code>// \u5229\u7528\u8ba2\u9605 Error\nthis.http.get('/user').subscribe(\n res => console.log('success', res),\n err => console.error('error', err)\n);\n// \u6216\u4f7f\u7528 catchError\nthis.http.get('/user').pipe(\n catchError(err => {\n console.error('error', err);\n return of({});\n })\n).subscribe();</code></pre></article></section>",meta:{order:10,title:"\u5e38\u89c1\u95ee\u9898",type:"Documents"},toc:[{id:"\u5982\u4f55\u6355\u83b7\u65e0Token\u65f6\u88ab\u62e6\u622a\u4fe1\u606f\uff1f",title:"\u5982\u4f55\u6355\u83b7\u65e0Token\u65f6\u88ab\u62e6\u622a\u4fe1\u606f\uff1f",h:2}]}},demo:!1},this.codes=[]}}class r{constructor(){this.item={cols:1,urls:{"en-US":"packages/auth/docs/send.en-US.md","zh-CN":"packages/auth/docs/send.zh-CN.md"},content:{"en-US":{content:'<section class="markdown"><article><h2 id="Authentication-style">Authentication style<a onclick="window.location.hash = \'Authentication-style\'" class="anchor">#</a></h2><p>It is better to add the corresponding authentication information to each request through the HTTP interceptor. <code>@delonn/auth</code> implements two separate HTTP interceptors based on two different authentication styles.</p><h3 id="SimpleInterceptor">SimpleInterceptor<a onclick="window.location.hash = \'SimpleInterceptor\'" class="anchor">#</a></h3><p>The parameter name and its sending location can be specified via <code>DelonAuthConfig</code>, for example:</p><pre class="hljs language-ts"><code>token_send_key = \'token\';\ntoken_send_template = \'Bearer ${token}\';\ntoken_send_place = \'header\';</code></pre><p>Indicates the <code>{ token: \'Bearer token_string\' }</code> data in the <code>header</code> of each request.</p><h3 id="JWTInterceptor">JWTInterceptor<a onclick="window.location.hash = \'JWTInterceptor\'" class="anchor">#</a></h3><p>It is a standard JWT sending rule that automatically adds <code>{ Authorization: \'Bearer token_string\' }</code> to <code>header</code>.</p><h3 id="How-to-choose?">How to choose?<a onclick="window.location.hash = \'How-to-choose?\'" class="anchor">#</a></h3><p><code><a data-toc="SimpleInterceptor">SimpleInterceptor</a></code> is a very liberal style, you can put <code>token</code> in the request body, request header, etc.</p><p><code><a data-toc="JWTInterceptor">JWTInterceptor</a></code> is a JWT standard, which needs to ensure that the backend also uses such standards.</p><h2 id="How-to-load">How to load<a onclick="window.location.hash = \'How-to-load\'" class="anchor">#</a></h2><p>By default <code>DelonAuthModule</code> does not load any HTTP interceptors, which requires you to manually add in your corresponding module:</p><pre class="hljs language-ts"><code>{ provide: HTTP_INTERCEPTORS, useClass: SimpleInterceptor, multi: true }</code></pre><h2 id="Example">Example<a onclick="window.location.hash = \'Example\'" class="anchor">#</a></h2><p><a target="_blank" href="//ng-alain.github.io/ng-alain/#/passport/login" data-url="//ng-alain.github.io/ng-alain/#/passport/login">DEMO</a>, login or other login method, and observe the changes in the browser localStorage storage data.</p></article></section>',meta:{order:20,title:{"zh-CN":"\u53d1\u9001Token","en-US":"Send Token"},type:"Documents"},toc:[{id:"Authentication-style",title:"Authentication style",h:2},{id:"SimpleInterceptor",title:"SimpleInterceptor",h:3},{id:"JWTInterceptor",title:"JWTInterceptor",h:3},{id:"How-to-choose?",title:"How to choose?",h:3},{id:"How-to-load",title:"How to load",h:2},{id:"Example",title:"Example",h:2}]},"zh-CN":{content:'<section class="markdown"><article><h2 id="\u8ba4\u8bc1\u98ce\u683c">\u8ba4\u8bc1\u98ce\u683c<a onclick="window.location.hash = \'\u8ba4\u8bc1\u98ce\u683c\'" class="anchor">#</a></h2><p>\u901a\u8fc7HTTP\u62e6\u622a\u5668\u5728\u6bcf\u4e00\u4e2a\u8bf7\u6c42\u4e2d\u52a0\u5165\u76f8\u5e94\u7684\u8ba4\u8bc1\u4fe1\u606f\uff0c\u8fd9\u662f\u518d\u597d\u4e0d\u8fc7\u3002<code>@delonn/auth</code> \u6839\u636e\u4e24\u79cd\u4e0d\u540c\u8ba4\u8bc1\u98ce\u683c\uff0c\u5b9e\u73b0\u4e24\u79cd\u5404\u81ea\u7684HTTP\u62e6\u622a\u5668\u3002</p><h3 id="SimpleInterceptor">SimpleInterceptor<a onclick="window.location.hash = \'SimpleInterceptor\'" class="anchor">#</a></h3><p>\u900f\u8fc7 <code>DelonAuthConfig</code> \u53ef\u4ee5\u6307\u5b9a\u53c2\u6570\u540d\u4ee5\u53ca\u5176\u53d1\u9001\u4f4d\u7f6e\uff0c\u4f8b\u5982\uff1a</p><pre class="hljs language-ts"><code>token_send_key = \'token\';\ntoken_send_template = \'Bearer ${token}\';\ntoken_send_place = \'header\';</code></pre><p>\u8868\u793a\u5728\u6bcf\u4e00\u4e2a\u8bf7\u6c42\u7684 <code>header</code> \u52a0\u4e0a <code>{ token: \'Bearer token_string\' }</code> \u6570\u636e\u3002</p><h3 id="JWTInterceptor">JWTInterceptor<a onclick="window.location.hash = \'JWTInterceptor\'" class="anchor">#</a></h3><p>\u5b83\u662f\u4e00\u4e2a\u6807\u51c6JWT\u7684\u53d1\u9001\u89c4\u5219\uff0c\u5373\u5728 <code>header</code> \u81ea\u52a8\u52a0\u4e0a <code>{ Authorization: \'Bearer token_string\' }</code>\u3002</p><h3 id="\u5982\u4f55\u9009\u62e9\uff1f">\u5982\u4f55\u9009\u62e9\uff1f<a onclick="window.location.hash = \'\u5982\u4f55\u9009\u62e9\uff1f\'" class="anchor">#</a></h3><p><code><a data-toc="SimpleInterceptor">SimpleInterceptor</a></code> \u662f\u4e00\u79cd\u81ea\u7531\u5ea6\u975e\u5e38\u9ad8\u7684\u98ce\u683c\uff0c\u4f60\u53ef\u4ee5\u5c06 <code>token</code> \u653e\u5728\u8bf7\u6c42\u4f53\u3001\u8bf7\u6c42\u5934\u7b49\u5f53\u4e2d\u3002</p><p><code><a data-toc="JWTInterceptor">JWTInterceptor</a></code> \u662f\u4e00\u4e2a JWT \u6807\u51c6\uff0c\u8fd9\u9700\u8981\u786e\u4fdd\u540e\u7aef\u4e5f\u91c7\u7528\u8fd9\u7c7b\u6807\u51c6\u3002</p><h2 id="\u5982\u4f55\u52a0\u8f7d">\u5982\u4f55\u52a0\u8f7d<a onclick="window.location.hash = \'\u5982\u4f55\u52a0\u8f7d\'" class="anchor">#</a></h2><p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b <code>DelonAuthModule</code> \u662f\u4e0d\u4f1a\u52a0\u8f7d\u4efb\u4f55HTTP\u62e6\u622a\u5668\uff0c\u8fd9\u9700\u8981\u4f60\u624b\u5de5\u5728\u4f60\u7684\u76f8\u5e94\u7684\u6a21\u5757\u4e2d\u52a0\u4e0a\uff1a</p><pre class="hljs language-ts"><code>{ provide: HTTP_INTERCEPTORS, useClass: SimpleInterceptor, multi: true }</code></pre><h2 id="\u793a\u4f8b">\u793a\u4f8b<a onclick="window.location.hash = \'\u793a\u4f8b\'" class="anchor">#</a></h2><p><a target="_blank" href="//ng-alain.github.io/ng-alain/#/passport/login" data-url="//ng-alain.github.io/ng-alain/#/passport/login">DEMO</a>\uff0c\u8d26\u5bc6\u6216\u5176\u4ed6\u767b\u5f55\u65b9\u5f0f\u767b\u5f55\uff0c\u5e76\u89c2\u5bdf\u6d4f\u89c8\u5668 localStorage \u5b58\u50a8\u6570\u636e\u7684\u53d8\u5316\u3002</p></article></section>',meta:{order:20,title:"\u53d1\u9001Token",type:"Documents"},toc:[{id:"\u8ba4\u8bc1\u98ce\u683c",title:"\u8ba4\u8bc1\u98ce\u683c",h:2},{id:"SimpleInterceptor",title:"SimpleInterceptor",h:3},{id:"JWTInterceptor",title:"JWTInterceptor",h:3},{id:"\u5982\u4f55\u9009\u62e9\uff1f",title:"\u5982\u4f55\u9009\u62e9\uff1f",h:3},{id:"\u5982\u4f55\u52a0\u8f7d",title:"\u5982\u4f55\u52a0\u8f7d",h:2},{id:"\u793a\u4f8b",title:"\u793a\u4f8b",h:2}]}},demo:!1},this.codes=[]}}class s{constructor(){this.item={cols:1,urls:{"en-US":"packages/auth/docs/service.en-US.md","zh-CN":"packages/auth/docs/service.zh-CN.md"},content:{"en-US":{content:'<section class="markdown"><p><code>ITokenService</code> contains some service class for Token operations, such as get current Token information:</p><pre class="hljs language-ts"><code>constructor(@Inject(DA_SERVICE_TOKEN) private tokenService: ITokenService) {\n console.log(tokenService.get().token);\n // When JWT\n console.log(tokenService.get<JWTTokenModel>(JWTTokenModel).token);\n}</code></pre></section>',api:'<h2 id="API">API<a onclick="window.location.hash = \'API\'" class="anchor">#</a></h2><h3 id="Property">Property<a onclick="window.location.hash = \'Property\'" class="anchor">#</a></h3><table><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>[login_url]</code></td><td><code>string</code></td><td>Get the login address of <code>DelonAuthConfig</code> configuration</td></tr><tr><td><code>[referrer]</code></td><td><code>AuthReferrer</code></td><td>Get routing before authorization failure</td></tr></tbody></table><h3 id="Method">Method<a onclick="window.location.hash = \'Method\'" class="anchor">#</a></h3><table><thead><tr><th>Name</th><th>Return Type</th><th>Description</th></tr></thead><tbody><tr><td><code>change()</code></td><td><code>Observable<ITokenModel></code></td><td>Token changed callback</td></tr><tr><td><code>set(data: ITokenModel)</code></td><td><code>boolean</code></td><td>Set Token</td></tr><tr><td><code>get(type?: any)</code></td><td><code>ITokenModel</code></td><td>Get Token</td></tr><tr><td><code>clear(options?: { onlyToken: boolean })</code></td><td><code>void</code></td><td>Clear Token</td></tr></tbody></table>',meta:{order:2,title:"TokenService",type:"Documents"},toc:[{id:"API",title:"API",h:2},{id:"Property",title:"Property",h:3},{id:"Method",title:"Method",h:3}]},"zh-CN":{content:'<section class="markdown"><p><code>ITokenService</code> \u63a5\u53e3\u5305\u542b\u4e86\u4e00\u4e9b\u5bf9 Token \u64cd\u4f5c\u7684\u670d\u52a1\u7c7b\uff0c\u4f8b\u5982\u83b7\u53d6\u5f53\u524d Token \u4fe1\u606f\uff1a</p><pre class="hljs language-ts"><code>constructor(@Inject(DA_SERVICE_TOKEN) private tokenService: ITokenService) {\n console.log(tokenService.get().token);\n // \u5982\u679c\u662f JWT\n console.log(tokenService.get<JWTTokenModel>(JWTTokenModel).token);\n}</code></pre></section>',api:'<h2 id="API">API<a onclick="window.location.hash = \'API\'" class="anchor">#</a></h2><h3 id="\u5c5e\u6027">\u5c5e\u6027<a onclick="window.location.hash = \'\u5c5e\u6027\'" class="anchor">#</a></h3><table><thead><tr><th>\u53c2\u6570\u540d</th><th>\u7c7b\u578b</th><th>\u63cf\u8ff0</th></tr></thead><tbody><tr><td><code>[login_url]</code></td><td><code>string</code></td><td>\u83b7\u53d6 <code>DelonAuthConfig</code> \u914d\u7f6e\u7684\u767b\u5f55\u5730\u5740</td></tr><tr><td><code>[referrer]</code></td><td><code>AuthReferrer</code></td><td>\u83b7\u53d6\u6388\u6743\u5931\u8d25\u524d\u8def\u7531\u4fe1\u606f</td></tr></tbody></table><h3 id="\u65b9\u6cd5">\u65b9\u6cd5<a onclick="window.location.hash = \'\u65b9\u6cd5\'" class="anchor">#</a></h3><table><thead><tr><th>\u65b9\u6cd5\u540d</th><th>\u8fd4\u56de\u7c7b\u578b</th><th>\u63cf\u8ff0</th></tr></thead><tbody><tr><td><code>change()</code></td><td><code>Observable<ITokenModel></code></td><td>\u76d1\u542c Token \u53d8\u5316\u56de\u8c03</td></tr><tr><td><code>set(data: ITokenModel)</code></td><td><code>boolean</code></td><td>\u8bbe\u7f6e Token</td></tr><tr><td><code>get(type?: any)</code></td><td><code>ITokenModel</code></td><td>\u83b7\u53d6 Token</td></tr><tr><td><code>clear(options?: { onlyToken: boolean })</code></td><td><code>void</code></td><td>\u6e05\u7a7a Token</td></tr></tbody></table>',meta:{order:2,title:"TokenService",type:"Documents"},toc:[{id:"API",title:"API",h:2},{id:"\u5c5e\u6027",title:"\u5c5e\u6027",h:3},{id:"\u65b9\u6cd5",title:"\u65b9\u6cd5",h:3}]}},demo:!1},this.codes=[]}}class h{constructor(){this.item={cols:1,urls:{"en-US":"packages/auth/docs/set.en-US.md","zh-CN":"packages/auth/docs/set.zh-CN.md"},content:{"en-US":{content:'<section class="markdown"><article><h2 id="How-to-use">How to use<a onclick="window.location.hash = \'How-to-use\'" class="anchor">#</a></h2><p>The <code>ITokenService</code> interface (the default implementation of <code>TokenService</code>) has only four methods and the <code>login_url</code> attribute:</p><ul><li><p><code>set(data: ITokenModel): boolean</code> Set authentication information and trigger <code>change</code></p></li><li><p><code>get(): ITokenModel</code> Get authentication information</p></li><li><p><code>clear()</code> clears the authentication information and triggers the <code>change</code> parameter to be <code>null</code></p></li><li><p><code>change(): Observable<ITokenModel></code> Subscribe to authentication information change callback</p></li><li><p><code>login_url</code> Get the login address, equivalent to the value configured by <code>forRoot()</code></p></li></ul><p>Therefore, when the backend returns the corresponding authentication information during the login process, as long as the <code>ITokenModel</code> interface object is met, the <code>set</code> method can be called to store the authentication to <code>IStore</code> (the default implementation <code>LocalStorageStore</code>).</p><pre class="hljs language-ts"><code>constructor(@Inject(DA_SERVICE_TOKEN) service: ITokenService) {\n service.set({ token: `asdf` });\n\n service.get().token; // output: asdf\n}</code></pre><h2 id="Storage-type">Storage type<a onclick="window.location.hash = \'Storage-type\'" class="anchor">#</a></h2><p>The default is to use <code>LocalStorageStore</code> persistent storage, you can change other storage methods in <code>delon.module.ts</code> or root module.</p><pre class="hljs language-ts"><code>export class DelonModule {\n static forRoot(): ModuleWithProviders {\n return {\n ngModule: DelonModule,\n providers: [\n { provide: DA_STORE_TOKEN, useClass: MemoryStore }\n ]\n };\n }\n}</code></pre><p>Contains three storage types:</p><h3 id="LocalStorageStore">LocalStorageStore<a onclick="window.location.hash = \'LocalStorageStore\'" class="anchor">#</a></h3><p><code>localStorage</code> storage, <strong>not lost after closing the browser</strong>.</p><h3 id="SessionStorageStore">SessionStorageStore<a onclick="window.location.hash = \'SessionStorageStore\'" class="anchor">#</a></h3><p><code>sessionStorage</code> storage, <strong>lost after closing the browser</strong>.</p><h3 id="MemoryStore">MemoryStore<a onclick="window.location.hash = \'MemoryStore\'" class="anchor">#</a></h3><p>Memory storage, <strong>lost after closing the browser tab</strong>.</p></article></section>',meta:{order:15,title:{"zh-CN":"\u5b58\u50a8Token","en-Us":"Store Token"},type:"Documents"},toc:[{id:"How-to-use",title:"How to use",h:2},{id:"Storage-type",title:"Storage type",h:2},{id:"LocalStorageStore",title:"LocalStorageStore",h:3},{id:"SessionStorageStore",title:"SessionStorageStore",h:3},{id:"MemoryStore",title:"MemoryStore",h:3}]},"zh-CN":{content:'<section class="markdown"><article><h2 id="\u5982\u4f55\u4f7f\u7528">\u5982\u4f55\u4f7f\u7528<a onclick="window.location.hash = \'\u5982\u4f55\u4f7f\u7528\'" class="anchor">#</a></h2><p><code>ITokenService</code> \u63a5\u53e3\uff08\u9ed8\u8ba4\u5b9e\u73b0 <code>TokenService</code>\uff09\uff0c\u53ea\u6709\u56db\u4e2a\u65b9\u6cd5\u53ca <code>login_url</code> \u5c5e\u6027\uff1a</p><ul><li><p><code>set(data: ITokenModel): boolean</code> \u8bbe\u7f6e\u8ba4\u8bc1\u4fe1\u606f\uff0c\u540c\u65f6\u89e6\u53d1 <code>change</code></p></li><li><p><code>get(): ITokenModel</code> \u83b7\u53d6\u8ba4\u8bc1\u4fe1\u606f</p></li><li><p><code>clear()</code> \u6e05\u9664\u8ba4\u8bc1\u4fe1\u606f\uff0c\u540c\u65f6\u89e6\u53d1 <code>change</code> \u53c2\u6570\u4e3a <code>null</code></p></li><li><p><code>change(): Observable<ITokenModel></code> \u8ba2\u9605\u8ba4\u8bc1\u4fe1\u606f\u53d8\u66f4\u56de\u8c03</p></li><li><p><code>login_url</code> \u83b7\u53d6\u767b\u5f55\u5730\u5740\uff0c\u7b49\u540c <code>forRoot()</code> \u6240\u914d\u7f6e\u7684\u503c</p></li></ul><p>\u56e0\u6b64\uff0c\u5f53\u767b\u5f55\u8fc7\u7a0b\u4e2d\u540e\u7aef\u8fd4\u56de\u76f8\u5e94\u7684\u8ba4\u8bc1\u4fe1\u606f\u65f6\uff0c\u53ea\u8981\u7b26\u5408 <code>ITokenModel</code> \u63a5\u53e3\u5bf9\u8c61\uff0c\u90fd\u53ef\u4ee5\u8c03\u7528\u3000<code>set</code> \u65b9\u6cd5\u5c06\u8ba4\u8bc1\u5b58\u50a8\u81f3 <code>IStore</code> \uff08\u9ed8\u8ba4\u5b9e\u73b0 <code>LocalStorageStore</code>\uff09 \u5f53\u4e2d\u3002</p><pre class="hljs language-ts"><code>constructor(@Inject(DA_SERVICE_TOKEN) service: ITokenService) {\n service.set({ token: `asdf` });\n\n service.get().token; // output: asdf\n}</code></pre><h2 id="\u5b58\u50a8\u7c7b\u578b">\u5b58\u50a8\u7c7b\u578b<a onclick="window.location.hash = \'\u5b58\u50a8\u7c7b\u578b\'" class="anchor">#</a></h2><p>\u9ed8\u8ba4\u662f\u91c7\u7528 <code>LocalStorageStore</code> \u6301\u4e45\u5316\u5b58\u50a8\uff0c\u4f60\u53ef\u4ee5\u5728 <code>delon.module.ts</code> \u6216\u6839\u6a21\u5757\u91cc\u53d8\u66f4\u5176\u4ed6\u5b58\u50a8\u65b9\u5f0f\u3002</p><pre class="hljs language-ts"><code>export class DelonModule {\n static forRoot(): ModuleWithProviders {\n return {\n ngModule: DelonModule,\n providers: [\n { provide: DA_STORE_TOKEN, useClass: MemoryStore }\n ]\n };\n }\n}</code></pre><p>\u5305\u542b\u4e09\u79cd\u5b58\u50a8\u7c7b\u578b\uff1a</p><h3 id="LocalStorageStore">LocalStorageStore<a onclick="window.location.hash = \'LocalStorageStore\'" class="anchor">#</a></h3><p><code>localStorage</code> \u5b58\u50a8\uff0c\u5173\u6389\u6d4f\u89c8\u5668\u540e<strong>\u4e0d\u4e22\u5931</strong>\u3002</p><h3 id="SessionStorageStore">SessionStorageStore<a onclick="window.location.hash = \'SessionStorageStore\'" class="anchor">#</a></h3><p><code>sessionStorage</code> \u5b58\u50a8\uff0c\u5173\u6389\u6d4f\u89c8\u5668\u540e<strong>\u4e22\u5931</strong>\u3002</p><h3 id="MemoryStore">MemoryStore<a onclick="window.location.hash = \'MemoryStore\'" class="anchor">#</a></h3><p>\u5185\u5b58\u5b58\u50a8\uff0c\u5173\u6389\u6d4f\u89c8\u5668\u6807\u7b7e\u540e<strong>\u4e22\u5931</strong>\u3002</p></article></section>',meta:{order:15,title:"\u5b58\u50a8Token",type:"Documents"},toc:[{id:"\u5982\u4f55\u4f7f\u7528",title:"\u5982\u4f55\u4f7f\u7528",h:2},{id:"\u5b58\u50a8\u7c7b\u578b",title:"\u5b58\u50a8\u7c7b\u578b",h:2},{id:"LocalStorageStore",title:"LocalStorageStore",h:3},{id:"SessionStorageStore",title:"SessionStorageStore",h:3},{id:"MemoryStore",title:"MemoryStore",h:3}]}},demo:!1},this.codes=[]}}class u{}var p=t("pMnS"),b=t("EdU/"),g=t("/Yna"),k=t("JRKe"),m=t("Ed4d"),T=t("8WaK"),S=t("QfCi"),w=t("CghO"),f=t("Sq/J"),G=t("GYi0"),y=t("EXx9"),v=t("R6D3"),I=t("WP5L"),M=t("71F0"),C=t("fE+l"),A=t("0RMT"),D=t("QcbP"),_=t("0D9X"),z=t("SpJI"),P=t("hBP+"),x=t("QPFe"),W=t("RdGh"),U=t("D9vs"),H=t("DyZ0"),N=t("TY3c"),J=t("u+Cy"),R=t("8+8K"),E=t("YVZs"),O=t("F/j7"),j=t("/EOF"),q=t("ZKYL"),L=t("SZk1"),F=t("5eO6"),Y=t("9BMt"),B=t("kRch"),K=t("QkPN"),V=t("vBNu"),Q=t("Z7t+"),Z=t("II6v"),X=t("MRB6"),$=t("uU7u"),ee=t("iInd"),oe=t("cUpR"),te=n.ub({encapsulation:0,styles:["[_nghost-%COMP%] { display: block }"],data:{}});function ne(e){return n.Sb(0,[(e()(),n.wb(0,0,null,null,1,"app-docs",[],null,null,null,Q.b,Q.a)),n.vb(1,245760,null,0,Z.a,[X.a,$.a,ee.p,oe.b],{codes:[0,"codes"],item:[1,"item"]},null)],(function(e,o){var t=o.component;e(o,1,0,t.codes,t.item)}),null)}function ae(e){return n.Sb(0,[(e()(),n.wb(0,0,null,null,1,"app-auth-get",[],null,null,null,ne,te)),n.vb(1,49152,null,0,c,[],null,null)],null,null)}var ce=n.sb("app-auth-get",c,ae,{},{},[]),le=n.ub({encapsulation:0,styles:["[_nghost-%COMP%] { display: block }"],data:{}});function de(e){return n.Sb(0,[(e()(),n.wb(0,0,null,null,1,"app-docs",[],null,null,null,Q.b,Q.a)),n.vb(1,245760,null,0,Z.a,[X.a,$.a,ee.p,oe.b],{codes:[0,"codes"],item:[1,"item"]},null)],(function(e,o){var t=o.component;e(o,1,0,t.codes,t.item)}),null)}function ie(e){return n.Sb(0,[(e()(),n.wb(0,0,null,null,1,"app-auth-getting-started",[],null,null,null,de,le)),n.vb(1,49152,null,0,l,[],null,null)],null,null)}var re=n.sb("app-auth-getting-started",l,ie,{},{},[]),se=n.ub({encapsulation:0,styles:["[_nghost-%COMP%] { display: block }"],data:{}});function he(e){return n.Sb(0,[(e()(),n.wb(0,0,null,null,1,"app-docs",[],null,null,null,Q.b,Q.a)),n.vb(1,245760,null,0,Z.a,[X.a,$.a,ee.p,oe.b],{codes:[0,"codes"],item:[1,"item"]},null)],(function(e,o){var t=o.component;e(o,1,0,t.codes,t.item)}),null)}function ue(e){return n.Sb(0,[(e()(),n.wb(0,0,null,null,1,"app-auth-guard",[],null,null,null,he,se)),n.vb(1,49152,null,0,d,[],null,null)],null,null)}var pe=n.sb("app-auth-guard",d,ue,{},{},[]),be=n.ub({encapsulation:0,styles:["[_nghost-%COMP%] { display: block }"],data:{}});function ge(e){return n.Sb(0,[(e()(),n.wb(0,0,null,null,1,"app-docs",[],null,null,null,Q.b,Q.a)),n.vb(1,245760,null,0,Z.a,[X.a,$.a,ee.p,oe.b],{codes:[0,"codes"],item:[1,"item"]},null)],(function(e,o){var t=o.component;e(o,1,0,t.codes,t.item)}),null)}function ke(e){return n.Sb(0,[(e()(),n.wb(0,0,null,null,1,"app-auth-qa",[],null,null,null,ge,be)),n.vb(1,49152,null,0,i,[],null,null)],null,null)}var me=n.sb("app-auth-qa",i,ke,{},{},[]),Te=n.ub({encapsulation:0,styles:["[_nghost-%COMP%] { display: block }"],data:{}});function Se(e){return n.Sb(0,[(e()(),n.wb(0,0,null,null,1,"app-docs",[],null,null,null,Q.b,Q.a)),n.vb(1,245760,null,0,Z.a,[X.a,$.a,ee.p,oe.b],{codes:[0,"codes"],item:[1,"item"]},null)],(function(e,o){var t=o.component;e(o,1,0,t.codes,t.item)}),null)}function we(e){return n.Sb(0,[(e()(),n.wb(0,0,null,null,1,"app-auth-send",[],null,null,null,Se,Te)),n.vb(1,49152,null,0,r,[],null,null)],null,null)}var fe=n.sb("app-auth-send",r,we,{},{},[]),Ge=n.ub({encapsulation:0,styles:["[_nghost-%COMP%] { display: block }"],data:{}});function ye(e){return n.Sb(0,[(e()(),n.wb(0,0,null,null,1,"app-docs",[],null,null,null,Q.b,Q.a)),n.vb(1,245760,null,0,Z.a,[X.a,$.a,ee.p,oe.b],{codes:[0,"codes"],item:[1,"item"]},null)],(function(e,o){var t=o.component;e(o,1,0,t.codes,t.item)}),null)}function ve(e){return n.Sb(0,[(e()(),n.wb(0,0,null,null,1,"app-auth-service",[],null,null,null,ye,Ge)),n.vb(1,49152,null,0,s,[],null,null)],null,null)}var Ie=n.sb("app-auth-service",s,ve,{},{},[]),Me=n.ub({encapsulation:0,styles:["[_nghost-%COMP%] { display: block }"],data:{}});function Ce(e){return n.Sb(0,[(e()(),n.wb(0,0,null,null,1,"app-docs",[],null,null,null,Q.b,Q.a)),n.vb(1,245760,null,0,Z.a,[X.a,$.a,ee.p,oe.b],{codes:[0,"codes"],item:[1,"item"]},null)],(function(e,o){var t=o.component;e(o,1,0,t.codes,t.item)}),null)}function Ae(e){return n.Sb(0,[(e()(),n.wb(0,0,null,null,1,"app-auth-set",[],null,null,null,Ce,Me)),n.vb(1,49152,null,0,h,[],null,null)],null,null)}var De=n.sb("app-auth-set",h,Ae,{},{},[]),_e=t("SVse"),ze=t("s7LF"),Pe=t("5VGP"),xe=t("QQfA"),We=t("IP0z"),Ue=t("POq0"),He=t("sAdM"),Ne=t("ekcc"),Je=t("pQl/"),Re=t("g+Fz"),Ee=t("Ybye"),Oe=t("NFMk"),je=t("10Ig"),qe=t("iC8E"),Le=t("/HVE"),Fe=t("v1Dh"),Ye=t("66zS"),Be=t("5Izy"),Ke=t("yTpB"),Ve=t("zMNK"),Qe=t("hOhj"),Ze=t("r19J"),Xe=t("anqq"),$e=t("IYs4"),eo=t("EcpC"),oo=t("GaVp"),to=t("/L1H"),no=t("phDe"),ao=t("rJp6"),co=t("Rgb0"),lo=t("kS4m"),io=t("mW00"),ro=t("jTf7"),so=t("WPSl"),ho=t("YdS3"),uo=t("wQFA"),po=t("px0D"),bo=t("3ZFI"),go=t("CYS+"),ko=t("oBm0"),mo=t("A7zk"),To=t("YRt3"),So=t("lAiz"),wo=t("ce6n"),fo=t("SBNi"),Go=t("7QIX"),yo=t("tYkK"),vo=t("wf2+"),Io=t("eCGT"),Mo=t("nHXS"),Co=t("fb/r"),Ao=t("zTFG"),Do=t("JK0T"),_o=t("JXeA"),zo=t("0CZq"),Po=t("qU0y"),xo=t("vZsH"),Wo=t("W4B1"),Uo=t("SHEi"),Ho=t("FPpa"),No=t("RVNi"),Jo=t("NDed"),Ro=t("5A4h"),Eo=t("N2O2"),Oo=t("ozKM"),jo=t("OvZZ"),qo=t("z+yo"),Lo=t("DQmg"),Fo=t("haRT"),Yo=t("1+nf"),Bo=t("XFzh"),Ko=t("p+Sl"),Vo=t("HhpN"),Qo=t("SN7N"),Zo=t("fwnu"),Xo=t("VbP7"),$o=t("gaRz"),et=t("e15G"),ot=t("+YBk"),tt=t("9J0+"),nt=t("vIiB"),at=t("CGSU"),ct=t("5CFV"),lt=t("GTZx"),dt=t("hS58"),it=t("+ndR"),rt=t("EWQH"),st=t("aq9g"),ht=t("7Dpl"),ut=t("ekmu"),pt=t("vjj7"),bt=t("l/Xz"),gt=t("sRo1"),kt=t("BQzg"),mt=t("YQXl"),Tt=t("dZIx"),St=t("9bzR"),wt=t("WNQ9"),ft=t("5Oon"),Gt=t("lM9c"),yt=t("OSVY"),vt=t("MNSj"),It=t("MZBU"),Mt=t("ev4S"),Ct=t("G1y0"),At=t("5sGc"),Dt=t("4/RT"),_t=t("Q1qs"),zt=t("k5cy"),Pt=t("ceoF"),xt=t("gQlp"),Wt=t("XYAa"),Ut=t("vrge"),Ht=t("nMAq"),Nt=t("5PV9"),Jt=t("nIn3"),Rt=t("xo13"),Et=t("CnVV"),Ot=t("5p8d"),jt=t("qYUw"),qt=t("JpOc"),Lt=t("VRoF"),Ft=t("Uto7"),Yt=t("/p+U"),Bt=t("ye40"),Kt=t("qcxY"),Vt=t("T+Em"),Qt=t("ucmY"),Zt=t("sbFH"),Xt=t("76lH"),$t=t("TSSN"),en=t("Fg/6"),on=t("kzz5"),tn=t("SqF5"),nn=t("Wl7g"),an=t("+TYD"),cn=t("PCNd");t.d(o,"AuthModuleNgFactory",(function(){return ln}));var ln=n.tb(u,[],(function(e){return n.Fb([n.Gb(512,n.j,n.db,[[8,[p.a,b.a,b.b,g.a,k.a,m.a,T.a,S.a,w.a,f.a,G.a,y.a,v.a,I.a,M.a,C.a,A.a,D.a,_.a,z.a,P.a,x.a,W.a,U.a,H.a,N.a,J.a,R.a,E.a,O.a,j.a,q.a,L.a,F.a,Y.a,B.a,K.a,V.a,ce,re,pe,me,fe,Ie,De]],[3,n.j],n.w]),n.Gb(4608,_e.p,_e.o,[n.t,[2,_e.K]]),n.Gb(4608,ze.x,ze.x,[]),n.Gb(4608,ze.e,ze.e,[]),n.Gb(5120,Pe.z,Pe.M,[_e.e,[3,Pe.z]]),n.Gb(4608,xe.d,xe.d,[xe.k,xe.f,n.j,xe.i,xe.g,n.q,n.y,_e.e,We.b,[2,_e.j]]),n.Gb(5120,xe.l,xe.m,[xe.d]),n.Gb(4608,Ue.c,Ue.c,[]),n.Gb(5120,He.b,He.a,[[3,He.b],Ne.a]),n.Gb(4608,Je.d,Je.d,[n.y]),n.Gb(4608,Re.d,Re.d,[_e.e]),n.Gb(4608,Ee.a,Ee.a,[Oe.g]),n.Gb(4608,je.a,je.a,[qe.d]),n.Gb(1073742336,_e.c,_e.c,[]),n.Gb(1073742336,ze.w,ze.w,[]),n.Gb(1073742336,ze.j,ze.j,[]),n.Gb(1073742336,ee.t,ee.t,[[2,ee.y],[2,ee.p]]),n.Gb(1073742336,ze.t,ze.t,[]),n.Gb(1073742336,Le.b,Le.b,[]),n.Gb(1073742336,Fe.b,Fe.b,[]),n.Gb(1073742336,Ye.b,Ye.b,[]),n.Gb(1073742336,Pe.j,Pe.j,[]),n.Gb(1073742336,Be.b,Be.b,[]),n.Gb(1073742336,Ke.a,Ke.a,[]),n.Gb(1073742336,We.a,We.a,[]),n.Gb(1073742336,Ve.e,Ve.e,[]),n.Gb(1073742336,Qe.g,Qe.g,[]),n.Gb(1073742336,xe.h,xe.h,[]),n.Gb(1073742336,Pe.w,Pe.w,[]),n.Gb(1073742336,Ze.b,Ze.b,[]),n.Gb(1073742336,Xe.b,Xe.b,[]),n.Gb(1073742336,$e.b,$e.b,[]),n.Gb(1073742336,Ue.d,Ue.d,[]),n.Gb(1073742336,eo.b,eo.b,[]),n.Gb(1073742336,Pe.J,Pe.J,[]),n.Gb(1073742336,oo.c,oo.c,[]),n.Gb(1073742336,Pe.x,Pe.x,[]),n.Gb(1073742336,to.e,to.e,[]),n.Gb(1073742336,no.i,no.i,[]),n.Gb(1073742336,no.a,no.a,[]),n.Gb(1073742336,no.f,no.f,[]),n.Gb(1073742336,ao.c,ao.c,[]),n.Gb(1073742336,co.b,co.b,[]),n.Gb(1073742336,lo.d,lo.d,[]),n.Gb(1073742336,io.c,io.c,[]),n.Gb(1073742336,ro.h,ro.h,[]),n.Gb(1073742336,so.f,so.f,[]),n.Gb(1073742336,ho.d,ho.d,[]),n.Gb(1073742336,uo.d,uo.d,[]),n.Gb(1073742336,Pe.s,Pe.s,[]),n.Gb(1073742336,po.d,po.d,[]),n.Gb(1073742336,bo.b,bo.b,[]),n.Gb(1073742336,go.c,go.c,[]),n.Gb(1073742336,ko.a,ko.a,[]),n.Gb(1073742336,mo.a,mo.a,[]),n.Gb(1073742336,To.b,To.b,[]),n.Gb(1073742336,So.g,So.g,[]),n.Gb(1073742336,So.b,So.b,[]),n.Gb(1073742336,wo.a,wo.a,[]),n.Gb(1073742336,fo.b,fo.b,[]),n.Gb(1073742336,qe.e,qe.e,[]),n.Gb(1073742336,qe.b,qe.b,[]),n.Gb(1073742336,Go.b,Go.b,[]),n.Gb(1073742336,yo.b,yo.b,[]),n.Gb(1073742336,vo.g,vo.g,[]),n.Gb(1073742336,Io.b,Io.b,[]),n.Gb(1073742336,Mo.a,Mo.a,[]),n.Gb(1073742336,Co.b,Co.b,[]),n.Gb(1073742336,Ao.d,Ao.d,[]),n.Gb(1073742336,Do.b,Do.b,[]),n.Gb(1073742336,_o.h,_o.h,[]),n.Gb(1073742336,_o.f,_o.f,[]),n.Gb(1073742336,Pe.y,Pe.y,[]),n.Gb(1073742336,Oe.h,Oe.h,[]),n.Gb(1073742336,Oe.d,Oe.d,[]),n.Gb(1073742336,Oe.e,Oe.e,[]),n.Gb(1073742336,zo.f,zo.f,[]),n.Gb(1073742336,zo.e,zo.e,[]),n.Gb(1073742336,Po.a,Po.a,[]),n.Gb(1073742336,xo.b,xo.b,[]),n.Gb(1073742336,Wo.b,Wo.b,[]),n.Gb(1073742336,Uo.c,Uo.c,[]),n.Gb(1073742336,Ho.c,Ho.c,[]),n.Gb(1073742336,No.b,No.b,[]),n.Gb(1073742336,Jo.c,Jo.c,[]),n.Gb(1073742336,Ro.a,Ro.a,[]),n.Gb(1073742336,Eo.b,Eo.b,[]),n.Gb(1073742336,Oo.d,Oo.d,[]),n.Gb(1073742336,jo.a,jo.a,[]),n.Gb(1073742336,qo.c,qo.c,[]),n.Gb(1073742336,Lo.b,Lo.b,[]),n.Gb(1073742336,Fo.b,Fo.b,[]),n.Gb(1073742336,Yo.f,Yo.f,[]),n.Gb(1073742336,Bo.b,Bo.b,[]),n.Gb(1073742336,Ko.a,Ko.a,[]),n.Gb(1073742336,Pe.D,Pe.D,[]),n.Gb(1073742336,Vo.c,Vo.c,[]),n.Gb(1073742336,Qo.b,Qo.b,[]),n.Gb(1073742336,Zo.b,Zo.b,[]),n.Gb(1073742336,Pe.o,Pe.o,[]),n.Gb(1073742336,Xo.a,Xo.a,[]),n.Gb(1073742336,$o.d,$o.d,[]),n.Gb(1073742336,et.a,et.a,[]),n.Gb(1073742336,ot.a,ot.a,[]),n.Gb(1073742336,tt.a,tt.a,[Ye.c]),n.Gb(1073742336,nt.a,nt.a,[]),n.Gb(1073742336,at.a,at.a,[]),n.Gb(1073742336,ct.a,ct.a,[]),n.Gb(1073742336,lt.a,lt.a,[]),n.Gb(1073742336,dt.a,dt.a,[]),n.Gb(1073742336,it.a,it.a,[]),n.Gb(1073742336,rt.a,rt.a,[]),n.Gb(1073742336,st.a,st.a,[]),n.Gb(1073742336,ht.a,ht.a,[]),n.Gb(1073742336,ut.a,ut.a,[]),n.Gb(1073742336,pt.a,pt.a,[]),n.Gb(1073742336,bt.a,bt.a,[]),n.Gb(1073742336,gt.a,gt.a,[]),n.Gb(1073742336,kt.a,kt.a,[]),n.Gb(1073742336,Je.c,Je.c,[]),n.Gb(1073742336,mt.a,mt.a,[]),n.Gb(1073742336,Tt.a,Tt.a,[]),n.Gb(1073742336,St.a,St.a,[]),n.Gb(1073742336,wt.a,wt.a,[]),n.Gb(1073742336,ft.a,ft.a,[]),n.Gb(1073742336,Gt.a,Gt.a,[]),n.Gb(1073742336,yt.a,yt.a,[]),n.Gb(1073742336,vt.a,vt.a,[]),n.Gb(1073742336,It.a,It.a,[]),n.Gb(1073742336,Mt.a,Mt.a,[]),n.Gb(1073742336,Ct.a,Ct.a,[]),n.Gb(1073742336,At.a,At.a,[]),n.Gb(1073742336,Dt.a,Dt.a,[]),n.Gb(1073742336,_t.a,_t.a,[]),n.Gb(1073742336,zt.a,zt.a,[]),n.Gb(1073742336,Pt.a,Pt.a,[]),n.Gb(1073742336,xt.a,xt.a,[]),n.Gb(1073742336,Wt.a,Wt.a,[]),n.Gb(1073742336,Ut.a,Ut.a,[]),n.Gb(1073742336,Ht.a,Ht.a,[]),n.Gb(1073742336,Nt.a,Nt.a,[]),n.Gb(1073742336,Jt.a,Jt.a,[]),n.Gb(1073742336,Rt.a,Rt.a,[]),n.Gb(1073742336,Et.a,Et.a,[]),n.Gb(1073742336,Ot.a,Ot.a,[]),n.Gb(1073742336,jt.a,jt.a,[]),n.Gb(1073742336,qt.a,qt.a,[]),n.Gb(1073742336,Lt.a,Lt.a,[]),n.Gb(1073742336,Ft.a,Ft.a,[]),n.Gb(1073742336,Yt.a,Yt.a,[]),n.Gb(1073742336,Bt.a,Bt.a,[]),n.Gb(1073742336,Kt.a,Kt.a,[]),n.Gb(1073742336,Vt.a,Vt.a,[]),n.Gb(1073742336,Qt.a,Qt.a,[]),n.Gb(1073742336,Zt.a,Zt.a,[]),n.Gb(1073742336,Xt.a,Xt.a,[]),n.Gb(1073742336,$t.h,$t.h,[]),n.Gb(1073742336,en.b,en.b,[]),n.Gb(1073742336,on.a,on.a,[]),n.Gb(1073742336,Re.c,Re.c,[]),n.Gb(1073742336,tn.c,tn.c,[]),n.Gb(1073742336,nn.d,nn.d,[]),n.Gb(1073742336,nn.h,nn.h,[]),n.Gb(1073742336,nn.b,nn.b,[]),n.Gb(1073742336,nn.j,nn.j,[]),n.Gb(1073742336,nn.l,nn.l,[]),n.Gb(1073742336,nn.p,nn.p,[]),n.Gb(1073742336,nn.t,nn.t,[]),n.Gb(1073742336,an.a,an.a,[]),n.Gb(1073742336,cn.a,cn.a,[]),n.Gb(1073742336,u,u,[]),n.Gb(256,_o.b,{nzAnimate:!0,nzDuration:3e3,nzMaxStack:7,nzPauseOnHover:!0,nzTop:24},[]),n.Gb(256,zo.b,{nzTop:"24px",nzBottom:"24px",nzPlacement:"topRight",nzDuration:4500,nzMaxStack:7,nzPauseOnHover:!0,nzAnimate:!0},[]),n.Gb(256,Ne.a,ot.b,[]),n.Gb(1024,ee.n,(function(){return[[{path:"",component:a.a,children:[{path:"",redirectTo:"getting-started/zh",pathMatch:"full"},{path:"get",redirectTo:"get/zh",pathMatch:"full"},{path:"get/:lang",component:c},{path:"getting-started",redirectTo:"getting-started/zh",pathMatch:"full"},{path:"getting-started/:lang",component:l},{path:"guard",redirectTo:"guard/zh",pathMatch:"full"},{path:"guard/:lang",component:d},{path:"qa",redirectTo:"qa/zh",pathMatch:"full"},{path:"qa/:lang",component:i},{path:"send",redirectTo:"send/zh",pathMatch:"full"},{path:"send/:lang",component:r},{path:"service",redirectTo:"service/zh",pathMatch:"full"},{path:"service/:lang",component:s},{path:"set",redirectTo:"set/zh",pathMatch:"full"},{path:"set/:lang",component:h}]}]]}),[])])}))}}]);