@kg-ui/kg-ui-plus 0.0.20 → 0.0.22
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/dist/es/KgCopilot/CopiFooter/SearchInput/SelectPluginByKey.vue.mjs +1 -1
- package/dist/es/KgCopilot/CopiFooter/SearchInput/SelectPluginByKey.vue3.mjs +2 -2
- package/dist/es/KgCopilot/CopiFooter/SearchInput/index.vue.mjs +1 -1
- package/dist/es/KgCopilot/CopiFooter/SearchInput/index.vue2.mjs +6 -6
- package/dist/es/KgCopilot/CopiFooter/SearchInput/index.vue3.mjs +2 -2
- package/dist/es/KgCopilot/dialogue/index.vue.mjs +1 -1
- package/dist/es/KgCopilot/dialogue/index.vue2.mjs +60 -57
- package/dist/es/KgCopilot/dialogue/index.vue3.mjs +2 -2
- package/dist/es/KgCopilot/dialogue/messageParse/edit.vue.mjs +1 -1
- package/dist/es/KgCopilot/dialogue/messageParse/edit.vue2.mjs +1 -1
- package/dist/es/KgCopilot/dialogue/messageParse/edit.vue3.mjs +2 -2
- package/dist/es/KgCopilot/dialogue/messageParse/fileBox.vue.mjs +88 -0
- package/dist/es/KgCopilot/dialogue/messageParse/fileBox.vue2.mjs +4 -0
- package/dist/es/KgCopilot/dialogue/messageParse/fileIcon.vue.mjs +79 -0
- package/dist/es/KgCopilot/dialogue/messageParse/fileIcon.vue2.mjs +4 -0
- package/dist/es/KgCopilot/dialogue/messageParse/index.vue.mjs +1 -1
- package/dist/es/KgCopilot/dialogue/messageParse/index.vue2.mjs +10 -2
- package/dist/es/KgCopilot/dialogue/messageParse/index.vue3.mjs +2 -2
- package/dist/es/KgCopilot/dialogue/messageParse/readMd.vue.mjs +1 -1
- package/dist/es/KgCopilot/dialogue/messageParse/readMd.vue2.mjs +3 -3
- package/dist/es/KgCopilot/dialogue/messageParse/readMd.vue3.mjs +2 -2
- package/dist/es/KgCopilot/index.vue.mjs +1 -1
- package/dist/es/KgCopilot/index.vue2.mjs +20 -16
- package/dist/es/KgCopilot/index.vue3.mjs +2 -2
- package/dist/es/api/copilot.mjs +16 -29
- package/dist/es/node_modules/.pnpm/{dompurify@3.0.10 → dompurify@3.1.0}/node_modules/dompurify/dist/purify.es.mjs +15 -5
- package/dist/es/node_modules/.pnpm/{marked@12.0.1 → marked@12.0.2}/node_modules/marked/lib/marked.esm.mjs +2 -1
- package/dist/es/store/modules/copilot.mjs +148 -68
- package/dist/es/style.css +1 -1
- package/dist/es/utils/home.mjs +19 -1
- package/dist/es/utils/http/index.mjs +1 -2
- package/package.json +1 -1
package/dist/es/utils/home.mjs
CHANGED
@@ -129,10 +129,28 @@ function checkNameValidity(str) {
|
|
129
129
|
const regex = /^(?![0-9!@#$%^&*()_ ]).*/;
|
130
130
|
return !regex.test(str);
|
131
131
|
}
|
132
|
+
const convertBytes = (bytes) => {
|
133
|
+
if (bytes === 0)
|
134
|
+
return "0 Bytes";
|
135
|
+
const sizes = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
|
136
|
+
const i = Math.floor(Math.log(bytes) / Math.log(1024));
|
137
|
+
return parseFloat((bytes / Math.pow(1024, i)).toFixed(2)) + " " + sizes[i];
|
138
|
+
};
|
139
|
+
const urlDownload = (url, fileName = "下载文件") => {
|
140
|
+
const eleLink = document.createElement("a");
|
141
|
+
eleLink.download = fileName;
|
142
|
+
eleLink.style.display = "none";
|
143
|
+
eleLink.href = url;
|
144
|
+
document.body.appendChild(eleLink);
|
145
|
+
eleLink.click();
|
146
|
+
document.body.removeChild(eleLink);
|
147
|
+
};
|
132
148
|
export {
|
133
149
|
checkFilterShow,
|
134
150
|
checkFilterShow_letter,
|
135
151
|
checkFilterShow_xinyuan,
|
152
|
+
convertBytes,
|
136
153
|
filterPluginByPinyin,
|
137
|
-
getFilterRemark
|
154
|
+
getFilterRemark,
|
155
|
+
urlDownload
|
138
156
|
};
|
@@ -7,7 +7,7 @@ var __publicField = (obj, key, value) => {
|
|
7
7
|
import Axios from "axios";
|
8
8
|
import lib from "../../node_modules/.pnpm/qs@6.11.0/node_modules/qs/lib/index.mjs";
|
9
9
|
const defaultConfig = {
|
10
|
-
timeout:
|
10
|
+
timeout: 5 * 60 * 1e3,
|
11
11
|
headers: {
|
12
12
|
Accept: "application/json, text/plain, */*",
|
13
13
|
"Content-Type": "application/json",
|
@@ -27,7 +27,6 @@ const _PureHttp = class {
|
|
27
27
|
httpInterceptorsRequest() {
|
28
28
|
_PureHttp.axiosInstance.interceptors.request.use(
|
29
29
|
async (config) => {
|
30
|
-
config.headers["accessToken"] = window["kg_token"];
|
31
30
|
const source = Axios.CancelToken.source();
|
32
31
|
_PureHttp.requestMap[config.url] = source;
|
33
32
|
config.cancelToken = source.token;
|