diff --git a/package-lock.json b/package-lock.json index 739795d..d972c82 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,6 +22,7 @@ "sass": "^1.89.2", "swiper": "^11.2.8", "vue": "^3.2.45", + "vue-cropper": "^1.1.4", "vue-echarts": "^7.0.3", "vue-router": "^4.1.6" }, @@ -8945,6 +8946,12 @@ "@vue/shared": "3.2.47" } }, + "node_modules/vue-cropper": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/vue-cropper/-/vue-cropper-1.1.4.tgz", + "integrity": "sha512-5m98vBsCEI9rbS4JxELxXidtAui3qNyTHLHg67Qbn7g8cg+E6LcnC+hh3SM/p94x6mFh6KRxT1ttnta+wCYqWA==", + "license": "ISC" + }, "node_modules/vue-demi": { "version": "0.13.11", "resolved": "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.13.11.tgz", diff --git a/package.json b/package.json index 184c6ae..b46c95a 100644 --- a/package.json +++ b/package.json @@ -24,11 +24,10 @@ "mitt": "^3.0.0", "normalize.css": "^8.0.1", "pinia": "^2.0.29", - "sass": "^1.89.2", - "swiper": "^11.2.8", "vue": "^3.2.45", + "vue-cropper": "^1.1.4", "vue-echarts": "^7.0.3", "vue-router": "^4.1.6" }, diff --git a/src/api/all/index.ts b/src/api/all/index.ts index 771d941..2a0510f 100644 --- a/src/api/all/index.ts +++ b/src/api/all/index.ts @@ -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 }); }; diff --git a/src/api/index.ts b/src/api/index.ts index e32ea80..8c11550 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -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(url: string, config?: AxiosRequestConfig): Promise { return this.instance.delete(url, config); } + + public patch(url: string, data?: any, config?: AxiosRequestConfig): Promise { + return this.instance.patch(url, data, config); + } } //* 默认导出Request实例 diff --git a/src/assets/warning.svg b/src/assets/warning.svg new file mode 100644 index 0000000..788d818 --- /dev/null +++ b/src/assets/warning.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/components/_base/navbar/index.vue b/src/components/_base/navbar/index.vue index 641ef25..be69f68 100644 --- a/src/components/_base/navbar/index.vue +++ b/src/components/_base/navbar/index.vue @@ -10,7 +10,9 @@ const clickExit = () => { }; const getMenus = async () => { const res = await fetchMenusTree(); - lists.value = res; + if (res.code == 200) { + lists.value = res.data; + } }; onMounted(() => { getMenus(); diff --git a/src/views/components/workplace/modules/container.vue b/src/components/container.vue similarity index 71% rename from src/views/components/workplace/modules/container.vue rename to src/components/container.vue index 40de2d5..e63e4e9 100644 --- a/src/views/components/workplace/modules/container.vue +++ b/src/components/container.vue @@ -1,6 +1,9 @@