|
|
@@ -5,6 +5,7 @@ import { defaultSetting, getLocalState, setLocalState } from './helper'
|
|
|
import { fetchGetCompany } from '@/api'
|
|
|
import { Response } from '@/utils/request'
|
|
|
import { useAuthStore } from '../auth'
|
|
|
+import { useChatStore } from '../chat'
|
|
|
|
|
|
export const useCompanyStore = defineStore('company-store', {
|
|
|
state: (): CompanyState => getLocalState(),
|
|
|
@@ -25,15 +26,24 @@ export const useCompanyStore = defineStore('company-store', {
|
|
|
this.setCompanyInfo({
|
|
|
id: 0,
|
|
|
name: '走马AI',
|
|
|
- code: undefined
|
|
|
+ code: undefined,
|
|
|
+ companyName: '走马AI助手',
|
|
|
+ logo: 'https://nebuai.oss-cn-hangzhou.aliyuncs.com/image/logo/logo-text.png'
|
|
|
})
|
|
|
useAuthStore().changeToken(`SECRET_TOKEN`)
|
|
|
+ useChatStore().changeChatLocal('chatStorage')
|
|
|
document.title = '走马AI助手'
|
|
|
} else {
|
|
|
await fetchGetCompany(companyId).then((res: any) => {
|
|
|
- this.setCompanyInfo(res)
|
|
|
+ this.setCompanyInfo({
|
|
|
+ ...res,
|
|
|
+ companyName: res.company ? res.company : res.name + '助手',
|
|
|
+ logo: res.logo || 'https://nebuai.oss-cn-hangzhou.aliyuncs.com/image/logo/logo-text.png',
|
|
|
+ code: res.code || undefined
|
|
|
+ })
|
|
|
useAuthStore().changeToken(`SECRET_TOKEN${res.id === 0 ? '' : res.id}`)
|
|
|
- document.title = res.name + '助手'
|
|
|
+ useChatStore().changeChatLocal(`chatStorage${res.id}`)
|
|
|
+ document.title = res.companyName
|
|
|
})
|
|
|
}
|
|
|
}
|