RoleCheck = {};

RoleCheck.roleCheck = function(no){
    $.ajax({
        url: Common.getApiURL('HtmlWindowResourceV2/uniqueByNoAccessControl'),
        type: 'get',
        dataType: "json",
        data: {
            htmlWindowNo:no
        },
        beforeSend: function (request) {
            Common.addTokenToRequest(request);
        },
        success: function (baseObjectResponse) {
            if(baseObjectResponse.errorCode == 0){
                if(baseObjectResponse.data.hasRole != null && baseObjectResponse.data.hasRole === true){
                    console.log("有权限访问");
                }else{
                    window.location.href = '/static-eam-app/html/role/noRole.html';
                }
            }else{
                window.location.href = '/static-eam-app/html/role/noRole.html';
            }
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
            reject(new Error(XMLHttpRequest.statusText));
        }
    });
}