Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f1e2cb9b8a | |||
| 25bc5efd30 | |||
| ffadbcd92f | |||
| 3d7a19f4a7 | |||
| 7da7395b90 | |||
| ab8ed08e52 | |||
| 52071ecf47 | |||
| 3661c0e86e | |||
| 7f49b26ac7 | |||
| cd02a48017 | |||
| 1d095be338 | |||
| 7a52327819 | |||
| bf5be87823 | |||
| 61df911a5c | |||
| 1ca023f5e7 | |||
| 5cc4f69fbf |
@ -3,10 +3,8 @@
|
|||||||
*/
|
*/
|
||||||
import { axiosInstance } from '@/api/rbac'
|
import { axiosInstance } from '@/api/rbac'
|
||||||
import { assertBusinessOk, omsUrl, parseListPayload, unwrapData } from '@/api/oms/common'
|
import { assertBusinessOk, omsUrl, parseListPayload, unwrapData } from '@/api/oms/common'
|
||||||
import { CUSTOMER_STATUS } from '@/utils/customerStatus'
|
|
||||||
|
|
||||||
/** 与后端 CustomerStatus 对齐:0=None,1=Disabled,2=Normal,3=Frozen */
|
export type CustomerStatus = 0 | 1 | 2
|
||||||
export type CustomerStatus = 0 | 1 | 2 | 3
|
|
||||||
|
|
||||||
export type CustomerGroup = 0 | 1 | 2 | 3 | 4 | 5
|
export type CustomerGroup = 0 | 1 | 2 | 3 | 4 | 5
|
||||||
|
|
||||||
@ -156,7 +154,7 @@ export const CustomerService = {
|
|||||||
balance: data.accountBalance ?? data.balance ?? 0,
|
balance: data.accountBalance ?? data.balance ?? 0,
|
||||||
totalQuota: data.totalQuota ?? 0,
|
totalQuota: data.totalQuota ?? 0,
|
||||||
usedQuota: data.usedQuota ?? 0,
|
usedQuota: data.usedQuota ?? 0,
|
||||||
status: data.status ?? CUSTOMER_STATUS.normal,
|
status: data.status ?? 1,
|
||||||
remark: data.remark,
|
remark: data.remark,
|
||||||
salesman: data.salesman ?? data.salesPerson,
|
salesman: data.salesman ?? data.salesPerson,
|
||||||
customerService: data.customerService,
|
customerService: data.customerService,
|
||||||
@ -188,8 +186,7 @@ export const CustomerService = {
|
|||||||
balance: data.accountBalance ?? data.balance,
|
balance: data.accountBalance ?? data.balance,
|
||||||
totalQuota: data.totalQuota,
|
totalQuota: data.totalQuota,
|
||||||
usedQuota: data.usedQuota,
|
usedQuota: data.usedQuota,
|
||||||
// 后端:1=Disabled,2=Normal;勿默认 1,否则公开注册账号无法登录
|
status: data.status ?? 1,
|
||||||
status: data.status ?? CUSTOMER_STATUS.normal,
|
|
||||||
role: data.role,
|
role: data.role,
|
||||||
remark: data.remark,
|
remark: data.remark,
|
||||||
salesman: data.salesman ?? data.salesPerson,
|
salesman: data.salesman ?? data.salesPerson,
|
||||||
|
|||||||
@ -318,11 +318,7 @@ export const useRbacUserStore = defineStore('rbacUser', () => {
|
|||||||
enableKeepAlive()
|
enableKeepAlive()
|
||||||
await hydrateUserAfterLogin(result)
|
await hydrateUserAfterLogin(result)
|
||||||
return true
|
return true
|
||||||
} catch (error: unknown) {
|
} catch {
|
||||||
// 交给登录页展示业务文案(如「客户已禁用」),勿一律当成账号密码错误
|
|
||||||
const anyErr = error as { body?: { message?: string }; message?: string }
|
|
||||||
const msg = String(anyErr?.body?.message || anyErr?.message || '').trim()
|
|
||||||
if (msg) throw new Error(msg)
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -350,19 +350,11 @@ async function handleSubmit() {
|
|||||||
loading.value = true;
|
loading.value = true;
|
||||||
errorBox.value = '';
|
errorBox.value = '';
|
||||||
|
|
||||||
let success = false;
|
const success = await rbacUserStore.login(
|
||||||
try {
|
loginForm.account,
|
||||||
success = await rbacUserStore.login(
|
loginForm.password,
|
||||||
loginForm.account,
|
props.loginType,
|
||||||
loginForm.password,
|
);
|
||||||
props.loginType,
|
|
||||||
);
|
|
||||||
} catch (loginErr: unknown) {
|
|
||||||
const msg = loginErr instanceof Error ? loginErr.message.trim() : '';
|
|
||||||
errorBox.value = msg || t('login.form.login.failed');
|
|
||||||
loginCharacters.value?.onLoginFailed();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (success && rbacUserStore.userInfo) {
|
if (success && rbacUserStore.userInfo) {
|
||||||
const userInfoData = rbacUserStore.userInfo;
|
const userInfoData = rbacUserStore.userInfo;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user