将行业热门话题洞察的需要修改成columns
This commit is contained in:
@ -1,5 +1,4 @@
|
||||
import Http from '@/api';
|
||||
|
||||
// 导出一个函数,用于获取行业树
|
||||
export const fetchIndustriesTree = (params = {}) => {
|
||||
// 发送GET请求,获取行业树
|
||||
@ -50,7 +49,6 @@ export const fetchNewKeywordDetail = (params: any) => {
|
||||
// 使用Http.get方法,发送GET请求,获取行业话题列表
|
||||
return Http.get('/v1/industry-new-keywords/' + params, {});
|
||||
};
|
||||
fetchIndustryTopicDetail;
|
||||
|
||||
// 导出一个函数fetchUserPainPointsList,用于获取用户痛点列表
|
||||
export const fetchUserPainPointsList = (params: any) => {
|
||||
@ -98,7 +96,7 @@ export const fetchGenderDistributionsList = (params: any) => {
|
||||
// 导出一个函数,用于获取产品列表
|
||||
export const fetchProductList = () => {
|
||||
// 使用Http.get方法,发送GET请求,获取产品列表
|
||||
return Http.get('/v1/products/list', {}, { headers: { 'enterprise-id': 1 } });
|
||||
return Http.get('/v1/products/list');
|
||||
};
|
||||
|
||||
// 导出一个函数,用于获取成功案例列表
|
||||
@ -109,5 +107,55 @@ export const fetchSuccessCaseList = () => {
|
||||
|
||||
// 试用产品
|
||||
export const trialProduct = (id: number) => {
|
||||
return Http.post(`/v1/products/${id}/try`, {}, { headers: { 'enterprise-id': 1 } });
|
||||
return Http.post(`/v1/products/${id}/try`);
|
||||
};
|
||||
|
||||
// 修改企业名称
|
||||
export const updateEnterpriseName = (data: any) => {
|
||||
return Http.patch(`/v1/enterprises/name`, data);
|
||||
};
|
||||
|
||||
// 发送修改手机号验证码
|
||||
export const sendUpdateMobileCaptcha = (data: any) => {
|
||||
return Http.post(`/v1/sms/update-mobile-captcha`, data);
|
||||
};
|
||||
|
||||
// 修改绑定的手机号
|
||||
export const updateMobile = (data: any) => {
|
||||
return Http.post(`/v1/me/mobile`, data);
|
||||
};
|
||||
|
||||
// 修改我的信息
|
||||
export const updateMyInfo = (data: any) => {
|
||||
return Http.put(`/v1/me`, data);
|
||||
};
|
||||
|
||||
// 获取企业账号分页
|
||||
export const fetchSubAccountPage = (params: any) => {
|
||||
return Http.get(`/v1/enterprises/users`, params);
|
||||
};
|
||||
|
||||
// 获取企业账号分页
|
||||
export const fetchImageUploadFile = (params: any) => {
|
||||
return Http.get(`/v1/oss/image-pre-signed-url`, params);
|
||||
};
|
||||
|
||||
// 移除企业子账号
|
||||
export const removeEnterpriseAccount = (userId: number) => {
|
||||
return Http.delete(`/v1/enterprises/users/${userId}`);
|
||||
};
|
||||
|
||||
// 获取企业邀请码
|
||||
export const getEnterpriseInviteCode = () => {
|
||||
return Http.get(`/v1/enterprises/invite-code`);
|
||||
};
|
||||
|
||||
// 根据邀请码获取企业信息
|
||||
export const getEnterpriseByInviteCode = (inviteCode: string) => {
|
||||
return Http.get(`/v1/enterprises/by-invite-code`, { invite_code: inviteCode });
|
||||
};
|
||||
|
||||
// 根据邀请码加入企业
|
||||
export const joinEnterpriseByInviteCode = (inviteCode: string) => {
|
||||
return Http.post(`/v1/enterprises/join`, { invite_code: inviteCode });
|
||||
};
|
||||
|
||||
@ -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