aq-fe-framework 0.1.200 → 0.1.202
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.
@@ -1,7 +1,7 @@
|
|
1
1
|
import {
|
2
2
|
baseAxios_default,
|
3
3
|
useQ_AQ_GetAQModule
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-QR4NSLBN.mjs";
|
5
5
|
import {
|
6
6
|
createGenericStore
|
7
7
|
} from "./chunk-Y3YGC5IH.mjs";
|
@@ -7068,6 +7068,11 @@ function BasicAppShell({ children, menu, extraTopRight, title }) {
|
|
7068
7068
|
};
|
7069
7069
|
}
|
7070
7070
|
}, [GetAQModule_query.data]);
|
7071
|
+
useEffect9(() => {
|
7072
|
+
const data = GetAQModule_query.data;
|
7073
|
+
if (!data) return;
|
7074
|
+
document.title = data.name || "";
|
7075
|
+
}, [GetAQModule_query.data]);
|
7071
7076
|
return /* @__PURE__ */ jsxs27(
|
7072
7077
|
AppShell,
|
7073
7078
|
{
|
@@ -3,23 +3,37 @@ import { useQueryClient } from "@tanstack/react-query";
|
|
3
3
|
|
4
4
|
// src/api/baseAxios.ts
|
5
5
|
import axios from "axios";
|
6
|
-
var baseAxios = axios.create(
|
7
|
-
|
8
|
-
|
6
|
+
var baseAxios = axios.create();
|
7
|
+
(async function loadConfig() {
|
8
|
+
try {
|
9
|
+
const response = await fetch("/config.json");
|
10
|
+
if (response.ok) {
|
11
|
+
const data = await response.json();
|
12
|
+
if (data.baseURL) {
|
13
|
+
baseAxios.defaults.baseURL = data.baseURL;
|
14
|
+
console.log("\u2705 baseURL set to:", data.baseURL);
|
15
|
+
} else {
|
16
|
+
console.warn("\u26A0\uFE0F baseURL kh\xF4ng c\xF3 trong config.json");
|
17
|
+
}
|
18
|
+
} else {
|
19
|
+
console.error("\u274C Kh\xF4ng load \u0111\u01B0\u1EE3c config.json");
|
20
|
+
}
|
21
|
+
} catch (error) {
|
22
|
+
console.error("\u274C L\u1ED7i khi t\u1EA3i config.json", error);
|
23
|
+
}
|
24
|
+
})();
|
9
25
|
baseAxios.interceptors.request.use(
|
10
26
|
(config) => {
|
11
27
|
var _a, _b;
|
12
28
|
const tokenData = localStorage.getItem("useS_authenticate");
|
13
|
-
const state = JSON.parse(tokenData);
|
29
|
+
const state = tokenData ? JSON.parse(tokenData) : null;
|
14
30
|
const token = (_b = (_a = state == null ? void 0 : state.state) == null ? void 0 : _a.state) == null ? void 0 : _b.token;
|
15
31
|
if (token) {
|
16
32
|
config.headers.Authorization = `Bearer ${token}`;
|
17
33
|
}
|
18
34
|
return config;
|
19
35
|
},
|
20
|
-
(error) =>
|
21
|
-
return Promise.reject(error);
|
22
|
-
}
|
36
|
+
(error) => Promise.reject(error)
|
23
37
|
);
|
24
38
|
var baseAxios_default = baseAxios;
|
25
39
|
|
@@ -66,8 +66,8 @@ import {
|
|
66
66
|
useS_BasicAppShell,
|
67
67
|
useS_ButtonImport,
|
68
68
|
utils_layout_getItemsWithoutLinks
|
69
|
-
} from "../chunk-
|
70
|
-
import "../chunk-
|
69
|
+
} from "../chunk-KTGRWET4.mjs";
|
70
|
+
import "../chunk-QR4NSLBN.mjs";
|
71
71
|
import "../chunk-Y3YGC5IH.mjs";
|
72
72
|
import "../chunk-5U2JSHSJ.mjs";
|
73
73
|
import "../chunk-7ZCOFATU.mjs";
|
package/dist/hooks/index.mjs
CHANGED
@@ -25,12 +25,12 @@ import {
|
|
25
25
|
useS_BasicAppShell,
|
26
26
|
useS_authenticate,
|
27
27
|
utils_layout_getItemsWithoutLinks
|
28
|
-
} from "../chunk-
|
28
|
+
} from "../chunk-KTGRWET4.mjs";
|
29
29
|
import {
|
30
30
|
baseAxios_default,
|
31
31
|
useQ_AQ_GetAQModule,
|
32
32
|
useQ_SkillCenter_GetAll
|
33
|
-
} from "../chunk-
|
33
|
+
} from "../chunk-QR4NSLBN.mjs";
|
34
34
|
import {
|
35
35
|
createGenericStore
|
36
36
|
} from "../chunk-Y3YGC5IH.mjs";
|