1.SaaS架构单系统多应用入口路由配置

一台服务器,部署多入口应用

group(function () {
    Route::get('/cadmin',function (){
        $saas = new MySaas();
        $info = $saas->info();

        if ($info->model == 2 || $info->model == 3){
            return view('cadmin');
        }else{
            abort(404);
        }
    });

    Route::get('/home',function (){
        $saas = new MySaas();
        $info = $saas->info();
        if (!empty($info)){
            return view('home');
        }else{
            abort(404);
        }
    });

    Route::get('/shop',function (){
        $saas = new MySaas();
        $info = $saas->info();
        if (!empty($info)){
            return view('shop');
        }else{
            abort(404);
        }
    });

});

Route::get('/',function (){
    return view('help');
});

/*
 * 404 error page
 */
Route::get('/404',function (){
    return view('error.404');
});
Route::get('/40001',function (){
    return view('error.40001');
});
Route::get('/40002',function (){
    return view('error.40002');
});
Route::get('/40003',function (){
    return view('error.40003');
});

你可能感兴趣的:(java,开发语言)