refactor openapikey and outlink apis (#2134)

* refactor: OpenAPIKey refactor

* refactor: outlink api refactor

fix: list return wrong data

* chore: remove deprecated type definition

* chore: remove throw Error. instead of Promise.reject

* fix: auth openapikey's owner

* fix: manager could read all keys
This commit is contained in:
Finley Ge
2024-07-24 11:11:36 +08:00
committed by GitHub
parent a233ab9584
commit a478621730
12 changed files with 300 additions and 244 deletions

View File

@@ -3,7 +3,8 @@ import { ErrType } from '../errorCode';
/* dataset: 506000 */
export enum OpenApiErrEnum {
unExist = 'openapiUnExist',
unAuth = 'openapiUnAuth'
unAuth = 'openapiUnAuth',
exceedLimit = 'openapiExceedLimit'
}
const errList = [
{
@@ -13,6 +14,10 @@ const errList = [
{
statusText: OpenApiErrEnum.unAuth,
message: '无权操作该 Api Key'
},
{
statusText: OpenApiErrEnum.exceedLimit,
message: '最多 10 组 API 密钥'
}
];
export default errList.reduce((acc, cur, index) => {