如何在goahead Web服务器中添加动态ASP文件?

时间:2019-05-31 08:05:45

标签: javascript c

现在我需要添加一个新的菜单项及其对应的asp文件,我在项目的菜单管理信息中添加了内容,然后通过ftp上传了该asp文件,但是它不起作用,请问我在后台sql中做了什么吗?但这是用C写的,我不知道C ...

这是main.asp中的菜单部分

function recursionMenu(parent, flag) {
            var menus;
                $.ajax({
                    type : 'get',
                    url : "/action/getusermenu",
                    data :{},
                    dataType : 'json',
                    async : 'true',
                    success : function(data) {
                        menus = data;
                        var topMenus = [];
                        var parentMenus = [];
                        //获取根节点
                        for (var i = 0; i < menus.length; i++) {
                            var menu = menus[i];
                            var code = menu.f_menu_code;
                            var parent = menu.f_parent_menucode;
                            if(parent == ""){
                                topMenus.push(menus[i]);
                            }else{
                                parentMenus.push(menus[i]);
                            }
                        }
                        for(var j = 0;j < topMenus.length;j++){
                            var child =  [];
                            var ulParent = $('<ul class="sub-menu">');
                            for(var k = 0;k < parentMenus.length;k++){
                                if (topMenus[j].f_menu_code == parentMenus[k].f_parent_menucode){
                                    child.push(parentMenus[k]);
                                    var url = parentMenus[k].f_data_url+".asp";
                                    var liPparent = $("<li class='nav-item'><a target='"+url+"' title='"+topMenus[j].f_menu_name+"|"+parentMenus[k].f_menu_name+"'class='nav-link'><span class='title'>"+parentMenus[k].f_menu_name+"</span></a></li>'");
                                    ulParent.append(liPparent);
                                }
                            }

这是getusermenu动作

    int total;
    char ct[10], data[65536], *json, *role_key, *menucode, *menus;
    memset(data, 0, 2048);
    role_key = websGetSessionVar(wp, "roleid", "");
    if (opendb()){
        sprintf(sqlstr, "select * from tscu_menu m where f_menu_code in (select f_menu_code from tscu_role_menu where f_role_key = '%s') order by f_sequence", role_key);
        getDataBySQL(sqlstr);
        menus = createInnerJson();

        websSetSessionVar(wp, "menus", menus);
        sendMsgInfo(wp, menus);
    }
    else{
        sendDBOpenError(wp);
    }
    closedb();
}

0 个答案:

没有答案