Skip to content

Commit

Permalink
fix: change login failed tips
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianJiang2021 authored and libruce committed Jan 22, 2024
1 parent 5ef4df0 commit cb2ac11
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
3 changes: 2 additions & 1 deletion apps/storefront/src/pages/login/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
B3SStorage,
getCurrentCustomerInfo,
logoutSession,
snackbar,
storeHash,
} from '@/utils'

Expand Down Expand Up @@ -295,7 +296,7 @@ export default function Login(props: RegisteredProps) {
}
}
} catch (error) {
console.log(error)
snackbar.error(b3Lang('login.loginTipInfo.accountincorrect'))
}
}
setLoading(false)
Expand Down
18 changes: 12 additions & 6 deletions apps/storefront/src/shared/service/bc/graphql/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,18 @@ const getB2bLogin = `mutation Login($loginData: UserLoginType!) {
}
}
}`

export const b2bLogin = (variables: LoginData): Promise<UserLoginResult> =>
B3Request.graphqlB2B({
query: getB2bLogin,
variables,
})
// customMessage: field used to determine whether to use a custom message
export const b2bLogin = (
variables: LoginData,
customMessage = true
): Promise<UserLoginResult> =>
B3Request.graphqlB2B(
{
query: getB2bLogin,
variables,
},
customMessage
)

export const bcLogin = (data: CustomFieldItems): CustomFieldItems =>
B3Request.graphqlBC({
Expand Down

0 comments on commit cb2ac11

Please sign in to comment.