@jetlinks-web/core 2.1.5 → 2.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +3 -3
  2. package/src/axios.ts +3 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetlinks-web/core",
3
- "version": "2.1.5",
3
+ "version": "2.1.7",
4
4
  "main": "index.ts",
5
5
  "module": "index.ts",
6
6
  "keywords": [
@@ -21,9 +21,9 @@
21
21
  "dependencies": {
22
22
  "axios": "^1.7.4",
23
23
  "rxjs": "^7.8.1",
24
+ "@jetlinks-web/types": "^1.0.2",
24
25
  "@jetlinks-web/constants": "^1.0.9",
25
- "@jetlinks-web/utils": "^1.2.8",
26
- "@jetlinks-web/types": "^1.0.2"
26
+ "@jetlinks-web/utils": "^1.2.8"
27
27
  },
28
28
  "publishConfig": {
29
29
  "registry": "https://registry.npmjs.org/",
package/src/axios.ts CHANGED
@@ -66,15 +66,15 @@ const controller = new AbortController();
66
66
  const handleRequest = (config: InternalAxiosRequestConfig) => {
67
67
  const token = getToken()
68
68
  const lang = localStorage.getItem(_options.langKey)
69
- const env = localStorage.getItem(LOCAL_BASE_API)
69
+ const localBaseApi = localStorage.getItem(LOCAL_BASE_API)
70
70
 
71
71
  if (lang) {
72
72
  config.headers[_options.langKey] = lang
73
73
  }
74
74
 
75
- if (!config.url.startsWith(env)) {
75
+ if (localBaseApi && !config.baseURL) {
76
76
  const _url = config.url.startsWith('/') ? config.url : `/${config.url}`
77
- config.url = env + _url
77
+ config.url = localBaseApi + _url
78
78
  }
79
79
 
80
80
  // 没有token,并且该接口需要token校验