panhui 2 rokov pred
rodič
commit
8998e4aaf6

+ 5 - 1
src/App.vue

@@ -42,11 +42,15 @@ watch(
             document.title = company.value.companyName
         }
         if (company.value.logo) {
-            console.log(company.value.logo)
             let link = document.createElement('link')
             link.rel = 'icon'
             link.href = company.value.logo
             document.head.appendChild(link)
+        } else {
+            let link = document.createElement('link')
+            link.rel = 'icon'
+            link.href = 'https://nebuai.oss-cn-hangzhou.aliyuncs.com/image/logo/favicon.ico'
+            document.head.appendChild(link)
         }
     },
     {

+ 10 - 1
src/components/common/LoginForm.vue

@@ -97,7 +97,7 @@ import { RuleContent } from '@/components/common'
 import { User, ShieldCheck } from '@vicons/tabler'
 import { fetchSendVerify } from '../../api'
 import { useStorage } from '@vueuse/core'
-import { useAuthStore } from '@/store'
+import { useAuthStore, useCompanyStore } from '@/store'
 import { router } from '@/router'
 import { useBasicLayout } from '@/hooks/useBasicLayout'
 import { useTheme } from '@/hooks/useTheme'
@@ -287,10 +287,19 @@ function initCaptcha() {
     })
 }
 
+const companyStore = useCompanyStore()
+const company = computed(() => {
+    return companyStore.company
+})
+
 onMounted(() => {
     if (window.sessionStorage.getItem('invitor')) {
         form.value.invitor = String(window.sessionStorage.getItem('invitor'))
     }
+
+    if (company.value.id !== 0 && company.value.userId && company.value.type !== 2) {
+        form.value.invitor = String(company.value.userId)
+    }
 })
 
 const showRule = ref(false)

+ 1 - 1
src/store/modules/auth/index.ts

@@ -61,7 +61,7 @@ export const useAuthStore = defineStore('auth-store', {
                 companyStore.getCompanyInfo(userStore.userInfo.apiUserId)
                 this.setToken(data.access_token)
             } 
-            else {
+            else if(companyStore.company.type===2) {
                 this.removeToken()
                 companyStore.getCompanyInfo(0)
                 this.setToken(data.access_token)

+ 3 - 1
src/store/modules/company/helper.ts

@@ -9,6 +9,8 @@ export interface CompanyInfo {
     logo?: string
     companyName?: string
     desc?: string
+    userId?: string | number
+    type?:string | number
 }
 
 export interface CompanyState {
@@ -20,7 +22,7 @@ export function defaultSetting(): CompanyState {
         company: {
             id: 0,
             name: '走马AI',
-            companyName: '走马AI助手',
+            companyName: '走马AI助手'
             // logo: 'https://nebuai.oss-cn-hangzhou.aliyuncs.com/image/logo/logo-text.png'
         }
     }