{"_id":"@polyv/request-plugin-authorize-token","_rev":"32-7ea1bc3b231c54776ce0616f0057c29d","name":"@polyv/request-plugin-authorize-token","dist-tags":{"temp":"2.8.1","latest":"2.8.1","v2-latest":"2.8.1"},"versions":{"2.0.0":{"name":"@polyv/request-plugin-authorize-token","version":"2.0.0","_id":"@polyv/request-plugin-authorize-token@2.0.0","maintainers":[{"name":"easefun","email":"polyv@qq.com"},{"name":"heeroluo","email":"heeroluo@126.com"},{"name":"easefun-ci","email":"polyv@163.com"}],"dist":{"shasum":"db4c22e044e13e94986c615a5e0c24bc66080362","tarball":"https://registry.npmjs.org/@polyv/request-plugin-authorize-token/-/request-plugin-authorize-token-2.0.0.tgz","fileCount":12,"integrity":"sha512-XK/6c1zS0g9WeGnmQe6Hme9/Jr0HAivuZcWGMQwqWXuON3WpPAB8yNnj9ziDKM2GwZHsXf09XmBIW+UzIMYbeA==","signatures":[{"sig":"MEUCIQCvuAZgEDB+5nFxHvX24dXnopqfnru1viDxEvh84diFiQIgfDA7onzeFljCbuU8XJGf5TL/+X0uuwqc/oc7W91/3ME=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9646},"main":"./index.js","types":"./index.d.ts","_npmUser":{"name":"easefun-ci","actor":{"name":"easefun-ci","type":"user","email":"polyv@163.com"},"email":"polyv@163.com"},"_npmVersion":"8.5.0","description":"用途：请求令牌插件，使用后会在所有请求中插入令牌信息。","directories":{},"_nodeVersion":"16.14.2","dependencies":{"@polyv/request-core":"2.0.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/request-plugin-authorize-token_2.0.0_1751449731689_0.7946803934137134","host":"s3://npm-registry-packages-npm-production"}},"2.1.0":{"name":"@polyv/request-plugin-authorize-token","version":"2.1.0","_id":"@polyv/request-plugin-authorize-token@2.1.0","maintainers":[{"name":"easefun","email":"polyv@qq.com"},{"name":"heeroluo","email":"heeroluo@126.com"},{"name":"easefun-ci","email":"polyv@163.com"}],"dist":{"shasum":"340219d8c305aac9606ca6f4809fa7c81889f864","tarball":"https://registry.npmjs.org/@polyv/request-plugin-authorize-token/-/request-plugin-authorize-token-2.1.0.tgz","fileCount":12,"integrity":"sha512-zXA7ybu9ViZpVrw0ie6WhETueew2AZNiwCg+Sq7oWyxMiL5O6xSuOKqfbGJuBZ7aH8r8VLDJ3FVx8oLzOI/3PA==","signatures":[{"sig":"MEUCIQCrne6tNDnnWy5ozFSaGvlVT7rklfV/5xMo9jXhqDg4CwIgfa906Kj2ZtqlXxjon4w1rI+v0jx0DOG7AtE9W0xrw8E=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9646},"main":"./index.js","types":"./index.d.ts","_npmUser":{"name":"easefun-ci","email":"polyv@163.com"},"_npmVersion":"8.5.0","description":"用途：请求令牌插件，使用后会在所有请求中插入令牌信息。","directories":{},"_nodeVersion":"16.14.2","dependencies":{"@polyv/request-core":"2.1.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/request-plugin-authorize-token_2.1.0_1755136230233_0.10275359628187819","host":"s3://npm-registry-packages-npm-production"}},"2.2.0":{"name":"@polyv/request-plugin-authorize-token","version":"2.2.0","_id":"@polyv/request-plugin-authorize-token@2.2.0","maintainers":[{"name":"easefun","email":"polyv@qq.com"},{"name":"heeroluo","email":"heeroluo@126.com"},{"name":"easefun-ci","email":"polyv@163.com"}],"dist":{"shasum":"9eace7ee2fddcb57d11f712cb3f6bbf540968952","tarball":"https://registry.npmjs.org/@polyv/request-plugin-authorize-token/-/request-plugin-authorize-token-2.2.0.tgz","fileCount":12,"integrity":"sha512-avAGUij8sLTporlAw8FzSDmkTFX67xG7c3W/xlaB3ouTXRX03G7151uVJ3ppCDrtuVNGgpwualDw8DG9jWcOig==","signatures":[{"sig":"MEYCIQDxJyfp2OaeLgHFJzfjC1gN4+ZKhTNjIVQ7/Twh4tbGPwIhAJaoqQ8jmzg7cpoCw4xKhlAu3ewpRVMykG1zPXwVhALS","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9646},"main":"./index.js","types":"./index.d.ts","_npmUser":{"name":"easefun-ci","email":"polyv@163.com"},"_npmVersion":"8.5.0","description":"用途：请求令牌插件，使用后会在所有请求中插入令牌信息。","directories":{},"_nodeVersion":"16.14.2","dependencies":{"@polyv/request-core":"2.2.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/request-plugin-authorize-token_2.2.0_1756948055243_0.07407343740676597","host":"s3://npm-registry-packages-npm-production"}},"2.3.0":{"name":"@polyv/request-plugin-authorize-token","version":"2.3.0","_id":"@polyv/request-plugin-authorize-token@2.3.0","maintainers":[{"name":"easefun","email":"polyv@qq.com"},{"name":"heeroluo","email":"heeroluo@126.com"},{"name":"easefun-ci","email":"polyv@163.com"}],"dist":{"shasum":"d2578d39c8118db7b31aded1ef0183d62f0e76df","tarball":"https://registry.npmjs.org/@polyv/request-plugin-authorize-token/-/request-plugin-authorize-token-2.3.0.tgz","fileCount":12,"integrity":"sha512-EU3Ygk+OYUIzzynhTdcXcvhVFq0ISeXYBDD31QI3VIok6U3CTFGXA5eogY+rDCMqoQfz591a+4OTWA41M8l0Gg==","signatures":[{"sig":"MEYCIQCI3yiW37NYz2a3LjHHzE+24fB0ukNk653yWp3Cl/xOigIhALCkq9zQ6UBQ2NZNJx3b9RY6x3nVDQZBkq1y9ozRlPGc","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9646},"main":"./index.js","types":"./index.d.ts","_npmUser":{"name":"easefun-ci","email":"polyv@163.com"},"_npmVersion":"8.5.0","description":"用途：请求令牌插件，使用后会在所有请求中插入令牌信息。","directories":{},"_nodeVersion":"16.14.2","dependencies":{"@polyv/request-core":"2.3.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/request-plugin-authorize-token_2.3.0_1761040174695_0.0319629601661795","host":"s3://npm-registry-packages-npm-production"}},"2.4.0":{"name":"@polyv/request-plugin-authorize-token","version":"2.4.0","_id":"@polyv/request-plugin-authorize-token@2.4.0","maintainers":[{"name":"easefun","email":"polyv@qq.com"},{"name":"heeroluo","email":"heeroluo@126.com"},{"name":"easefun-ci","email":"polyv@163.com"}],"dist":{"shasum":"0133bfe3efb0e4133978e9a3cd7703aaae9c0947","tarball":"https://registry.npmjs.org/@polyv/request-plugin-authorize-token/-/request-plugin-authorize-token-2.4.0.tgz","fileCount":12,"integrity":"sha512-n57b1uNg1nt0afEh/KbjUzL0s2bjSBxX7oZkIIiH/9G0AOYdWtPuJyD2oPl9YhVl1+ZCbjUSV6DtIKIoHl9viQ==","signatures":[{"sig":"MEQCICKGUH1nZLDdOVqc3KqNzNt9nYdFW6sawUpyvzNRCsUtAiB+bctHIJppA0YUYDUrAI6RZ6Fyc52qfjalKKiEPmk7uQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9646},"main":"./index.js","types":"./index.d.ts","_npmUser":{"name":"easefun-ci","email":"polyv@163.com"},"_npmVersion":"8.5.0","description":"用途：请求令牌插件，使用后会在所有请求中插入令牌信息。","directories":{},"_nodeVersion":"16.14.2","dependencies":{"@polyv/request-core":"2.4.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/request-plugin-authorize-token_2.4.0_1773197371479_0.17893916287843248","host":"s3://npm-registry-packages-npm-production"}},"2.5.0":{"name":"@polyv/request-plugin-authorize-token","version":"2.5.0","_id":"@polyv/request-plugin-authorize-token@2.5.0","maintainers":[{"name":"easefun","email":"polyv@qq.com"},{"name":"easefun-ci","email":"polyv@163.com"},{"name":"junyu8893","email":"852711368@qq.com"}],"dist":{"shasum":"47ffaebfbe6dc65bd2dffe145bb3f3699ee0048a","tarball":"https://registry.npmjs.org/@polyv/request-plugin-authorize-token/-/request-plugin-authorize-token-2.5.0.tgz","fileCount":12,"integrity":"sha512-DEuLWWzQqIURRtoUU+k+wZpB7jqxQ72gOgWIKYMn/Ht30Qz7lgkmQKTXVDOlrPSU8N4iugS9H/pYnNFemKaPOA==","signatures":[{"sig":"MEUCIQDSLJChcfIPHSAq+E2Eim0RImbIrL21RJih4IKZCBTfogIgUxMjhp57ejNNnKPbQ5kOMNjWpibsjM9lUbTw9ALydUY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9646},"main":"./index.js","types":"./index.d.ts","_npmUser":{"name":"easefun-ci","email":"polyv@163.com"},"_npmVersion":"8.5.0","description":"用途：请求令牌插件，使用后会在所有请求中插入令牌信息。","directories":{},"_nodeVersion":"16.14.2","dependencies":{"@polyv/request-core":"2.5.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/request-plugin-authorize-token_2.5.0_1778721444207_0.9451512794501598","host":"s3://npm-registry-packages-npm-production"}},"2.6.0":{"name":"@polyv/request-plugin-authorize-token","version":"2.6.0","_id":"@polyv/request-plugin-authorize-token@2.6.0","maintainers":[{"name":"easefun","email":"polyv@qq.com"},{"name":"easefun-ci","email":"polyv@163.com"},{"name":"junyu8893","email":"852711368@qq.com"}],"dist":{"shasum":"ba908269eb64c82359630094c41713e5244d15ec","tarball":"https://registry.npmjs.org/@polyv/request-plugin-authorize-token/-/request-plugin-authorize-token-2.6.0.tgz","fileCount":12,"integrity":"sha512-EhqpxLchq8CZyN2W2O8ST4OjaJkJilJSl4viPGFklE9++OTGccJx0bh8e9sHaXbyvIa8Q6WNqzH3GHLy4EXwgQ==","signatures":[{"sig":"MEQCIGd4SQolms+qoKl3zVlbJ7xLWIsuyMFgUOlq63oACLt8AiBl4O9eD0FRPbxXIS3jnJrM/hEd34iKnj4ATMaMMgbozg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9646},"main":"./index.js","types":"./index.d.ts","_npmUser":{"name":"easefun-ci","email":"polyv@163.com"},"_npmVersion":"8.5.0","description":"用途：请求令牌插件，使用后会在所有请求中插入令牌信息。","directories":{},"_nodeVersion":"16.14.2","dependencies":{"@polyv/request-core":"2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/request-plugin-authorize-token_2.6.0_1780554113302_0.7130249207553856","host":"s3://npm-registry-packages-npm-production"}},"2.7.0":{"name":"@polyv/request-plugin-authorize-token","version":"2.7.0","_id":"@polyv/request-plugin-authorize-token@2.7.0","maintainers":[{"name":"easefun","email":"polyv@qq.com"},{"name":"easefun-ci","email":"polyv@163.com"},{"name":"junyu8893","email":"852711368@qq.com"}],"dist":{"shasum":"f37ad062aa8e25007bcd31b1981f97e31300d9e4","tarball":"https://registry.npmjs.org/@polyv/request-plugin-authorize-token/-/request-plugin-authorize-token-2.7.0.tgz","fileCount":12,"integrity":"sha512-a82pFGLG+jfoF3LX/bZ+1bE/TSMCokGkglWdxBUVDTxgYFm+nM4wUTTKF0qONqhATCut7apW1GgvxS3J4ptBFQ==","signatures":[{"sig":"MEYCIQC7QpPFxpfkLQ+RYri8eufmIGclFDQ2zXhycbQ/VhIItwIhAJtcthSkjq7fIBPJj5LBXa8/vTRaAdbhp58i9+1XYqUo","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9646},"main":"./index.js","types":"./index.d.ts","_npmUser":{"name":"easefun-ci","email":"polyv@163.com"},"_npmVersion":"8.5.0","description":"用途：请求令牌插件，使用后会在所有请求中插入令牌信息。","directories":{},"_nodeVersion":"16.14.2","dependencies":{"@polyv/request-core":"2.7.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/request-plugin-authorize-token_2.7.0_1780997154478_0.7683616183865984","host":"s3://npm-registry-packages-npm-production"}},"2.7.1":{"name":"@polyv/request-plugin-authorize-token","version":"2.7.1","_id":"@polyv/request-plugin-authorize-token@2.7.1","maintainers":[{"name":"easefun","email":"polyv@qq.com"},{"name":"easefun-ci","email":"polyv@163.com"},{"name":"junyu8893","email":"852711368@qq.com"}],"dist":{"shasum":"6507d6e32cabff51ba195d8ce848beb189348eaa","tarball":"https://registry.npmjs.org/@polyv/request-plugin-authorize-token/-/request-plugin-authorize-token-2.7.1.tgz","fileCount":12,"integrity":"sha512-rnQlbt5t7Nu092YTvTrVQfczHWs+ZWA7YfdlGE+v8YXcY5/Et6fc2rpseVl3+IpCpCEN73hBhwb6tVJRTn6m7w==","signatures":[{"sig":"MEQCIEMDxNXO3xjOqFFaW4FgjPCUAh1XEWpMdp5OIjpG9Mn3AiBS22KL4Nt+pCw2XN9Jcr3ZyIsDPLltANKQDjZD0yZohw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9646},"main":"./index.js","types":"./index.d.ts","_npmUser":{"name":"easefun-ci","email":"polyv@163.com"},"_npmVersion":"8.5.0","description":"用途：请求令牌插件，使用后会在所有请求中插入令牌信息。","directories":{},"_nodeVersion":"16.14.2","dependencies":{"@polyv/request-core":"2.7.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/request-plugin-authorize-token_2.7.1_1781000652221_0.6107081016862741","host":"s3://npm-registry-packages-npm-production"}},"2.8.0":{"name":"@polyv/request-plugin-authorize-token","version":"2.8.0","_id":"@polyv/request-plugin-authorize-token@2.8.0","maintainers":[{"name":"easefun","email":"polyv@qq.com"},{"name":"easefun-ci","email":"polyv@163.com"},{"name":"junyu8893","email":"852711368@qq.com"}],"dist":{"shasum":"3d7cccfdbcfa8393b8931f924b6cf18a1d27ab6e","tarball":"https://registry.npmjs.org/@polyv/request-plugin-authorize-token/-/request-plugin-authorize-token-2.8.0.tgz","fileCount":12,"integrity":"sha512-IEXJCG2DlIunI7DjywN4vOea3XGvW6+jdCh4EkH7lt+NcoO5B2NdKoeE/ZFSWYKf6O4qb4UxRT9jezUUbO9vag==","signatures":[{"sig":"MEQCIBD77JXhnEIQ33OVJDCxs/z7CLbGXkjX7AWAz+R+eapFAiBlK5uOwm7bqU9TenX16Zs7sC+fhSFMzaKOIzaqKwe05w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":10326},"main":"./index.js","type":"module","types":"./index.d.ts","gitHead":"13b8b598b2d8ecb151f2f6c7cf4ecab6671c1965","_npmUser":{"name":"easefun-ci","email":"polyv@163.com"},"_npmVersion":"10.8.2","description":"用途：请求令牌插件，使用后会在所有请求中插入令牌信息。","directories":{},"miniprogram":"./","_nodeVersion":"20.20.2","dependencies":{"@polyv/request-core":"2.8.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/request-plugin-authorize-token_2.8.0_1783071932070_0.08341093189878968","host":"s3://npm-registry-packages-npm-production"}},"2.8.1":{"_id":"@polyv/request-plugin-authorize-token@2.8.1","dist":{"shasum":"390389d1100dab294ec238f8b9b5373cedff28de","tarball":"https://registry.npmjs.org/@polyv/request-plugin-authorize-token/-/request-plugin-authorize-token-2.8.1.tgz","fileCount":12,"integrity":"sha512-GaxGg1VxdldY0TVWwnxkc4JleQWJthvEIuLuiacKvQxw49LftOzpkg7/gNQvmuqd1Wfox/GzAPskvDQa3YPjvg==","signatures":[{"sig":"MEYCIQDzMNxHMEBiVfD/aFvVn7pvVOfrTUJzgt1ytsuW8oSOzAIhAOjbPlMrz3O2nol2ihFX5+iuvRwLlNdc8CTdjeuG6GR4","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIAtBzm6VQ4CrYy0KPo6yhK/PkhZIu8nqSPIiqvO5t6LPAiEAiZF2FVHXfGscKiQYb8QBVQ0RmewHHeQgUyaDTwCIbpc="}],"unpackedSize":10326},"main":"./index.js","name":"@polyv/request-plugin-authorize-token","type":"module","types":"./index.d.ts","gitHead":"7d3597a4b7101140a3061be5129d97ede5f055d4","version":"2.8.1","_npmUser":{"name":"easefun-ci","email":"polyv@163.com"},"_npmVersion":"10.8.2","description":"用途：请求令牌插件，使用后会在所有请求中插入令牌信息。","directories":{},"maintainers":[{"name":"easefun","email":"polyv@qq.com"},{"name":"easefun-ci","email":"polyv@163.com"},{"name":"junyu8893","email":"852711368@qq.com"}],"miniprogram":"./","_nodeVersion":"20.20.2","dependencies":{"@polyv/request-core":"2.8.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/request-plugin-authorize-token_2.8.1_1789716973298_0.609294563517174"}}},"time":{"created":"2025-07-02T09:48:51.582Z","modified":"2026-09-18T07:36:13.551Z","2.0.0":"2025-07-02T09:48:51.882Z","2.1.0":"2025-08-14T01:50:30.425Z","2.2.0":"2025-09-04T01:07:35.425Z","2.3.0":"2025-10-21T09:49:34.875Z","2.4.0":"2026-03-11T02:49:31.621Z","2.5.0":"2026-05-14T01:17:24.412Z","2.6.0":"2026-06-04T06:21:53.461Z","2.7.0":"2026-06-09T09:25:54.623Z","2.7.1":"2026-06-09T10:24:12.351Z","2.8.0":"2026-07-03T09:45:32.219Z","2.8.1":"2026-09-18T07:36:13.406Z"},"description":"用途：请求令牌插件，使用后会在所有请求中插入令牌信息。","maintainers":[{"name":"easefun","email":"polyv@qq.com"},{"name":"easefun-ci","email":"polyv@163.com"},{"name":"junyu8893","email":"852711368@qq.com"}],"readme":"# AuthorizeTokenRequestPlugin\n\n用途：请求令牌插件，使用后会在所有请求中插入令牌信息。\n\n## 实例化参数\n\n| 参数名                  | 用途                   | 类型       | 默认值 |\n| ----------------------- | ---------------------- | ---------- | ------ |\n| `useToken`              | 默认使用 token 插件    | `boolean`  | `true` |\n| `responseTokenField`    | 在响应中返回的令牌字段 | `string`   | -      |\n| `getTokenInfo`          | 获取授权令牌信息       | `function` | -      |\n| `responseTokenCallback` | 响应中获取令牌后的回调 | `function` | -      |\n\n## 请求选项\n\n| 参数名      | 用途                | 类型        | 默认值 |\n| ----------- | ------------------- | ----------- | ------ |\n| `useToken`  | 是否使用 token 授权 | `boolean`   | `true` |\n| `tokenInfo` | 令牌信息            | `TokenInfo` | -      |\n\n## 令牌信息类型\n\n`TokenInfo` 类型如下：\n\n| 参数名          | 用途                          | 类型        | 默认值             |\n| --------------- | ----------------------------- | ----------- | ------------------ |\n| `token`         | 授权令牌                      | `string`    | -                  |\n| `tokenMode`     | 令牌方式，仅在 request 中生效 | `TokenMode` | `TokenMode.Params` |\n| `tokenField`    | 在请求中插入的令牌字段        | `string`    | `'token'`          |\n| `includeParams` | 插入的 params                 | `object`    | -                  |\n\n## 使用方式\n\n```js\nimport { PolyvRequest } from '@polyv/request-core';\nimport { AuthorizeTokenRequestPlugin, TokenMode } from '@polyv/request-plugin-authorize-token';\n\n// 方式一：直接传入令牌信息\nconst requester = new PolyvRequest({\n  requestPlugins: [\n    new AuthorizeTokenRequestPlugin({\n      token: 'xxxxx',\n      tokenMode: TokenMode.Header,\n      tokenField: 'xAuthToken',\n    }),\n  ],\n});\n\n// 方式二（推荐）：支持传入 getTokenInfo 方法获取，返回 TokenInfo 类型，优先级高于直接传入\nconst requester = new PolyvRequest({\n  requestPlugins: [\n    new AuthorizeTokenRequestPlugin({\n      getTokenInfo: async options => {\n        return {\n          token: 'xxxxx',\n          tokenMode: TokenMode.Header,\n          tokenField: 'xAuthToken',\n          // 额外插入到 params\n          includeParams: {\n            channelId: 'xxx',\n          },\n        };\n      },\n    }),\n  ],\n});\n\n// 方式三：调用时传入 tokenInfo\nrequester.get(\n  '/xxx',\n  {},\n  {\n    tokenInfo: {\n      token: 'xxxxx',\n      tokenMode: TokenMode.Params,\n      tokenField: 'xAuthToken',\n    },\n  },\n);\n\n// 如果你想在某个请求中，不处理令牌操作时\nrequester.get(\n  '/xxxx',\n  {},\n  {\n    useToken: false,\n  },\n);\n```\n\n### TokenMode 区别\n\n- `TokenMode.Params`：通过地址参数入参令牌\n- `TokenMode.Header`：通过请求头插入令牌\n\n### 自动获取响应头中的授权令牌\n\n实例化插件时入参 `responseTokenField`，插件内部会自动获取接口响应中的令牌，并在请求时如果不传入 tokenInfo，则使用响应中的令牌，示例如下：\n\n```js\nconst requester = new PolyvRequest({\n  requestPlugins: [\n    new AuthorizeTokenRequestPlugin({\n      responseTokenField: 'x-auth-token',\n      responseTokenCallback: data => {\n        console.log('从接口响应中获取到的令牌', data.token);\n      },\n    }),\n  ],\n});\n```\n\n此时在每次接口请求后，会从响应头中获取 `x-auth-token` 作为令牌并记录，后续接口中，如果没有入参令牌则以该令牌传入。\n","readmeFilename":"README.md"}