将行业热门话题洞察的需要修改成columns
This commit is contained in:
@ -21,6 +21,11 @@ const HttpStatusCode = {
|
||||
InternalServerError: 500,
|
||||
};
|
||||
|
||||
import { useEnterpriseStore } from '@/stores/modules/enterprise';
|
||||
import pinia from '@/stores';
|
||||
const store = useEnterpriseStore(pinia);
|
||||
const enterprise = store.getEnterpriseInfo();
|
||||
|
||||
//* 导出Request类,可以用来自定义传递配置来创建实例
|
||||
export class Request {
|
||||
//* axios 实例
|
||||
@ -41,6 +46,15 @@ export class Request {
|
||||
(config: AxiosRequestConfig) => {
|
||||
const token = localStorage.getItem('accessToken') as string;
|
||||
config.headers!.Authorization = token;
|
||||
if (token) {
|
||||
config.headers!.Authorization = token;
|
||||
} else {
|
||||
config.headers!.satoken = '123';
|
||||
}
|
||||
|
||||
if (enterprise) {
|
||||
config.headers!['enterprise-id'] = enterprise.id;
|
||||
}
|
||||
return config;
|
||||
},
|
||||
(err: any) => {
|
||||
@ -87,6 +101,10 @@ export class Request {
|
||||
public delete<T = any>(url: string, config?: AxiosRequestConfig): Promise<T> {
|
||||
return this.instance.delete(url, config);
|
||||
}
|
||||
|
||||
public patch<T = any>(url: string, data?: any, config?: AxiosRequestConfig): Promise<T> {
|
||||
return this.instance.patch(url, data, config);
|
||||
}
|
||||
}
|
||||
|
||||
//* 默认导出Request实例
|
||||
|
||||
Reference in New Issue
Block a user