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 @@ + + +
+ + +