From c7d890809c539a7592979904337ce6826bdfa714 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=85=E5=BF=B5?= Date: Mon, 21 Jul 2025 18:12:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=B3=BB=E7=BB=9F=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/crmApi.ts | 8 +- src/api/usersApi.ts | 6 + src/store/modules/user.ts | 10 ++ src/utils/http/index.ts | 3 +- src/views/auth/login/index.vue | 48 +++++++- src/views/crmpc/customer/Show.vue | 2 +- src/views/crmpc/customer/index.vue | 176 +++++++++++++---------------- 7 files changed, 150 insertions(+), 103 deletions(-) diff --git a/src/api/crmApi.ts b/src/api/crmApi.ts index 6b950f4..3e610b2 100644 --- a/src/api/crmApi.ts +++ b/src/api/crmApi.ts @@ -65,16 +65,16 @@ export class CrmService { }) } //标签列表/crm/tagGroup/list - static tagGrouplist() { + static tagGrouplist(params: any) { return request.get({ - url: '/crm/tagGroup/list' + url: '/crm/tagGroup/list', + params }) } //更新客户标签 /crm/tagGroup/updatePivot static tagGroupupdatePivot(params: any) { return request.get({ - url: '/crm/tagGroup/updatePivot', - params + url: '/crm/tagGroup/updatePivot' }) } //跟进列表crm/follow/list diff --git a/src/api/usersApi.ts b/src/api/usersApi.ts index 04359ca..96d7f0a 100644 --- a/src/api/usersApi.ts +++ b/src/api/usersApi.ts @@ -6,6 +6,12 @@ export class UserService { return request.get({ url: '/common/preset/corps' }) + } + //获取系统 + static getsystemsList() { + return request.get({ + url: '/common/preset/systems' + }) } //注册 static register(params: any) { diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index a3b8024..e33247f 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -25,6 +25,8 @@ export const useUserStore = defineStore( const refreshToken = ref('') const companyid = ref('') const companyabbr = ref('') + const systemsid = ref('') + const systemsabbr = ref('') const loginType = ref<'feishu' | 'upwd'>('upwd') const tokenExpireAt = ref(0) @@ -76,6 +78,11 @@ export const useUserStore = defineStore( companyid.value = id companyabbr.value = abbr } + const setSystems= (id: string, abbr: string) => { + systemsid.value = id + systemsabbr.value = abbr + } + function restoreTokenTimer() { const expireAt = Number(localStorage.getItem('token_expire_at') || '0') if (accessToken.value && expireAt > Date.now()) { @@ -139,6 +146,8 @@ export const useUserStore = defineStore( info, companyid, companyabbr, + systemsid, + systemsabbr, searchHistory, loginType, accessToken, @@ -155,6 +164,7 @@ export const useUserStore = defineStore( setLockPassword, setToken, setCompany, + setSystems, setLoginType, logOut, restoreTokenTimer diff --git a/src/utils/http/index.ts b/src/utils/http/index.ts index e32f9fe..4bd356b 100644 --- a/src/utils/http/index.ts +++ b/src/utils/http/index.ts @@ -47,9 +47,10 @@ axiosInstance.interceptors.request.use( const { language } = useUserStore() const { loginType } = useUserStore() const { companyabbr } = useUserStore() + const { systemsabbr } = useUserStore() request.headers.set('Fdesk-Language', language) request.headers.set('Fdesk-Corp-Abbr', companyabbr) - request.headers.set('Fdesk-System-Code', 'fdesk') + request.headers.set('Fdesk-System-Code', systemsabbr) request.headers.set('Fdesk-Login-Type', loginType) // 设置 token 和 请求头 if (accessToken) { diff --git a/src/views/auth/login/index.vue b/src/views/auth/login/index.vue index 8147ef8..f69927f 100644 --- a/src/views/auth/login/index.vue +++ b/src/views/auth/login/index.vue @@ -72,6 +72,18 @@ + + +
+ + +