diff --git a/src/api/interceptors/auth.ts b/src/api/interceptors/auth.ts
index 9af5bf4..f433c10 100644
--- a/src/api/interceptors/auth.ts
+++ b/src/api/interceptors/auth.ts
@@ -1,12 +1,13 @@
-import { store, useUserStore } from "@/store";
-import { AxiosInstance } from "axios";
+import { store } from '@/store';
+import { useUserStore } from '@/store/user';
+import { AxiosInstance } from 'axios';
/**
* 登陆令牌拦截器
* @param axios Axios实例
*/
export function addAuthInterceptor(axios: AxiosInstance) {
- axios.interceptors.request.use((config) => {
+ axios.interceptors.request.use(config => {
const userStore = useUserStore(store);
if (userStore.accessToken) {
config.headers.Authorization = `Bearer ${userStore.accessToken}`;
diff --git a/src/libs/dayjs/index.ts b/src/libs/dayjs/index.ts
index e73da4a..accf608 100644
--- a/src/libs/dayjs/index.ts
+++ b/src/libs/dayjs/index.ts
@@ -39,17 +39,17 @@ dayjs.extend(localData);
/**
* 默认时间格式
*/
-dayjs.DATETIME = DATETIME;
+dayjs.DATETIME = 'YYYY-MM-DD HH:mm';
/**
* 默认日期格式
*/
-dayjs.DATE = DATE;
+dayjs.DATE = 'YYYY-MM-DD';
/**
* 默认时间格式
*/
-dayjs.TIME = TIME;
+dayjs.TIME = 'HH:mm:ss';
/**
* 保留原方法
@@ -59,11 +59,8 @@ dayjs.prototype._format = dayjs.prototype.format;
/**
* 重写,设置默认时间格式
*/
-dayjs.prototype.format = function (format?: string) {
- if (format) {
- return this._format(format);
- }
- return this._format(dayjs.DATETIME);
+dayjs.prototype.format = function (format: string = dayjs.DATETIME) {
+ return this._format(format);
};
export { DATE, DATETIME, TIME, dayjs };
diff --git a/src/pages/_layout/UserDropdown.vue b/src/pages/_layout/UserDropdown.vue
index b9cbab8..3be3592 100644
--- a/src/pages/_layout/UserDropdown.vue
+++ b/src/pages/_layout/UserDropdown.vue
@@ -62,7 +62,7 @@
@@ -209,8 +210,7 @@ const buttons = [
"name": "LayoutPage",
"sort": 101,
"title": "首页",
- "icon": "icon-park-outline-home",
- "keepAlive": true
+ "icon": "icon-park-outline-home"
}
}
diff --git a/src/pages/_login/index.vue b/src/pages/_login/index.vue
index 7cb700f..cc714a7 100644
--- a/src/pages/_login/index.vue
+++ b/src/pages/_login/index.vue
@@ -42,7 +42,7 @@
暂不支持其他方式登录
@@ -55,18 +55,19 @@