mirror of https://github.com/certd/certd
perf: 支持易盾RCDN部署
parent
746d3c97c3
commit
065713cdb6
|
@ -32,6 +32,8 @@ import { nanoid } from 'nanoid';
|
||||||
import * as id from './util.id.js';
|
import * as id from './util.id.js';
|
||||||
import { locker } from './util.lock.js';
|
import { locker } from './util.lock.js';
|
||||||
import { mitter } from './util.mitter.js';
|
import { mitter } from './util.mitter.js';
|
||||||
|
|
||||||
|
import * as request from './util.request.js';
|
||||||
export const utils = {
|
export const utils = {
|
||||||
sleep,
|
sleep,
|
||||||
http,
|
http,
|
||||||
|
@ -52,4 +54,5 @@ export const utils = {
|
||||||
locker,
|
locker,
|
||||||
mitter,
|
mitter,
|
||||||
amount: amountUtils,
|
amount: amountUtils,
|
||||||
|
request,
|
||||||
};
|
};
|
||||||
|
|
|
@ -310,3 +310,14 @@ export async function download(req: { http: HttpClient; config: HttpRequestConfi
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getCookie(response: any, name: string) {
|
||||||
|
const cookies = response.headers['set-cookie'];
|
||||||
|
//根据name 返回对应的cookie
|
||||||
|
const found = cookies.find((cookie: any) => cookie.includes(name));
|
||||||
|
if (!found) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
const cookie = found.split(';')[0];
|
||||||
|
return cookie.substring(cookie.indexOf('=') + 1);
|
||||||
|
}
|
||||||
|
|
|
@ -109,8 +109,8 @@ function createService() {
|
||||||
error.message += `: ${error.response?.config?.url}`;
|
error.message += `: ${error.response?.config?.url}`;
|
||||||
errorLog(error, error?.response?.config?.showErrorNotify);
|
errorLog(error, error?.response?.config?.showErrorNotify);
|
||||||
if (status === 401) {
|
if (status === 401) {
|
||||||
// const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
// userStore.logout();
|
userStore.logout();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (error?.config?.onError) {
|
if (error?.config?.onError) {
|
||||||
|
|
|
@ -18,7 +18,7 @@ async function bootstrap() {
|
||||||
const app = createApp(App);
|
const app = createApp(App);
|
||||||
// app.use(Antd);
|
// app.use(Antd);
|
||||||
app.use(Antd);
|
app.use(Antd);
|
||||||
await setupVben(app, { loadMessages });
|
await setupVben(app, { loadMessages, router });
|
||||||
app.use(router);
|
app.use(router);
|
||||||
// app.use(i18n);
|
// app.use(i18n);
|
||||||
// app.use(store);
|
// app.use(store);
|
||||||
|
|
|
@ -8,6 +8,7 @@ import Avatar from "ant-design-vue/es/avatar";
|
||||||
import Steps from "ant-design-vue/es/steps";
|
import Steps from "ant-design-vue/es/steps";
|
||||||
import Select from "ant-design-vue/es/select";
|
import Select from "ant-design-vue/es/select";
|
||||||
import PageHeader from "ant-design-vue/es/page-header";
|
import PageHeader from "ant-design-vue/es/page-header";
|
||||||
|
import Card from "ant-design-vue/es/card";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
install(app: any) {
|
install(app: any) {
|
||||||
|
@ -20,14 +21,11 @@ export default {
|
||||||
app.use(PageHeader);
|
app.use(PageHeader);
|
||||||
app.use(Steps);
|
app.use(Steps);
|
||||||
app.use(Select);
|
app.use(Select);
|
||||||
|
app.use(Card);
|
||||||
|
|
||||||
app.component(
|
app.component(
|
||||||
"AInputPassword",
|
"AAutoComplete",
|
||||||
defineAsyncComponent(() => import("ant-design-vue/es/input/Password"))
|
defineAsyncComponent(() => import("ant-design-vue/es/auto-complete/index"))
|
||||||
);
|
|
||||||
app.component(
|
|
||||||
"AButtonGroup",
|
|
||||||
defineAsyncComponent(() => import("ant-design-vue/es/button/button-group"))
|
|
||||||
);
|
);
|
||||||
app.component(
|
app.component(
|
||||||
"ARadio",
|
"ARadio",
|
||||||
|
@ -114,10 +112,7 @@ export default {
|
||||||
"AInputAutoComplete",
|
"AInputAutoComplete",
|
||||||
defineAsyncComponent(() => import("ant-design-vue/es/auto-complete/index"))
|
defineAsyncComponent(() => import("ant-design-vue/es/auto-complete/index"))
|
||||||
);
|
);
|
||||||
app.component(
|
|
||||||
"ACard",
|
|
||||||
defineAsyncComponent(() => import("ant-design-vue/es/card/index"))
|
|
||||||
);
|
|
||||||
app.component(
|
app.component(
|
||||||
"ACascader",
|
"ACascader",
|
||||||
defineAsyncComponent(() => import("ant-design-vue/es/cascader/index"))
|
defineAsyncComponent(() => import("ant-design-vue/es/cascader/index"))
|
||||||
|
|
|
@ -11,10 +11,16 @@ import "./styles/antd/index.css";
|
||||||
import { useTitle } from "@vueuse/core";
|
import { useTitle } from "@vueuse/core";
|
||||||
import { setupI18n } from "/@/vben/locales";
|
import { setupI18n } from "/@/vben/locales";
|
||||||
|
|
||||||
export async function setupVben(app: any, { loadMessages }: any) {
|
export async function setupVben(app: any, { loadMessages, router }: any) {
|
||||||
await setupI18n(app, { loadMessages });
|
await setupI18n(app, { loadMessages });
|
||||||
const store = await initStores(app, { namespace: "fs" });
|
const store = await initStores(app, { namespace: "fs" });
|
||||||
|
watchEffect(() => {
|
||||||
|
if (preferences.app.dynamicTitle) {
|
||||||
|
const routeTitle = router.currentRoute.value.title;
|
||||||
|
const pageTitle = routeTitle || "" + preferences.app.name;
|
||||||
|
useTitle(pageTitle);
|
||||||
|
}
|
||||||
|
});
|
||||||
return { store };
|
return { store };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue