修改飞书登录 公司id 系统id 获取不到问题 客户及公海添加用户信息显示

This commit is contained in:
浅念
2025-07-30 11:46:31 +08:00
parent 0cef82279f
commit 3ea9d3d5df
7 changed files with 37 additions and 28 deletions
+17 -19
View File
@@ -205,7 +205,7 @@
const isPassing = ref(false)
const isClickPass = ref(false)
const activeLoginType = ref<'password' | 'qrcode'>('qrcode')
const isInFeishu = /Lark|Feishu/i.test(navigator.userAgent);
const isInFeishu = /Lark|Feishu/i.test(navigator.userAgent)
// const isInFeishu = true;
const systemName = AppConfig.systemInfo.name
const formRef = ref<FormInstance>()
@@ -214,7 +214,7 @@
const systemsid = ref('')
systemsid.value = useUserStore().systemsid
const iscompany = ref(false)
const { companyabbr } = useUserStore()
const { companyabbr, systemsabbr } = useUserStore()
//获取公司 getCompanyList
const companyList = ref<any>()
//系统
@@ -222,13 +222,12 @@
const feishuresponse = ref()
const formData = reactive({
account: '',
systems: useUserStore().companyid ? Number(useUserStore().companyid) : '',
systems: useUserStore().systemsid ? Number(useUserStore().systemsid) : '',
company: useUserStore().companyid ? Number(useUserStore().companyid) : '',
username: '',
password: '',
rememberPassword: true
})
const rules = computed<FormRules>(() => ({
username: [{ required: true, message: t('login.placeholder[0]'), trigger: 'blur' }],
password: [{ required: true, message: t('login.placeholder[1]'), trigger: 'blur' }],
@@ -256,8 +255,8 @@
const getfeishuAppList = async () => {
feishuresponse.value = await UserService.getfeishuAppList({
corp_id: companyid.value,
system_id: systemsid.value
corp_id: useUserStore().companyid,
system_id: useUserStore().systemsid
})
if (activeLoginType.value == 'qrcode') {
feishulogin()
@@ -268,12 +267,11 @@
const systemsdata = systemsList.value.find((c: any) => c.id === systems)
systemsid.value = systems
userStore.setSystems(systems, systemsdata?.code)
if (companyid.value && systemsid.value) {
if (useUserStore().companyid && systemsid.value) {
getfeishuAppList()
}
}
//切换公司
const changeCompany = (company: any) => {
// if (companyid.value === company) return
const companyt = companyList.value.find((c: any) => c.id === company)
@@ -284,7 +282,7 @@
getfeishuAppList()
}
}
if (companyabbr != '') {
if (companyabbr != '' && systemsabbr != '') {
iscompany.value = true
getfeishuAppList()
}
@@ -443,20 +441,20 @@
const companyabbr = Array.isArray(route.query.corp_abbr)
? route.query.corp_abbr[0]
: route.query.corp_abbr
const system_id = Array.isArray(route.query.system_id)
? route.query.system_id[0]
: route.query.system_id
const system_code = Array.isArray(route.query.system_code)
? route.query.system_code[0]
: route.query.system_code
// const system_id = Array.isArray(route.query.system_id)
// ? route.query.system_id[0]
// : route.query.system_id
// const system_code = Array.isArray(route.query.system_code)
// ? route.query.system_code[0]
// : route.query.system_code
if (companyid) {
userStore.setCompany(companyid as string, (companyabbr as string) || '')
formData.company = Number(companyid)
}
if (system_id) {
userStore.setSystems(companyid as string, (system_code as string) || '')
formData.systems = Number(system_id)
}
// if (system_id) {
// userStore.setSystems(companyid as string, (system_code as string) || '')
// formData.systems = Number(system_id)
// }
// 只有两个 id 都有值时才调用
if (companyid && systemsid.value) {
getfeishuAppList()