@winchsa/ui 0.1.19 → 0.1.21

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.
@@ -13,12 +13,12 @@ const clientInstance = _ofetch.ofetch.create({
13
13
  async function apiRequest(method, path, options) {
14
14
  const baseUrl = process.env.VITE_BASE_API;
15
15
  const prefix = process.env.VITE_APP_TYPE;
16
+ const token = localStorage.getItem("token");
16
17
  const {
17
18
  ignoreUrlPrefix,
18
19
  headers,
19
20
  ...restOptions
20
21
  } = options || {};
21
- const token = localStorage.getItem("token");
22
22
  return clientInstance(path, {
23
23
  method,
24
24
  baseURL: ignoreUrlPrefix ? baseUrl : `${baseUrl}/${prefix}`,
@@ -26,7 +26,7 @@ async function apiRequest(method, path, options) {
26
26
  headers: {
27
27
  "Accept": "application/json",
28
28
  "X-Requested-With": "XMLHttpRequest",
29
- "Accept-Language": localStorage.getItem("token"),
29
+ "Accept-Language": localStorage.getItem("winch-lang"),
30
30
  "User-Platform": "web",
31
31
  ...(token && {
32
32
  Authorization: `Bearer ${token}`
@@ -5,8 +5,8 @@ const clientInstance = ofetch.create({ credentials: "include" });
5
5
  async function apiRequest(method, path, options) {
6
6
  const baseUrl = import.meta.env.VITE_BASE_API;
7
7
  const prefix = import.meta.env.VITE_APP_TYPE;
8
- const { ignoreUrlPrefix, headers, ...restOptions } = options || {};
9
8
  const token = localStorage.getItem("token");
9
+ const { ignoreUrlPrefix, headers, ...restOptions } = options || {};
10
10
  return clientInstance(path, {
11
11
  method,
12
12
  baseURL: ignoreUrlPrefix ? baseUrl : `${baseUrl}/${prefix}`,
@@ -14,7 +14,7 @@ async function apiRequest(method, path, options) {
14
14
  headers: {
15
15
  "Accept": "application/json",
16
16
  "X-Requested-With": "XMLHttpRequest",
17
- "Accept-Language": localStorage.getItem("token"),
17
+ "Accept-Language": localStorage.getItem("winch-lang"),
18
18
  "User-Platform": "web",
19
19
  ...token && { Authorization: `Bearer ${token}` },
20
20
  ...headers
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@winchsa/ui",
3
- "version": "0.1.19",
3
+ "version": "0.1.21",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "publishConfig": {