Browse Source

Merge pull request #7139 in DEC/decision-webui-dcm from final/11.0 to release/11.0

* commit 'b065c176d91d9b7d6bef29d0d0f46dcf4a4dbabb':
  无JIRA任务,修复类型错误
  REPORT-91396 fix:拼接url精准匹配:database
release/11.0
superman 2 years ago
parent
commit
ba74542f87
  1. 3
      src/modules/app.service.ts
  2. 26
      tsconfig.json
  3. 3
      types/globals.d.ts
  4. 9
      types/request.d.ts

3
src/modules/app.service.ts

@ -51,7 +51,7 @@ export function getJdbcDatabaseType(database: string, driver: string): DatabaseT
export function resolveUrlInfo(url: string, database?: string) { export function resolveUrlInfo(url: string, database?: string) {
if (BI.isNull(url)) return {}; if (BI.isNull(url)) return {};
return BI.Providers.getProvider('dec.connection.provider.datebase').getJdbcResolveByType(database)(url) || { return BI.Providers.getProvider('dec.connection.provider.datebase').getJdbcResolveByType(database)(url) || {
host: '', host: '',
port: '', port: '',
@ -77,6 +77,7 @@ export function splitUrl(host: string, port: string, database: string, baseUrl:
return baseUrl.replace('hostname', host).replace(':port', port ? `:${port}` : '') return baseUrl.replace('hostname', host).replace(':port', port ? `:${port}` : '')
.replace('/database', `/${database}`) .replace('/database', `/${database}`)
.replace(':database', `:${database}`)
.replace('dbname', database); .replace('dbname', database);
} }

26
tsconfig.json

@ -5,8 +5,8 @@
"module": "es2015", "module": "es2015",
"moduleResolution": "node", "moduleResolution": "node",
"lib": [ "lib": [
"es2017", "es2017",
"dom" "dom"
], ],
"declaration": true, "declaration": true,
"experimentalDecorators": true, "experimentalDecorators": true,
@ -21,11 +21,21 @@
"noFallthroughCasesInSwitch": true, "noFallthroughCasesInSwitch": true,
"skipLibCheck": false, "skipLibCheck": false,
"paths": { "paths": {
"ui": ["./src/ui"], "ui": [
"ReportCst": ["./private/constants"], "./src/ui"
"types": ["./types/index.d.ts"], ],
"@core/*": ["./src/modules/core/*"], "ReportCst": [
"@constants/*": ["./src/modules/constants/*"] "./private/constants"
],
"types": [
"./types/index.d.ts"
],
"@core/*": [
"./src/modules/core/*"
],
"@constants/*": [
"./src/modules/constants/*"
]
} }
}, },
"include": [ "include": [
@ -33,6 +43,6 @@
"src/**/*.ts", "src/**/*.ts",
"private/*.ts", "private/*.ts",
"private/**/*.ts", "private/**/*.ts",
"types/globals.d.ts" "types"
] ]
} }

3
types/globals.d.ts vendored

@ -1,4 +1,3 @@
import type { Method, AxiosRequestConfig } from 'axios';
interface Obj { interface Obj {
[key: string]: any; [key: string]: any;
} }
@ -17,7 +16,7 @@ declare const Dec: {
personal: { personal: {
username: string; username: string;
}; };
reqByEncrypt: (method: Method, url: string, data?: any, config?: AxiosRequestConfig) => {}, reqByEncrypt: (method: AxiosType.X_Method, url: string, data?: any, config?: AxiosType.X_AxiosRequestConfig) => {},
socketEmit: (type: string, name: string, callback: (re: any) => void) => void; socketEmit: (type: string, name: string, callback: (re: any) => void) => void;
// req // req
reqGet: RequestFunction; reqGet: RequestFunction;

9
types/request.d.ts vendored

@ -0,0 +1,9 @@
import { Method, AxiosRequestConfig } from 'axios';
declare namespace AxiosType {
type X_Method = Method
interface X_AxiosRequestConfig extends AxiosRequestConfig { }
}
export = AxiosType;
export as namespace AxiosType;
Loading…
Cancel
Save