农夫三拳 2017-08-11 18:13:41 3977次浏览 0条评论 0 1 0

我的环境homestead
你首先得配置一个映射
首先和其他文章套路都差不多
100%成功,如果你用的homestead 等等。

//打印访问的IP
echo \Yii::$app->request->userIP;die;

进入config/web.php文件 在gii的配置数组下设置允许访问的IP
将上面的那个IP地址复制进

    $config['modules']['gii'] = [
        'class' => 'yii\gii\Module',
        // uncomment the following to add your IP if you are not connecting from localhost.
        'allowedIPs' => ['刚刚打印出来的那个IP地址', '::1',],
    ];

觉得很赞
    没有找到数据。
您需要登录后才可以评论。登录 | 立即注册