diff --git a/package.json b/package.json index 5431bfb..6d411c8 100644 --- a/package.json +++ b/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", diff --git a/src/modules/crud/crud.service.ts b/src/modules/crud/crud.service.ts index 19297e7..71c9604 100644 --- a/src/modules/crud/crud.service.ts +++ b/src/modules/crud/crud.service.ts @@ -15,7 +15,7 @@ export function requestGet(url: string, data?: any): Promise { export function requestPost(url: string, data = {}): Promise { 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 { 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); }); }); diff --git a/src/modules/crud/decision.api.ts b/src/modules/crud/decision.api.ts index b23c31b..a77f406 100644 --- a/src/modules/crud/decision.api.ts +++ b/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) { diff --git a/types/globals.d.ts b/types/globals.d.ts index 4d1c456..6dcba21 100644 --- a/types/globals.d.ts +++ b/types/globals.d.ts @@ -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;