@zbanx/umi-plugin-cookies
v1.1.1
Published
set default cookie in umi
Downloads
12
Keywords
Readme
@zbanx/umi-plugin-cookies
@zbanx/umi-plugin-cookies.
Install
Using npm:
$ npm install --save-dev @zbanx/umi-plugin-cookies
or using yarn:
$ yarn add @zbanx/umi-plugin-cookies --dev
配置
可配置项
export default {
cookies: {
// 跳过的域名列表
skipDomains: ['local.tbanx.cn'],
// 自动设置 Cookie: testKey=testValue
testKey: 'testValue',
},
}
或者在 .umirc.ts 里配置:
export default defineConfig({
nodeModulesTransform: {
type: 'none',
},
routes: [
{ path: '/', component: '@/pages/index' },
],
fastRefresh: {},
cookies: {
skipDomains: ['local.tbanx.cn'],
testKey: 'testValue',
},
});
本地调试
npm link
在项目中调试
需要在项目package.json中添加开发依赖
{
"devDependencies": {
"@zbanx/umi-plugin-cookies": "latest"
}
}
npm link @zbanx/umi-plugin-cookies
npm run dev