Skip to content

Commit

Permalink
fix: judge user role
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianJiang2021 committed Mar 20, 2023
1 parent 45a777f commit b42db1c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apps/storefront/src/utils/loginInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ const getCompanyInfo = async (id: number, userType: number, role:number) => {
let companyInfo = {
id: '',
companyName: '',
companyStatus: '',
companyStatus: 0,
}
if (userType === 3 && role !== 3) {
const {
Expand Down Expand Up @@ -315,13 +315,13 @@ export const getCurrentCustomerInfo = async (dispatch: DispatchProps) => {
B3SStorage.set('B3EmailAddress', emailAddress)
B3SStorage.set('B3UserId', id)
B3SStorage.set('B3Role', userType === 3 ? role : 99)
B3SStorage.set('isB2BUser', userType === 3)
B3SStorage.set('isB2BUser', (userType === 3 && companyInfo?.companyStatus === 1))

dispatch({
type: 'common',
payload: {
isB2BUser: userType === 3,
role: userType === 3 ? role : 99,
isB2BUser: (userType === 3 && companyInfo?.companyStatus === 1),
role: (userType === 3 && companyInfo?.companyStatus === 1) ? role : 99,
customerId,
B3UserId: id,
// isAgenting: agentInfo.isAgenting,
Expand Down

0 comments on commit b42db1c

Please sign in to comment.