@flexem/utils
TypeScript icon, indicating that this package has built-in type declarations

0.2.4 • Public • Published

公共方法库

npm install @flexem/utils
或者
yarn add @flexem/utils

1、 cookie 相关操作

import { getCookie, setCookie, removeCookie } from '@flexem/utils';

getCookie(cookieName: string, defaultValue = '');
setCookie(domain:string, cookieName: string, value: string, defaultDays = 90); 
removeCookie(domain:string, cookieName: string);

2、exec 执行方法

    import exec from '@flexem/utils/dist/src/exec';

    const [err, currentUser] = await exec(queryCurrent());
    if (err) {
      removeCookie(AppConfig.domain, AppConsts.accessToken);
      window.location.href = AppConfig.loginUrl;
    } else {
      return currentUser;
    }

3、生成16位guid

    import { GuidGenerator } from '@flexem/utils';

    GuidGenerator.newGuid()

Readme

Keywords

Package Sidebar

Install

npm i @flexem/utils

Weekly Downloads

0

Version

0.2.4

License

UTILS

Unpacked Size

21.2 kB

Total Files

27

Last publish

Collaborators

  • flexem-npm
  • flexemdev
  • yoli799480165
  • songkaige
  • wwbgo
  • alecliu