Skip to content

Commit

Permalink
fix(util:cookie): fix wrong set value of remove (#1479)
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk committed May 13, 2022
1 parent 2e250e4 commit 66a4eb2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/util/browser/cookie.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe('Util: CookieService', () => {

it('remove', () => {
srv.remove(KEY);
expect(srv.get(KEY)).toContain(``);
expect(srv.get(KEY)).toBe(``);
});

it('removeAll', () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/util/browser/cookie.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class CookieService {
*
* 设置指定 Cookie 键的值
*/
put(key: string, value: string | undefined, options?: CookieOptions): void {
put(key: string, value: string, options?: CookieOptions): void {
if (!this.platform.isBrowser) {
return;
}
Expand All @@ -102,7 +102,7 @@ export class CookieService {
* 移除指定 Cookie
*/
remove(key: string, options?: CookieOptions): void {
this.put(key, undefined, options);
this.put(key, '', options);
}

/**
Expand Down

0 comments on commit 66a4eb2

Please sign in to comment.