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 { locker } from './util.lock.js';
|
||||
import { mitter } from './util.mitter.js';
|
||||
|
||||
import * as request from './util.request.js';
|
||||
export const utils = {
|
||||
sleep,
|
||||
http,
|
||||
|
@ -52,4 +54,5 @@ export const utils = {
|
|||
locker,
|
||||
mitter,
|
||||
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}`;
|
||||
errorLog(error, error?.response?.config?.showErrorNotify);
|
||||
if (status === 401) {
|
||||
// const userStore = useUserStore();
|
||||
// userStore.logout();
|
||||
const userStore = useUserStore();
|
||||
userStore.logout();
|
||||
}
|
||||
|
||||
if (error?.config?.onError) {
|
||||
|
|
|
@ -18,7 +18,7 @@ async function bootstrap() {
|
|||
const app = createApp(App);
|
||||
// app.use(Antd);
|
||||
app.use(Antd);
|
||||
await setupVben(app, { loadMessages });
|
||||
await setupVben(app, { loadMessages, router });
|
||||
app.use(router);
|
||||
// app.use(i18n);
|
||||
// app.use(store);
|
||||
|
|
|
@ -8,6 +8,7 @@ import Avatar from "ant-design-vue/es/avatar";
|
|||
import Steps from "ant-design-vue/es/steps";
|
||||
import Select from "ant-design-vue/es/select";
|
||||
import PageHeader from "ant-design-vue/es/page-header";
|
||||
import Card from "ant-design-vue/es/card";
|
||||
|
||||
export default {
|
||||
install(app: any) {
|
||||
|
@ -20,14 +21,11 @@ export default {
|
|||
app.use(PageHeader);
|
||||
app.use(Steps);
|
||||
app.use(Select);
|
||||
app.use(Card);
|
||||
|
||||
app.component(
|
||||
"AInputPassword",
|
||||
defineAsyncComponent(() => import("ant-design-vue/es/input/Password"))
|
||||
);
|
||||
app.component(
|
||||
"AButtonGroup",
|
||||
defineAsyncComponent(() => import("ant-design-vue/es/button/button-group"))
|
||||
"AAutoComplete",
|
||||
defineAsyncComponent(() => import("ant-design-vue/es/auto-complete/index"))
|
||||
);
|
||||
app.component(
|
||||
"ARadio",
|
||||
|
@ -114,10 +112,7 @@ export default {
|
|||
"AInputAutoComplete",
|
||||
defineAsyncComponent(() => import("ant-design-vue/es/auto-complete/index"))
|
||||
);
|
||||
app.component(
|
||||
"ACard",
|
||||
defineAsyncComponent(() => import("ant-design-vue/es/card/index"))
|
||||
);
|
||||
|
||||
app.component(
|
||||
"ACascader",
|
||||
defineAsyncComponent(() => import("ant-design-vue/es/cascader/index"))
|
||||
|
|
|
@ -11,10 +11,16 @@ import "./styles/antd/index.css";
|
|||
import { useTitle } from "@vueuse/core";
|
||||
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 });
|
||||
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 };
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue