Browse Source

Merge pull request #7071 in DEC/decision-webui-dcm from bugfix/11.0 to feature/x

* commit '2a3ea89267c1d71813a232a463405de22f482834':
  无JIRA任务,更新下类型
  REPORT-90807 fix: 适配加解密改造
feature/x
superman 2 years ago
parent
commit
942958933e
  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", "@types/jest": "24.0.11",
"@typescript-eslint/eslint-plugin": "^5.0.0", "@typescript-eslint/eslint-plugin": "^5.0.0",
"@typescript-eslint/parser": "^5.0.0", "@typescript-eslint/parser": "^5.0.0",
"axios": "0.18.0", "axios": "^0.24.0",
"babel-loader": "8.0.6", "babel-loader": "8.0.6",
"body-parser": "1.18.3", "body-parser": "1.18.3",
"chokidar": "2.1.5", "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> { export function requestPost(url: string, data = {}): Promise<ResultType> {
return new Promise(resolve => { return new Promise(resolve => {
Dec.reqPost(getFullUrl(url), data, re => { Dec.reqByEncrypt("POST", getFullUrl(url), data, re => {
resolve(re); resolve(re);
}); });
}); });
@ -23,7 +23,7 @@ export function requestPost(url: string, data = {}): Promise<ResultType> {
export function requestDelete(url: string, data = {}) { export function requestDelete(url: string, data = {}) {
return new Promise(resolve => { return new Promise(resolve => {
Dec.reqDelete(getFullUrl(url), data, re => { Dec.reqByEncrypt("DELETE", getFullUrl(url), data, re => {
resolve(re); resolve(re);
}); });
}); });
@ -31,7 +31,7 @@ export function requestDelete(url: string, data = {}) {
export function requestPut(url: string, data = {}) { export function requestPut(url: string, data = {}) {
return new Promise(resolve => { return new Promise(resolve => {
Dec.reqPut(getFullUrl(url), data, re => { Dec.reqByEncrypt("PUT", getFullUrl(url), data, re => {
resolve(re); resolve(re);
}); });
}); });

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

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

2
types/globals.d.ts vendored

@ -1,3 +1,4 @@
import type { Method, AxiosRequestConfig } from 'axios';
interface Obj { interface Obj {
[key: string]: any; [key: string]: any;
} }
@ -16,6 +17,7 @@ declare const Dec: {
personal: { personal: {
username: string; username: string;
}; };
reqByEncrypt: (method: Method, url: string, data?: any, config?: 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;

Loading…
Cancel
Save