提交 78240a11 authored 作者: vipcxj's avatar vipcxj

修正关于uca登录的bug

上级 56540934
......@@ -119,7 +119,11 @@ export default {
if (password) {
response = yield call(authorize, yield call(passValidate, password, encrypt(tkId)));
} else if (uca) {
response = yield call(authorize, yield call(ucaValidate, uca, encrypt(tkId)));
if (uca.status === 0) {
response = yield call(authorize, yield call(ucaValidate, uca, encrypt(tkId)));
} else {
throw errors.generalError(uca.error);
}
}
if (response) {
const { status, remainedAuthRequirements, data } = response;
......
......@@ -14,10 +14,23 @@ export const cookie = {
export const errors = {
exception: 0x00010000,
no_such_user: 0x00010001,
wrong_password: 0x00010002,
invalid_token: 0x00010003,
invalid_query_param: 0x00010004,
domain_not_set: 0x00010005,
wrong_sms_code: 0x00010006,
sms_code_time_out: 0x00010007,
invalid_mobile: 0x00010008,
no_operation_right: 0x00010100,
no_module_right: 0x00010101,
no_interface_right: 0x00010102,
no_batch_right: 0x00010103,
no_resource_right: 0x00010104,
no_domain_right: 0x00010105,
no_datasource_right: 0x00010106,
general_error: 0x00011111,
// client error:
token_missing: 0x00000001,
wrong_password: 0x00000002,
unsupported_auth_type: 0x00000003,
auth_failed: 0x00000004,
};
......
......@@ -92,4 +92,8 @@ export const errors = {
code: errorCodes.unsupported_auth_type,
msg: `不支持的客户端验证方式:${types.join('、')}.`,
}),
generalError: msg => createError({
code: errorCodes.general_error,
msg,
}),
};
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论