当前位置: 首页 > 工具软件 > BlueKing > 使用案例 >

Blueking SaaS Ajax请求获取蓝鲸CMDB业务信息

熊烨
2023-12-01

业务展示:

 function Business() {
    $.ajax({
        url: site_url + "get_biz",
        type: "GET",
        success: function (res) {
            console.log(res)
            var html = '';
            for (let i = 0; i < res.message.length; i++) {
                html += '<option value=\'' + res.message[i].bk_biz_name + '\' >' + res.message[i].bk_biz_name + '</option>';
            }
            $("#Business").html(html);
            if (res['state'] == 'success') {
                alert("调用成功")
            } else {
                //alert(res.message)
            }
        },
        error: function (xhr, msg, e) {
            // alert(msg.toString());
            console.log(res)
        }
    });
}

 

 类似资料: