refactor code
This commit is contained in:
parent
e581a16724
commit
9c1d3b72f3
|
@ -151,7 +151,7 @@
|
|||
},
|
||||
"rpc": {
|
||||
"error": {
|
||||
"Unauthorized": "认证失败!"
|
||||
"unauthorized": "认证失败!"
|
||||
}
|
||||
},
|
||||
"options": {
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
rpcTokenPrefix: 'token:'
|
||||
}).constant('aria2RpcErrors', {
|
||||
Unauthorized: {
|
||||
message: 'Unauthorized'
|
||||
message: 'Unauthorized',
|
||||
tipTextKey: 'rpc.error.unauthorized'
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
|
|
@ -155,7 +155,7 @@
|
|||
},
|
||||
'rpc': {
|
||||
'error': {
|
||||
'Unauthorized': 'Authorization Failed!'
|
||||
'unauthorized': 'Authorization Failed!'
|
||||
}
|
||||
},
|
||||
'options': {
|
||||
|
|
|
@ -71,8 +71,8 @@
|
|||
return false;
|
||||
}
|
||||
|
||||
if (error.message == aria2RpcErrors.Unauthorized.message) {
|
||||
ariaNgCommonService.showError('rpc.error.' + error.message);
|
||||
if (aria2RpcErrors[error.message] && aria2RpcErrors[error.message].tipTextKey) {
|
||||
ariaNgCommonService.showError(aria2RpcErrors[error.message].tipTextKey);
|
||||
return true;
|
||||
} else {
|
||||
ariaNgCommonService.showError(error.message);
|
||||
|
|
Reference in a new issue