c1513148 发表于 2018-3-14 14:38:44

修改routes.php后网站无法访问

大佬们好,事情是这样的,正常访问的网站,写了一个按钮:
$(document).ready(function () {
    $("#trans").click(function () {
                $.ajax({
                        type: "POST",
                        url: "trans",
                        dataType: "json",               
                        success: function (data) {               
                                if (data.ret) {
                                        $("#result").modal();
                                        $("#msg").html(data.msg);
                                        window.setTimeout("location.href='/user'", {$config['jump_delay']});
                                } else {
                                        $("#result").modal();
                                        $("#msg").html(data.msg);
                                }
                        },
                        error: function (jqXHR) {
                                $("#result").modal();
                $("#msg").html("发生错误:" + jqXHR.status);
                        }
                })       
        })
})

然后在routes.php里面添加了一条:

$app->group('/user', function () {   
    .
    .
    $this->post('/trans', 'App\Controllers\UserController:doTrans');
    .
    .
}

之后网站就无法访问了,删除红色代码后也无法访问,尝试重启了php环境也不行,虚心请教一下是哪里出了问题?


c1513148 发表于 2018-3-14 17:12:22

本帖最后由 c1513148 于 2018-3-14 17:28 编辑

提示”您访问的网页出错了! 网络连接异常、网站服务器失去响应” 500报错

52lin 发表于 2018-5-9 09:09:29

什么鬼??在routes里面加?
先不说其他
明显代码写错了,你不觉得少了一个);   ?
页: [1]
查看完整版本: 修改routes.php后网站无法访问