chore: update deps
This commit is contained in:
@@ -42,7 +42,7 @@
|
||||
"ant-design-vue": "^4.2.3",
|
||||
"dayjs": "^1.11.11",
|
||||
"pinia": "2.1.7",
|
||||
"vue": "^3.4.29",
|
||||
"vue": "^3.4.30",
|
||||
"vue-router": "^4.4.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@@ -10,23 +10,31 @@ import { useAccessStore } from '@vben-core/stores';
|
||||
import { message } from 'ant-design-vue';
|
||||
|
||||
interface HttpResponse<T = any> {
|
||||
/**
|
||||
* 0 表示成功 其他表示失败
|
||||
* 0 means success, others means fail
|
||||
*/
|
||||
code: number;
|
||||
message: string;
|
||||
result: T;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建请求实例
|
||||
* Create a request instance
|
||||
*/
|
||||
function createRequestClient() {
|
||||
const client = new RequestClient({
|
||||
baseURL: import.meta.env.VITE_GLOB_API_URL,
|
||||
// 为每个请求携带 Authorization
|
||||
makeAuthorization: () => {
|
||||
return {
|
||||
handle: () => {
|
||||
handler: () => {
|
||||
const accessStore = useAccessStore();
|
||||
return accessStore.getAccessToken;
|
||||
},
|
||||
// 默认
|
||||
// key: 'Authorization',
|
||||
key: 'Authorization',
|
||||
};
|
||||
},
|
||||
});
|
||||
|
Reference in New Issue
Block a user