@vunk/form 2.14.6 → 2.14.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.
package/components/index2.cjs
CHANGED
|
@@ -9,5 +9,9 @@ const KeyConfig = {
|
|
|
9
9
|
function getToken() {
|
|
10
10
|
return localStorage.getItem(KeyConfig.TokenKey) || "";
|
|
11
11
|
}
|
|
12
|
+
function getTenant() {
|
|
13
|
+
return localStorage.getItem(KeyConfig.TenantKey) || "";
|
|
14
|
+
}
|
|
12
15
|
|
|
16
|
+
exports.getTenant = getTenant;
|
|
13
17
|
exports.getToken = getToken;
|
package/components/index2.mjs
CHANGED
|
@@ -7,5 +7,8 @@ const KeyConfig = {
|
|
|
7
7
|
function getToken() {
|
|
8
8
|
return localStorage.getItem(KeyConfig.TokenKey) || "";
|
|
9
9
|
}
|
|
10
|
+
function getTenant() {
|
|
11
|
+
return localStorage.getItem(KeyConfig.TenantKey) || "";
|
|
12
|
+
}
|
|
10
13
|
|
|
11
|
-
export { getToken as g };
|
|
14
|
+
export { getTenant as a, getToken as g };
|
|
@@ -18142,6 +18142,10 @@ const verify = async (data) => {
|
|
|
18142
18142
|
data,
|
|
18143
18143
|
setRequestInit(config) {
|
|
18144
18144
|
setDefaultHeader(config);
|
|
18145
|
+
if (index.getTenant()) {
|
|
18146
|
+
const headers = config.headers;
|
|
18147
|
+
headers.set("Tenant", index.getTenant());
|
|
18148
|
+
}
|
|
18145
18149
|
return config;
|
|
18146
18150
|
}
|
|
18147
18151
|
}).then((res) => {
|
|
@@ -18162,7 +18166,7 @@ const upload = async (data, fileServiceType, init) => {
|
|
|
18162
18166
|
const xhr = new XMLHttpRequest();
|
|
18163
18167
|
xhr.upload.onprogress = init?.onprogress || null;
|
|
18164
18168
|
xhr.open("post", restFetch.baseURL + "/file/chunk/upload");
|
|
18165
|
-
xhr.setRequestHeader("Tenant", "default");
|
|
18169
|
+
xhr.setRequestHeader("Tenant", index.getTenant() || "default");
|
|
18166
18170
|
xhr.setRequestHeader("Application", "platform");
|
|
18167
18171
|
xhr.setRequestHeader("Token", index.getToken());
|
|
18168
18172
|
const form = new FormData();
|
|
@@ -18210,7 +18214,14 @@ const merge = async (data) => {
|
|
|
18210
18214
|
method: "POST",
|
|
18211
18215
|
url: "/file/chunk/merge",
|
|
18212
18216
|
data,
|
|
18213
|
-
setRequestInit:
|
|
18217
|
+
setRequestInit: (config) => {
|
|
18218
|
+
setDefaultHeader(config);
|
|
18219
|
+
if (index.getTenant()) {
|
|
18220
|
+
const headers = config.headers;
|
|
18221
|
+
headers.set("Tenant", index.getTenant());
|
|
18222
|
+
}
|
|
18223
|
+
return config;
|
|
18224
|
+
}
|
|
18214
18225
|
}).then((res) => {
|
|
18215
18226
|
if (res.code !== 200) {
|
|
18216
18227
|
throw new Error(res.message);
|
|
@@ -5,7 +5,7 @@ import { createFileChunk, calculateFileHashSample } from '@vunk/form/shared/uplo
|
|
|
5
5
|
import { RestFetch } from '@vunk/core/shared/utils-fetch';
|
|
6
6
|
import '@vunk/core/shared/utils-promise';
|
|
7
7
|
import { isPlainObject as isPlainObject$1 } from '@vunk/core/shared/utils-object';
|
|
8
|
-
import { g as getToken } from '../index2.mjs';
|
|
8
|
+
import { g as getToken, a as getTenant } from '../index2.mjs';
|
|
9
9
|
import { restFetch as restFetch$1 } from '@skzz/platform/shared/fetch/platform';
|
|
10
10
|
import { l as success_filled_default, c as circle_close_filled_default, n as upload_filled_default } from '../index.mjs';
|
|
11
11
|
import { useModelComputed } from '@vunk/core/composables';
|
|
@@ -18138,6 +18138,10 @@ const verify = async (data) => {
|
|
|
18138
18138
|
data,
|
|
18139
18139
|
setRequestInit(config) {
|
|
18140
18140
|
setDefaultHeader(config);
|
|
18141
|
+
if (getTenant()) {
|
|
18142
|
+
const headers = config.headers;
|
|
18143
|
+
headers.set("Tenant", getTenant());
|
|
18144
|
+
}
|
|
18141
18145
|
return config;
|
|
18142
18146
|
}
|
|
18143
18147
|
}).then((res) => {
|
|
@@ -18158,7 +18162,7 @@ const upload = async (data, fileServiceType, init) => {
|
|
|
18158
18162
|
const xhr = new XMLHttpRequest();
|
|
18159
18163
|
xhr.upload.onprogress = init?.onprogress || null;
|
|
18160
18164
|
xhr.open("post", restFetch.baseURL + "/file/chunk/upload");
|
|
18161
|
-
xhr.setRequestHeader("Tenant", "default");
|
|
18165
|
+
xhr.setRequestHeader("Tenant", getTenant() || "default");
|
|
18162
18166
|
xhr.setRequestHeader("Application", "platform");
|
|
18163
18167
|
xhr.setRequestHeader("Token", getToken());
|
|
18164
18168
|
const form = new FormData();
|
|
@@ -18206,7 +18210,14 @@ const merge = async (data) => {
|
|
|
18206
18210
|
method: "POST",
|
|
18207
18211
|
url: "/file/chunk/merge",
|
|
18208
18212
|
data,
|
|
18209
|
-
setRequestInit:
|
|
18213
|
+
setRequestInit: (config) => {
|
|
18214
|
+
setDefaultHeader(config);
|
|
18215
|
+
if (getTenant()) {
|
|
18216
|
+
const headers = config.headers;
|
|
18217
|
+
headers.set("Tenant", getTenant());
|
|
18218
|
+
}
|
|
18219
|
+
return config;
|
|
18220
|
+
}
|
|
18210
18221
|
}).then((res) => {
|
|
18211
18222
|
if (res.code !== 200) {
|
|
18212
18223
|
throw new Error(res.message);
|