Browse Source

Pull request #7062: REPORT-90807 fix: 数据连接适配加密改造

Merge in DEC/decision-webui-dcm from ~AUSTIN.DUAN/decision-webui-dcm:release/11.0 to release/11.0

* commit '3b6e365777af6b14246d0c6bf4c558fb59b60a94':
  无JIRA任务,更新下类型
  REPORT-90807 fix: 适配加解密改造
release/11.0
Austin.Duan-段嗣跃 2 years ago
parent
commit
479e926b1f
  1. 2
      package.json
  2. 6
      src/modules/crud/crud.service.ts
  3. 4
      src/modules/crud/decision.api.ts
  4. 2
      types/globals.d.ts

2
package.json

@ -20,7 +20,7 @@
"@types/jest": "24.0.11",
"@typescript-eslint/eslint-plugin": "^5.0.0",
"@typescript-eslint/parser": "^5.0.0",
"axios": "0.18.0",
"axios": "^0.24.0",
"babel-loader": "8.0.6",
"body-parser": "1.18.3",
"chokidar": "2.1.5",

6
src/modules/crud/crud.service.ts

@ -15,7 +15,7 @@ export function requestGet(url: string, data?: any): Promise<ResultType> {
export function requestPost(url: string, data = {}): Promise<ResultType> {
return new Promise(resolve => {
Dec.reqPost(getFullUrl(url), data, re => {
Dec.reqByEncrypt("POST", getFullUrl(url), data, re => {
resolve(re);
});
});
@ -23,7 +23,7 @@ export function requestPost(url: string, data = {}): Promise<ResultType> {
export function requestDelete(url: string, data = {}) {
return new Promise(resolve => {
Dec.reqDelete(getFullUrl(url), data, re => {
Dec.reqByEncrypt("DELETE", getFullUrl(url), data, re => {
resolve(re);
});
});
@ -31,7 +31,7 @@ export function requestDelete(url: string, data = {}) {
export function requestPut(url: string, data = {}) {
return new Promise(resolve => {
Dec.reqPut(getFullUrl(url), data, re => {
Dec.reqByEncrypt("PUT", getFullUrl(url), data, re => {
resolve(re);
});
});

4
src/modules/crud/decision.api.ts

@ -108,12 +108,12 @@ export class DecisionApi implements Api {
getCipher(password: string) {
return BI.Providers.getProvider('dec.provider.cipher')
.getCipher(password);
.getCompleteCipher(password);
}
getPlain(cipher: string) {
return BI.Providers.getProvider('dec.provider.cipher')
.getPlain(cipher);
.getCompletePlain(cipher);
}
getHyperlink(name: string) {

2
types/globals.d.ts vendored

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

Loading…
Cancel
Save