公司过滤

This commit is contained in:
bb_pan 2025-02-26 17:33:40 +08:00
parent d245e34f51
commit 5c5ddc5a24
1 changed files with 6 additions and 2 deletions

View File

@ -59,7 +59,9 @@ const onSubmitLogin = async () => {
const { data: result } = await appLoginAPI(loginForm) const { data: result } = await appLoginAPI(loginForm)
memberStore.setToken(result.access_token) memberStore.setToken(result.access_token)
const userResult = await getUserInfoAPI() const userResult = await getUserInfoAPI()
const { data: comResult } = await getCompanyListAPI() const { data: res } = await getCompanyListAPI()
const comResult = res.filter((e) => e.isShow)
// console.log('🚀 ~ onSubmitLogin ~ comResult:', comResult)
const userCompanyList = comResult.filter((e) => e.companyId == userResult.user.companyId) const userCompanyList = comResult.filter((e) => e.companyId == userResult.user.companyId)
memberStore.setUserInfo(userResult.user) memberStore.setUserInfo(userResult.user)
memberStore.setCompanyList(comResult) memberStore.setCompanyList(comResult)
@ -98,7 +100,9 @@ onMounted(async () => {
memberStore.setToken(result.access_token) memberStore.setToken(result.access_token)
const userResult = await getUserInfoAPI() const userResult = await getUserInfoAPI()
const { data: comResult } = await getCompanyListAPI() const { data: res } = await getCompanyListAPI()
const comResult = res.filter((e) => e.isShow)
// console.log('🚀 ~ onMounted ~ comResult:', comResult)
const userCompanyList = comResult.filter( const userCompanyList = comResult.filter(
(e) => e.companyId == userResult.user.companyId, (e) => e.companyId == userResult.user.companyId,
) )