@hzab/data-model
Advanced tools
Comparing version 0.1.2 to 0.2.0
{ | ||
"name": "@hzab/data-model", | ||
"version": "0.1.2", | ||
"version": "0.2.0", | ||
"description": "data model", | ||
@@ -5,0 +5,0 @@ "main": "src", |
@@ -12,3 +12,12 @@ # @hzab/data-model | ||
```jsx | ||
import DataModel from "@hzab/data-model"; | ||
import DataModel, { | ||
// 设置 token 到 localStorage 及 cookie,可以设置 opt.hasCookie(setToken(token, { hasCookie: false })) 关闭设置 token 到 cookie 上 | ||
setToken, | ||
// 从 cookie 或 localStorage 获取 token | ||
getToken, | ||
// 设置默认兜底的错误信息 | ||
setDefaultErrMsg, | ||
// 设置 DataModel 中默认的 axios | ||
setDefaultAxios, | ||
} from "@hzab/data-model"; | ||
@@ -15,0 +24,0 @@ const listDM = new DataModel({ |
@@ -6,2 +6,3 @@ import axios from "./axios"; | ||
export * from "./data-model"; | ||
export * from "./hooks"; | ||
@@ -8,0 +9,0 @@ export { axios, DataModel }; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16245
6
435
130