Skip to content

Commit

Permalink
perf: dev api and multi
Browse files Browse the repository at this point in the history
  • Loading branch information
kris liu authored and kris-liu-smile committed Jul 20, 2022
1 parent 283dfb0 commit c2a6e2d
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion apps/storefront/.env.development
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
VITE_NODE_ENV=development
VITE_B2B_BASIC_URL=https://dev-v2.bundleb2b.net
VITE_B2B_BASIC_URL=https://dev-v2.bundleb2b.net/api
VITE_B2B_STOREHASH='rtmh8fqr05'
1 change: 1 addition & 0 deletions apps/storefront/src/locales/en-US/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default {

'intl.user.register.registeredAccount.loginLeft': 'It appears you may already have an account. Please',
'intl.user.register.registeredAccount.loginFirst': 'first',
'intl.user.register.registeredAccount.loginBtn': 'login',
'intl.user.register.registeredAccount.loginb2b': 'to apply for a business account',

'intl.user.register.registeredAccount.accountType': 'Account Type',
Expand Down
6 changes: 6 additions & 0 deletions apps/storefront/src/locales/zh-CN/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default {

'intl.user.register.registeredAccount.loginLeft': '看来你可能已经有一个帐户了。请',
'intl.user.register.registeredAccount.loginFirst': '第一',
'intl.user.register.registeredAccount.loginBtn': '登录',
'intl.user.register.registeredAccount.loginb2b': '申请企业账户',

'intl.user.register.registeredAccount.accountType': '账户类型',
Expand All @@ -28,6 +29,11 @@ export default {
'intl.user.register.registeredAccount.contactInformation': '联系信息',
'intl.user.register.registeredAccount.additionalInformation': '附加信息',

'intl.user.register.validatorRules.email': '请输入正确的电子邮件地址',
'intl.user.register.validatorRules.phoneNumber': '请输入正确的电话号码',
'intl.user.register.validatorRules.max': '请不要超过 {max}',
'intl.user.register.validatorRules.passwords': '密码必须至少为 7 个字符,并且包含字母和数字字符。',

'intl.user.register.label.companyName': '公司名称',
'intl.user.register.label.companyEmail': '公司邮箱',
'intl.user.register.label.companyPhoneNumber': '公司电话号码',
Expand Down
2 changes: 1 addition & 1 deletion apps/storefront/src/pages/registered/RegisterComplete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export default function RegisterComplete(props: RegisterCompleteProps) {
id: 'Confirm Password',
fieldType: 'password',
xs: 12,
validate: (v: string) => validatorRules(v, ['password']),
validate: validatorRules(['password']),
})

setPersonalInfo(newPasswordInformation)
Expand Down
3 changes: 2 additions & 1 deletion apps/storefront/src/pages/registered/RegisteredAccount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export default function RegisteredAccount(props: RegisteredAccountProps) {
return item
})
}
setEmailStateType(0)
dispatch({
type: 'all',
payload: {
Expand Down Expand Up @@ -143,7 +144,7 @@ export default function RegisteredAccount(props: RegisteredAccountProps) {
<TipLogin
onClick={gotoLigin}
>
login
{b3Lang('intl.user.register.registeredAccount.loginBtn')}
</TipLogin>
</Box>
{
Expand Down
6 changes: 3 additions & 3 deletions apps/storefront/src/shared/service/request/b3Fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ interceptors.response.use(async (response: Response) => {
})

function request<T>(path: string, config?: T, type?: string) {
const url = RequestType.B2BRest === type ? `${B2B_BASIC_URL}/api${path}` : path
const url = RequestType.B2BRest === type ? `${B2B_BASIC_URL}${path}` : path
const init = {
headers: {
'content-type': 'application/json',
Expand All @@ -68,7 +68,7 @@ function graphqlRequest<T, Y>(type: string, data: T, config?: Y) {
...config,
body: JSON.stringify(data),
}
const graphqlB2BUrl = `${B2B_BASIC_URL}/api/graphql`
const graphqlB2BUrl = `${B2B_BASIC_URL}/graphql`

const url = type === RequestType.B2BGraphql ? graphqlB2BUrl : ''

Expand Down Expand Up @@ -96,7 +96,7 @@ export const B3Request = {
}, type)
},
fileUpload: function fileUpload<T, Y>(url: string, formData: T, config?: Y) {
return request(`${B2B_BASIC_URL}/api${url}`, {
return request(`${B2B_BASIC_URL}${url}`, {
method: 'POST',
body: formData,
headers: {},
Expand Down

0 comments on commit c2a6e2d

Please sign in to comment.