优化后端代码质量基础
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { runtimeConfig } from '../../config/runtime.js'
|
||||
import { createHttpError } from '../../utils/http.js'
|
||||
import type { RuntimeConfig } from '../../types/runtime-config.js'
|
||||
|
||||
export const OPEN_91_PROVIDER = '91kaquan'
|
||||
export const OPEN_91_PLATFORM = 'kuaishou'
|
||||
@@ -7,10 +8,13 @@ export const OPEN_91_SUCCESS_MESSAGE = '接口调用成功'
|
||||
export const OPEN_91_DEFAULT_FAIL_CODE = 1204
|
||||
export const OPEN_91_COST_EXCEED_FAIL_CODE = 1220
|
||||
|
||||
type JsonObject = Record<string, any>
|
||||
type Open91RuntimeConfig = RuntimeConfig['platforms']['ninetyone']
|
||||
|
||||
export function getOpen91Config() {
|
||||
const config = (runtimeConfig.platforms?.ninetyone || {}) as JsonObject
|
||||
export function getOpen91Config(overrides: Partial<Open91RuntimeConfig> = {}) {
|
||||
const config = {
|
||||
...(runtimeConfig.platforms?.ninetyone || {}),
|
||||
...overrides,
|
||||
}
|
||||
|
||||
return {
|
||||
userId: String(config.userId || '').trim(),
|
||||
|
||||
Reference in New Issue
Block a user