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-es5.cc91d5da6ccfb7fe67aa.js
1 lines (1 loc) · 59.7 KB
/
11-es5.cc91d5da6ccfb7fe67aa.js
1
function _classCallCheck(e,o){if(!(e instanceof o))throw new TypeError("Cannot call a class as a function")}(window.webpackJsonp=window.webpackJsonp||[]).push([[11],{"93kg":function(e,o,t){"use strict";t.r(o);var n=t("8Y7J"),a=t("0qEG"),c=function e(){_classCallCheck(this,e),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=[]},l=function e(){_classCallCheck(this,e),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=[]},d=function e(){_classCallCheck(this,e),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=[]},i=function e(){_classCallCheck(this,e),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=[]},r=function e(){_classCallCheck(this,e),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=[]},s=function e(){_classCallCheck(this,e),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=[]},h=function e(){_classCallCheck(this,e),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=[]},u=function e(){_classCallCheck(this,e)},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"),C=t("WP5L"),I=t("71F0"),M=t("fE+l"),A=t("0RMT"),_=t("QcbP"),D=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"),E=t("8+8K"),R=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)}var ae=n.sb("app-auth-get",c,(function(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)}),{},{},[]),ce=n.ub({encapsulation:0,styles:["[_nghost-%COMP%] { display: block }"],data:{}});function le(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)}var de=n.sb("app-auth-getting-started",l,(function(e){return n.Sb(0,[(e()(),n.wb(0,0,null,null,1,"app-auth-getting-started",[],null,null,null,le,ce)),n.vb(1,49152,null,0,l,[],null,null)],null,null)}),{},{},[]),ie=n.ub({encapsulation:0,styles:["[_nghost-%COMP%] { display: block }"],data:{}});function re(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)}var se=n.sb("app-auth-guard",d,(function(e){return n.Sb(0,[(e()(),n.wb(0,0,null,null,1,"app-auth-guard",[],null,null,null,re,ie)),n.vb(1,49152,null,0,d,[],null,null)],null,null)}),{},{},[]),he=n.ub({encapsulation:0,styles:["[_nghost-%COMP%] { display: block }"],data:{}});function ue(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)}var pe=n.sb("app-auth-qa",i,(function(e){return n.Sb(0,[(e()(),n.wb(0,0,null,null,1,"app-auth-qa",[],null,null,null,ue,he)),n.vb(1,49152,null,0,i,[],null,null)],null,null)}),{},{},[]),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)}var ke=n.sb("app-auth-send",r,(function(e){return n.Sb(0,[(e()(),n.wb(0,0,null,null,1,"app-auth-send",[],null,null,null,ge,be)),n.vb(1,49152,null,0,r,[],null,null)],null,null)}),{},{},[]),me=n.ub({encapsulation:0,styles:["[_nghost-%COMP%] { display: block }"],data:{}});function Te(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)}var Se=n.sb("app-auth-service",s,(function(e){return n.Sb(0,[(e()(),n.wb(0,0,null,null,1,"app-auth-service",[],null,null,null,Te,me)),n.vb(1,49152,null,0,s,[],null,null)],null,null)}),{},{},[]),we=n.ub({encapsulation:0,styles:["[_nghost-%COMP%] { display: block }"],data:{}});function fe(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)}var Ge=n.sb("app-auth-set",h,(function(e){return n.Sb(0,[(e()(),n.wb(0,0,null,null,1,"app-auth-set",[],null,null,null,fe,we)),n.vb(1,49152,null,0,h,[],null,null)],null,null)}),{},{},[]),ye=t("SVse"),ve=t("s7LF"),Ce=t("5VGP"),Ie=t("QQfA"),Me=t("IP0z"),Ae=t("POq0"),_e=t("sAdM"),De=t("ekcc"),ze=t("pQl/"),Pe=t("g+Fz"),xe=t("Ybye"),We=t("NFMk"),Ue=t("10Ig"),He=t("iC8E"),Ne=t("/HVE"),Je=t("v1Dh"),Ee=t("66zS"),Re=t("5Izy"),Oe=t("yTpB"),je=t("zMNK"),qe=t("hOhj"),Le=t("r19J"),Fe=t("anqq"),Ye=t("IYs4"),Be=t("EcpC"),Ke=t("GaVp"),Ve=t("/L1H"),Qe=t("phDe"),Ze=t("rJp6"),Xe=t("Rgb0"),$e=t("kS4m"),eo=t("mW00"),oo=t("jTf7"),to=t("WPSl"),no=t("YdS3"),ao=t("wQFA"),co=t("px0D"),lo=t("3ZFI"),io=t("CYS+"),ro=t("oBm0"),so=t("A7zk"),ho=t("YRt3"),uo=t("lAiz"),po=t("ce6n"),bo=t("SBNi"),go=t("7QIX"),ko=t("tYkK"),mo=t("wf2+"),To=t("eCGT"),So=t("nHXS"),wo=t("fb/r"),fo=t("zTFG"),Go=t("JK0T"),yo=t("JXeA"),vo=t("0CZq"),Co=t("qU0y"),Io=t("vZsH"),Mo=t("W4B1"),Ao=t("SHEi"),_o=t("FPpa"),Do=t("RVNi"),zo=t("NDed"),Po=t("5A4h"),xo=t("N2O2"),Wo=t("ozKM"),Uo=t("OvZZ"),Ho=t("z+yo"),No=t("DQmg"),Jo=t("haRT"),Eo=t("1+nf"),Ro=t("XFzh"),Oo=t("p+Sl"),jo=t("HhpN"),qo=t("SN7N"),Lo=t("fwnu"),Fo=t("VbP7"),Yo=t("gaRz"),Bo=t("e15G"),Ko=t("+YBk"),Vo=t("9J0+"),Qo=t("vIiB"),Zo=t("CGSU"),Xo=t("5CFV"),$o=t("GTZx"),et=t("hS58"),ot=t("+ndR"),tt=t("EWQH"),nt=t("aq9g"),at=t("7Dpl"),ct=t("ekmu"),lt=t("vjj7"),dt=t("l/Xz"),it=t("sRo1"),rt=t("BQzg"),st=t("YQXl"),ht=t("dZIx"),ut=t("9bzR"),pt=t("WNQ9"),bt=t("5Oon"),gt=t("lM9c"),kt=t("OSVY"),mt=t("MNSj"),Tt=t("MZBU"),St=t("ev4S"),wt=t("G1y0"),ft=t("5sGc"),Gt=t("4/RT"),yt=t("Q1qs"),vt=t("k5cy"),Ct=t("ceoF"),It=t("gQlp"),Mt=t("XYAa"),At=t("vrge"),_t=t("nMAq"),Dt=t("5PV9"),zt=t("nIn3"),Pt=t("xo13"),xt=t("CnVV"),Wt=t("5p8d"),Ut=t("qYUw"),Ht=t("JpOc"),Nt=t("VRoF"),Jt=t("Uto7"),Et=t("/p+U"),Rt=t("ye40"),Ot=t("qcxY"),jt=t("T+Em"),qt=t("ucmY"),Lt=t("sbFH"),Ft=t("76lH"),Yt=t("TSSN"),Bt=t("Fg/6"),Kt=t("kzz5"),Vt=t("SqF5"),Qt=t("Wl7g"),Zt=t("+TYD"),Xt=t("PCNd");t.d(o,"AuthModuleNgFactory",(function(){return $t}));var $t=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,C.a,I.a,M.a,A.a,_.a,D.a,z.a,P.a,x.a,W.a,U.a,H.a,N.a,J.a,E.a,R.a,O.a,j.a,q.a,L.a,F.a,Y.a,B.a,K.a,V.a,ae,de,se,pe,ke,Se,Ge]],[3,n.j],n.w]),n.Gb(4608,ye.p,ye.o,[n.t,[2,ye.K]]),n.Gb(4608,ve.x,ve.x,[]),n.Gb(4608,ve.e,ve.e,[]),n.Gb(5120,Ce.z,Ce.M,[ye.e,[3,Ce.z]]),n.Gb(4608,Ie.d,Ie.d,[Ie.k,Ie.f,n.j,Ie.i,Ie.g,n.q,n.y,ye.e,Me.b,[2,ye.j]]),n.Gb(5120,Ie.l,Ie.m,[Ie.d]),n.Gb(4608,Ae.c,Ae.c,[]),n.Gb(5120,_e.b,_e.a,[[3,_e.b],De.a]),n.Gb(4608,ze.d,ze.d,[n.y]),n.Gb(4608,Pe.d,Pe.d,[ye.e]),n.Gb(4608,xe.a,xe.a,[We.g]),n.Gb(4608,Ue.a,Ue.a,[He.d]),n.Gb(1073742336,ye.c,ye.c,[]),n.Gb(1073742336,ve.w,ve.w,[]),n.Gb(1073742336,ve.j,ve.j,[]),n.Gb(1073742336,ee.t,ee.t,[[2,ee.y],[2,ee.p]]),n.Gb(1073742336,ve.t,ve.t,[]),n.Gb(1073742336,Ne.b,Ne.b,[]),n.Gb(1073742336,Je.b,Je.b,[]),n.Gb(1073742336,Ee.b,Ee.b,[]),n.Gb(1073742336,Ce.j,Ce.j,[]),n.Gb(1073742336,Re.b,Re.b,[]),n.Gb(1073742336,Oe.a,Oe.a,[]),n.Gb(1073742336,Me.a,Me.a,[]),n.Gb(1073742336,je.e,je.e,[]),n.Gb(1073742336,qe.g,qe.g,[]),n.Gb(1073742336,Ie.h,Ie.h,[]),n.Gb(1073742336,Ce.w,Ce.w,[]),n.Gb(1073742336,Le.b,Le.b,[]),n.Gb(1073742336,Fe.b,Fe.b,[]),n.Gb(1073742336,Ye.b,Ye.b,[]),n.Gb(1073742336,Ae.d,Ae.d,[]),n.Gb(1073742336,Be.b,Be.b,[]),n.Gb(1073742336,Ce.J,Ce.J,[]),n.Gb(1073742336,Ke.c,Ke.c,[]),n.Gb(1073742336,Ce.x,Ce.x,[]),n.Gb(1073742336,Ve.e,Ve.e,[]),n.Gb(1073742336,Qe.i,Qe.i,[]),n.Gb(1073742336,Qe.a,Qe.a,[]),n.Gb(1073742336,Qe.f,Qe.f,[]),n.Gb(1073742336,Ze.c,Ze.c,[]),n.Gb(1073742336,Xe.b,Xe.b,[]),n.Gb(1073742336,$e.d,$e.d,[]),n.Gb(1073742336,eo.c,eo.c,[]),n.Gb(1073742336,oo.h,oo.h,[]),n.Gb(1073742336,to.f,to.f,[]),n.Gb(1073742336,no.d,no.d,[]),n.Gb(1073742336,ao.d,ao.d,[]),n.Gb(1073742336,Ce.s,Ce.s,[]),n.Gb(1073742336,co.d,co.d,[]),n.Gb(1073742336,lo.b,lo.b,[]),n.Gb(1073742336,io.c,io.c,[]),n.Gb(1073742336,ro.a,ro.a,[]),n.Gb(1073742336,so.a,so.a,[]),n.Gb(1073742336,ho.b,ho.b,[]),n.Gb(1073742336,uo.g,uo.g,[]),n.Gb(1073742336,uo.b,uo.b,[]),n.Gb(1073742336,po.a,po.a,[]),n.Gb(1073742336,bo.b,bo.b,[]),n.Gb(1073742336,He.e,He.e,[]),n.Gb(1073742336,He.b,He.b,[]),n.Gb(1073742336,go.b,go.b,[]),n.Gb(1073742336,ko.b,ko.b,[]),n.Gb(1073742336,mo.g,mo.g,[]),n.Gb(1073742336,To.b,To.b,[]),n.Gb(1073742336,So.a,So.a,[]),n.Gb(1073742336,wo.b,wo.b,[]),n.Gb(1073742336,fo.d,fo.d,[]),n.Gb(1073742336,Go.b,Go.b,[]),n.Gb(1073742336,yo.h,yo.h,[]),n.Gb(1073742336,yo.f,yo.f,[]),n.Gb(1073742336,Ce.y,Ce.y,[]),n.Gb(1073742336,We.h,We.h,[]),n.Gb(1073742336,We.d,We.d,[]),n.Gb(1073742336,We.e,We.e,[]),n.Gb(1073742336,vo.f,vo.f,[]),n.Gb(1073742336,vo.e,vo.e,[]),n.Gb(1073742336,Co.a,Co.a,[]),n.Gb(1073742336,Io.b,Io.b,[]),n.Gb(1073742336,Mo.b,Mo.b,[]),n.Gb(1073742336,Ao.c,Ao.c,[]),n.Gb(1073742336,_o.c,_o.c,[]),n.Gb(1073742336,Do.b,Do.b,[]),n.Gb(1073742336,zo.c,zo.c,[]),n.Gb(1073742336,Po.a,Po.a,[]),n.Gb(1073742336,xo.b,xo.b,[]),n.Gb(1073742336,Wo.d,Wo.d,[]),n.Gb(1073742336,Uo.a,Uo.a,[]),n.Gb(1073742336,Ho.c,Ho.c,[]),n.Gb(1073742336,No.b,No.b,[]),n.Gb(1073742336,Jo.b,Jo.b,[]),n.Gb(1073742336,Eo.f,Eo.f,[]),n.Gb(1073742336,Ro.b,Ro.b,[]),n.Gb(1073742336,Oo.a,Oo.a,[]),n.Gb(1073742336,Ce.D,Ce.D,[]),n.Gb(1073742336,jo.c,jo.c,[]),n.Gb(1073742336,qo.b,qo.b,[]),n.Gb(1073742336,Lo.b,Lo.b,[]),n.Gb(1073742336,Ce.o,Ce.o,[]),n.Gb(1073742336,Fo.a,Fo.a,[]),n.Gb(1073742336,Yo.d,Yo.d,[]),n.Gb(1073742336,Bo.a,Bo.a,[]),n.Gb(1073742336,Ko.a,Ko.a,[]),n.Gb(1073742336,Vo.a,Vo.a,[Ee.c]),n.Gb(1073742336,Qo.a,Qo.a,[]),n.Gb(1073742336,Zo.a,Zo.a,[]),n.Gb(1073742336,Xo.a,Xo.a,[]),n.Gb(1073742336,$o.a,$o.a,[]),n.Gb(1073742336,et.a,et.a,[]),n.Gb(1073742336,ot.a,ot.a,[]),n.Gb(1073742336,tt.a,tt.a,[]),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,ze.c,ze.c,[]),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,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,Ct.a,Ct.a,[]),n.Gb(1073742336,It.a,It.a,[]),n.Gb(1073742336,Mt.a,Mt.a,[]),n.Gb(1073742336,At.a,At.a,[]),n.Gb(1073742336,_t.a,_t.a,[]),n.Gb(1073742336,Dt.a,Dt.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,Et.a,Et.a,[]),n.Gb(1073742336,Rt.a,Rt.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.h,Yt.h,[]),n.Gb(1073742336,Bt.b,Bt.b,[]),n.Gb(1073742336,Kt.a,Kt.a,[]),n.Gb(1073742336,Pe.c,Pe.c,[]),n.Gb(1073742336,Vt.c,Vt.c,[]),n.Gb(1073742336,Qt.d,Qt.d,[]),n.Gb(1073742336,Qt.h,Qt.h,[]),n.Gb(1073742336,Qt.b,Qt.b,[]),n.Gb(1073742336,Qt.j,Qt.j,[]),n.Gb(1073742336,Qt.l,Qt.l,[]),n.Gb(1073742336,Qt.p,Qt.p,[]),n.Gb(1073742336,Qt.t,Qt.t,[]),n.Gb(1073742336,Zt.a,Zt.a,[]),n.Gb(1073742336,Xt.a,Xt.a,[]),n.Gb(1073742336,u,u,[]),n.Gb(256,yo.b,{nzAnimate:!0,nzDuration:3e3,nzMaxStack:7,nzPauseOnHover:!0,nzTop:24},[]),n.Gb(256,vo.b,{nzTop:"24px",nzBottom:"24px",nzPlacement:"topRight",nzDuration:4500,nzMaxStack:7,nzPauseOnHover:!0,nzAnimate:!0},[]),n.Gb(256,De.a,Ko.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}]}]]}),[])])}))}}]);