DenisN 2025-03-28 17:13:17 -04:00
parent 00b60fa455
commit ee211030ae
2 changed files with 7 additions and 11 deletions

File diff suppressed because one or more lines are too long

View File

@ -35,7 +35,7 @@ export class ConnectorsService {
//Пробуем получить данные для меню //Пробуем получить данные для меню
GetMenuData (token : string){ GetMenuData (token : string){
this.path = 'http://192.168.244.1/e-cmdb/api/query'; this.path = 'http://192.168.244.1/e-cmdb/api/query';
this.body = '{"id":["device$18"],"notNull":true,"data":{"parent":true,"children":true,"fields":["id","name"]}, "enableActions":false,"ts":1740485837813}'; this.body = '{"id":["/measures/device$18"],"data":{"links":{"flatten":true,"filter":{"cls":"measure"},"fields":["$id","id","cls","name"]}},"postQuery":"links","enableActions":false,"ts":1740060679399}';
this.options = { this.options = {
headers: {'Content-Type' : 'application/json', 'access-token' : token} headers: {'Content-Type' : 'application/json', 'access-token' : token}
}; };
@ -66,17 +66,13 @@ export class MufapiService {
} }
//Получение данных для формирования меню в МУФ //Получение данных для формирования меню в МУФ
async getMenu (path:string, body:string, headers) : Promise<string> { async getMenu (path:string, body:string, headers) : Promise<string> {
interface VksMenu { //*interface MenuController {
id: number; // name: string;
name: string; //
parent: { let resp : string = 'Zlo';
id: number;
name: string;
},
};
let resp : string = '';
await axios.post(path, body, headers).then((response)=>{ await axios.post(path, body, headers).then((response)=>{
resp = response.data; resp = response.data;
// this.token=resp.name;
//this.token = auth.access_token; //this.token = auth.access_token;
console.log(resp); console.log(resp);
}).catch((error)=>{ }).catch((error)=>{