zoukankan      html  css  js  c++  java
  • 路由重复 模块不存在

    报错

    估计是里面路由一样  由于赶项目 临时处理办法如下

     Route::get('about/', 'Index/about');//关于吉谷
            Route::get('news/:nc_id', 'News/index',  [],['nc_id' => 'd+']);
            Route::get('newsDetail/:id', 'News/detail',['ext'=>'html'], ['id' => 'd+']);
            Route::get('product/', 'Product/index');
            Route::get('join/:type', 'Index/join',  [],['type' => 'd+']);// 1 诚聘英才  2 联系我们
            Route::get('join/', 'Index/join');// 1 诚聘英才  2 联系我们
    

    解决办法  加个  判断 是否是pc  还是手机端

    strpos(strtolower(($_SERVER['HTTP_HOST'])),$MobDomain)
    $WebDomain = "www.dome.com";//pc端
    $MobDomain = "m.dome.com";//手机端
    
    
    Route::domain($WebDomain,'index');
    Route::domain($MobDomain,'mobile');
    
    
    
    
    //访问的是pc  还是手机端    解决 报错:模块不存在:mobile 
    if(strpos(strtolower(($_SERVER['HTTP_HOST'])),$MobDomain) !== false){
        Route::group(['prefix' => 'mobile/'], function () {
    //        Route::get('/', 'Index/index');
            Route::get('about/', 'Index/about');//关于吉谷
            Route::get('news/:nc_id', 'News/index',  [],['nc_id' => 'd+']);
            Route::get('newsDetail/:id', 'News/detail',['ext'=>'html'], ['id' => 'd+']);
            Route::get('product/', 'Product/index');
            Route::get('join/:type', 'Index/join',  [],['type' => 'd+']);// 1 诚聘英才  2 联系我们
            Route::get('join/', 'Index/join');// 1 诚聘英才  2 联系我们
    
        },['domain' => $MobDomain]);
    }else{
    
        Route::group(['prefix' => 'index/'], function () {
    //        Route::get('/', 'Index/index');
            Route::get('about/', 'Index/about');//关于吉谷
            Route::get('news/:nc_id', 'News/index',  [],['nc_id' => 'd+']);
            Route::get('newsDetail/:id', 'News/detail',['ext'=>'html'], ['id' => 'd+']);
            Route::get('product/', 'Product/index');
            Route::get('join/:type', 'Index/join',  [],['type' => 'd+']);// 1 诚聘英才  2 联系我们
            Route::get('join/', 'Index/join');// 1 诚聘英才  2 联系我们
    
        },['domain' => $WebDomain]);
    
    
    }
  • 相关阅读:
    C# BackGroundWorker控件演示代码
    C#多线程池演示例程下载图片
    反流技术之IE插件技术研究第二部分
    C# 从剪贴板中读取HTML中的中文字符出现乱码问题的解决方案
    C#单线程演示程序带参数
    C# 中as和is的用法总结
    Delphi关于记录文件的操作
    用PowerDesigner创建Access数据库
    常用Delphi开发资料网址
    等待外部应用程序的执行结果
  • 原文地址:https://www.cnblogs.com/wen-zi/p/9792532.html
Copyright © 2011-2022 走看看