Browse Source

Merge pull request #7070 in DEC/decision-webui-dcm from release/11.0 to bugfix/11.0

* commit '479e926b1fd0194a20446e8fccfcc3baed27568f':
  无JIRA任务,更新下类型
  REPORT-90807 fix: 适配加解密改造
bugfix/11.0
superman 2 years ago
parent
commit
2a3ea89267
  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