Commit 1fa6a45e by lincyawer

init new project

parents
Showing with 4850 additions and 0 deletions
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
[*.{yml,yaml}]
indent_size = 2
[docker-compose.yml]
indent_size = 4
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=
BROADCAST_DRIVER=log
CACHE_DRIVER=file
FILESYSTEM_DRIVER=local
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120
MEMCACHED_HOST=127.0.0.1
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_MAILER=smtp
MAIL_HOST=mailhog
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=null
MAIL_FROM_NAME="${APP_NAME}"
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
* text=auto
*.blade.php diff=html
*.css diff=css
*.html diff=html
*.md diff=markdown
*.php diff=php
/.github export-ignore
CHANGELOG.md export-ignore
/node_modules
/public/hot
/public/storage
/storage/*.key
/vendor
.env
.env.backup
.phpunit.result.cache
docker-compose.override.yml
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
/.idea
/.vscode
php:
preset: laravel
version: 8
disabled:
- no_unused_imports
finder:
not-name:
- index.php
- server.php
js:
finder:
not-name:
- webpack.mix.js
css: true
<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400"></a></p>
<p align="center">
<a href="https://travis-ci.org/laravel/framework"><img src="https://travis-ci.org/laravel/framework.svg" alt="Build Status"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/dt/laravel/framework" alt="Total Downloads"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/v/laravel/framework" alt="Latest Stable Version"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/l/laravel/framework" alt="License"></a>
</p>
## About Laravel
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
- [Simple, fast routing engine](https://laravel.com/docs/routing).
- [Powerful dependency injection container](https://laravel.com/docs/container).
- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
- Database agnostic [schema migrations](https://laravel.com/docs/migrations).
- [Robust background job processing](https://laravel.com/docs/queues).
- [Real-time event broadcasting](https://laravel.com/docs/broadcasting).
Laravel is accessible, powerful, and provides tools required for large, robust applications.
## Learning Laravel
Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains over 1500 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
## Laravel Sponsors
We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel [Patreon page](https://patreon.com/taylorotwell).
### Premium Partners
- **[Vehikl](https://vehikl.com/)**
- **[Tighten Co.](https://tighten.co)**
- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
- **[64 Robots](https://64robots.com)**
- **[Cubet Techno Labs](https://cubettech.com)**
- **[Cyber-Duck](https://cyber-duck.co.uk)**
- **[Many](https://www.many.co.uk)**
- **[Webdock, Fast VPS Hosting](https://www.webdock.io/en)**
- **[DevSquad](https://devsquad.com)**
- **[Curotec](https://www.curotec.com/services/technologies/laravel/)**
- **[OP.GG](https://op.gg)**
- **[WebReinvent](https://webreinvent.com/?utm_source=laravel&utm_medium=github&utm_campaign=patreon-sponsors)**
- **[Lendio](https://lendio.com)**
## Contributing
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
## Code of Conduct
In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).
## Security Vulnerabilities
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed.
## License
The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
// $schedule->command('inspire')->hourly();
}
/**
* Register the commands for the application.
*
* @return void
*/
protected function commands()
{
$this->load(__DIR__.'/Commands');
require base_path('routes/console.php');
}
}
<?php
namespace App\Exceptions;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Throwable;
class Handler extends ExceptionHandler
{
/**
* A list of the exception types that are not reported.
*
* @var array<int, class-string<Throwable>>
*/
protected $dontReport = [
//
];
/**
* A list of the inputs that are never flashed for validation exceptions.
*
* @var array<int, string>
*/
protected $dontFlash = [
'current_password',
'password',
'password_confirmation',
];
/**
* Register the exception handling callbacks for the application.
*
* @return void
*/
public function register()
{
$this->reportable(function (Throwable $e) {
//
});
}
}
<?php
namespace App\Http\Controllers;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;
class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
}
<?php
namespace App\Http\Controllers;
use App\Http\Error;
use App\Http\Output;
use App\Http\Service\Cache;
use App\Http\Service\LoginService;
use App\Http\Service\UserService;
use App\Http\Service\UserTokenService;
use App\Models\user\UserInfoModel;
use App\Models\user\LoginModel;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Mail;
class LoginController extends Controller
{
const STATUS_NEED_CHANGE_PASSWD = 1;
const SKEY_LENGTH = 64;
//登录界面
public function login(Request $request)
{
$loginStatus = LoginService::checkLoginStatus($request);
$redirect = $request->input('redirect', '');
if (!empty($redirect)) {
if (!filter_var($redirect, FILTER_VALIDATE_URL) || !LoginService::isCookieDomain($redirect)) {
$redirect = '/dashboard';
}
} else {
$redirect = '/';
}
// 已登陆
if ($loginStatus["retcode"] == 0) {
return redirect($redirect);
}
return view('login.login', ['req' => ['redirect' => $redirect]]);
}
//登录接口,验证登录信息
public function checkLogin(Request $request): array
{
// 用户密码登陆
$passwd = $request->input('passwd', null);
$username = $request->input('name', null);
$remember = $request->input('remember', null);
if (empty($passwd) || strlen($passwd) != 32) {
Log::error("Bad Request: invalid passwd `$passwd`"); // 记录到日志文件
return Output::makeResult($request, Error::E_PARAM, "Bad Request: invalid passwd `$passwd`");
}
$userType = 0;
// 用户名是 邮箱
if (filter_var($username, FILTER_VALIDATE_EMAIL) !== false) {
if (!LoginService::checkEmailDomain($username)) {
Log::error("Bad Request: invalid username `$username`"); // 记录到日志文件
return Output::makeResult($request, Error::E_PARAM, "Bad Request: invalid username `$username`");
}
$userType = 1;
} else {
// 用户名是 英文
if (preg_match('/^[a-zA-Z0-9_-]+$/', $username) == 0) {
Log::error("Bad Request: invalid username `$username`"); // 记录到日志文件
return Output::makeResult($request, Error::E_PARAM, "Bad Request: invalid username `$username`");
}
$userType = 2;
}
try {
$info = UserService::getUserInfoByName($userType, $username);
if (!$info) {
Log::error("passwd or name not match"); // 记录到日志文件
return Output::makeResult($request, Error::E_NOT_MATCH, "passwd or name not match");
}
$info = $info[0];
if ($info->status != LoginController::STATUS_NEED_CHANGE_PASSWD && $info->status != 0) {
Log::error("forbidden login"); // 记录到日志文件
return Output::makeResult($request, Error::E_FORBIDDEN, "forbidden login");
}
if ($info->status == LoginController::STATUS_NEED_CHANGE_PASSWD) {
$token = UserTokenService::createToken($info->status);
return Output::makeResult($request, Error::E_RESET_PASSWD, "", $token);
}
$passwd = UserService::createPasswd($passwd, $info->slat);
if ($passwd != $info->passwd) {
$this->checkLoginFailedLimit($info);
Log::error($info->email . ":passwd or name not match"); // 记录到日志文件
return Output::makeResult($request, Error::E_NOT_MATCH, "passwd or name not match");
}
$session = self::generateSession($info->userId, $request->ip(), $info->email, $info->name, $info->engName);
if (!$session) {
Log::error("unknown server error"); // 记录到日志文件
return Output::makeResult($request, Error::E_SERVER, "unknow server error, try again");
}
$this->setLoginCookie($session['userId'], $session['skey'], $info->header,
$remember ? strtotime($session['expireTime']) : 0);
$this->delLoginFailed($info->userId); // 登录成功后删除错误次数
return Output::makeResult($request, 0, 'OK', ['userId' => $info->userId, 'skey' => $session['skey']]);
} catch (\Exception $e) {
Log::error("unknown server error: " . $e->getMessage()); // 记录到日志文件
return Output::makeResult($request, Error::E_SERVER,
"unknown server error: " . $e->getMessage() . ", try again");
}
}
private static function generateSession($userId, $userIp, $email, $name, $engName)
{
$info = [
'userId' => $userId,
'skey' => self::createSkey(),
'loginTime' => date('Y-m-d H:i:s'),
'expireTime' => date('Y-m-d H:i:s', time() + self::expireTime()),
'loginIp' => $userIp,
];
$ret = self::saveSkey($info, $email, $name, $engName);
if (!$ret) {
return false;
}
return $info;
}
private static function saveSkey($info, $email, $name = '', $engName = '')
{
try {
LoginModel::insertData($info);
} catch (\Exception $e) {
Log::error("save skey failed: skey = `" . json_encode($info) . '`, error ' . $e->getMessage());
}
$info['email'] = $email;
$info['name'] = $name;
$info['engName'] = $engName;
return self::saveToRedis($info);
}
private static function createSkey(): string
{
return bin2hex(openssl_random_pseudo_bytes(self::SKEY_LENGTH));
}
private static function expireTime(): int
{
$expire = Config::get('website.skeyExpire');
return $expire ? $expire : 3600 * 12;
}
private static function saveToRedis($info, $expire = 0)
{
$key = LoginService::sessionKey($info['userId'], $info['skey']); // 32个字节足够了
if ($expire == 0) {
$expire = strtotime($info['expireTime']) - time();
}
if ($expire <= 0) {
$expire = 7200;
}
return Cache::getRedis()->setex($key, $expire, json_encode($info));
}
private function setLoginCookie($userId, $skey, $header, $expire)
{
$domain = Config::get('website.cookieDomain');
$allow_domain_list = explode(",", $domain);
foreach ($allow_domain_list as $allow_domain) {
if (strpos(request()->getHost(), $allow_domain) !== false) {
if ($userId !== null) {
setcookie('oa_user_id', $userId, $expire, '/', $allow_domain);
}
if ($skey !== null) {
setcookie('oa_skey', $skey, $expire, '/', $allow_domain);
}
if ($header !== null) {
setcookie('oa_header', $header, $expire, '/', $allow_domain);
}
}
}
}
// 删除登录错误次数
private function delLoginFailed($userId)
{
$key = "LOGIN-FAILED-" . $userId;
$ret = Cache::getRedis()->get($key);
if ($ret) {
Cache::getRedis()->del($key);
}
}
// 检查登录错误次数
private function checkLoginFailedLimit($info)
{
$expire = 24 * 3600;
$key = "LOGIN-FAILED-" . $info->userId;
$ret = Cache::getRedis()->get($key);
$wrongTimes = 1;
if (!$ret) {
Cache::getRedis()->setex($key, $expire, $wrongTimes);
} else {
$wrongTimes = $ret + 1;
Cache::getRedis()->set($key, $wrongTimes);
}
$name = $info->engName;
$email = $info->email;
assert(!empty($email));
// 只做邮件提醒
$maxTimes = Config::get('website.maxPasswdIncorrectTimes', 3); // 3 30 90
// if ($wrongTimes == $maxTimes || $wrongTimes == 10 * $maxTimes || $wrongTimes == 30 * $maxTimes) {
if ($wrongTimes == $maxTimes) {
$body = "您的账号24小时内已错误登录{$wrongTimes}次, 为了您的账号安全,请尽快更改密码。";
Mail::raw($body, function ($message) use ($email, $name) {
$message->to($email, $name)->subject('账号登陆错误');
});
}
}
}
<?php
namespace App\Http\Controllers;
use App\Http\Service\DepartmentService;
use App\Http\Service\PermService;
use App\Http\Service\UserService;
use App\Models\user\DepartmentModel;
use App\Models\user\PositionModel;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Config;
class UserController extends Controller
{
public function my(Request $req, $userId = 0)
{
$user = $req->getUserResolver()();
if ($userId == 0) {
$userId = $user->userId;
}
// 获取用户角色,用户权限
$userRole = PermService::getUserRole($req);
$userPerms = PermService::getUserAllPerms($userId, $userRole); // 用户权限
// 默认管理员账号或管理、经理、技术、产品权限
$isAdmin = in_array($user->email, Config::get('website.admin')) || in_array($userRole,
[1, 2, 3, 4]);
// 非本人账号、非管理员、无编辑权限
$isLimit = ($user->userId != $userId && !$isAdmin && !in_array('user_userlist_edit', $userPerms));
$user_info = UserService::getUserInfo($userId, $isLimit);
if (!$user_info) {
abort(404);
}
$data = [
'active' => "my",
'title' => '用户信息',
'userId' => $userId,
'isAdmin' => $isAdmin,
'userPerms' => $userPerms,
'role' => $userRole,
'limitInfo' => (bool)$isLimit,
'userInfo' => $user_info,
'position' => PositionModel::getPositionNameMap(),
'department_html' => DepartmentService::getDepartmentHtml(),
'paths' => [
['href' => '/userlist', 'title' => '帐号列表'],
['href' => '/info/' . $userId, 'title' => '用户信息']
],
];
setcookie('crsf_token', bin2hex(openssl_random_pseudo_bytes(16)), 0, '/');
return view('user.info', $data);
}
}
<?php
namespace App\Http;
class Error
{
const E_RESET_PASSWD= -1; // 需要重置密码
const E_PARAM = -10001; // 参数错误
const E_SERVER = -10002; // 服务器错误
const E_NOT_MATCH = -10003; // 帐号不匹配存在
const E_FORBIDDEN = -10004; // 权限限制
const E_STATUS = -10005; // 数据状态不一致
const E_AUDIT_EXIST = -10006; // 有相同的权限申请
const E_NOT_LOGIN = -10007; // 未登陆
const E_DUP = -10008; // email,name重复
const E_NOT_EXISTS = -10009; // 不存在
const E_NO_ACCESS = -10010; // 无权访问
};
<?php
/** 公用函数 */
namespace App\Http;
//导出数据
class Functions {
function exportExcel($expTitle, $expCellName, $expTableData)
{
$xlsTitle = iconv('utf-8', 'gb2312', $expTitle);//文件名称
$fileName = $expTitle . date('_YmdHis');//or $xlsTitle 文件名称可根据自己情况设定
$cellNum = count($expCellName);
$dataNum = count($expTableData);
// vendor("PHPExcel.PHPExcel");
$objPHPExcel = new PHPExcel();
include_once(__DIR__ . "/../../vendor/PHPExcel/PHPExcel/IOFactory.php");
set_time_limit(0);//不对php(主要是写数据)执行时间做限制
ini_set("memory_limit", "1024M");//设置内存(防爆内存)
$cacheMethod = \PHPExcel_CachedObjectStorageFactory::cache_in_memory_serialized;//设置缓存策略(减少内存占用)
//判断缓存策略是否可用
if (!\PHPExcel_Settings::setCacheStorageMethod($cacheMethod)) {
die($cacheMethod . " 缓存方法不可用" . EOL);
}
$cellName = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'AA', 'AB', 'AC', 'AD', 'AE', 'AF', 'AG', 'AH', 'AI', 'AJ', 'AK', 'AL', 'AM', 'AN', 'AO', 'AP', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AV', 'AW', 'AX', 'AY', 'AZ');
//显示导出名称和导出时间
// $objPHPExcel->getActiveSheet(0)->mergeCells('A1:'.$cellName[$cellNum-1].'1');//合并单元格
// $objPHPExcel->setActiveSheetIndex(0)->setCellValue('A1', $expTitle.' 导出时间:'.date('Y-m-d H:i:s'));
for ($i = 0; $i < $cellNum; $i++) {
$objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellName[$i] . '1', $expCellName[$i][1]);
}
// Miscellaneous glyphs, UTF-8
for ($i = 0; $i < $dataNum; $i++) {
for ($j = 0; $j < $cellNum; $j++) {
$objPHPExcel->getActiveSheet(0)->setCellValue($cellName[$j] . ($i + 2), $expTableData[$i][$expCellName[$j][0]]);
}
}
header('pragma:public');
header('Content-type:application/vnd.ms-excel;charset=utf-8;name="' . $xlsTitle . '.csv"');
header("Content-Disposition:attachment;filename=$fileName.csv");//attachment新窗口打印inline本窗口打印
//输出bom
print(chr(0xEF) . chr(0xBB) . chr(0xBF));
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'CSV');
$objWriter->save('php://output');
exit;
}
// curl
public static function curlApi($url, $params = array(), $method = 'GET', $multi = false, $extheaders = array())
{
if (!function_exists('curl_init')) exit('Need to open the curl extension');
$method = strtoupper($method);
$ci = curl_init();
curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, 3);
curl_setopt($ci, CURLOPT_TIMEOUT, 3);
curl_setopt($ci, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ci, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ci, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ci, CURLOPT_HEADER, false);
$headers = (array)$extheaders;
switch ($method) {
case 'POST':
curl_setopt($ci, CURLOPT_POST, TRUE);
if (!empty($params)) {
if ($multi) {
foreach ($multi as $key => $file) {
$params[$key] = '@' . $file;
}
curl_setopt($ci, CURLOPT_POSTFIELDS, $params);
$headers[] = 'Expect: ';
} else {
curl_setopt($ci, CURLOPT_POSTFIELDS, http_build_query($params));
}
}
break;
case 'DELETE':
case 'GET':
$method == 'DELETE' && curl_setopt($ci, CURLOPT_CUSTOMREQUEST, 'DELETE');
if (!empty($params)) {
$url = $url . (strpos($url, '?') ? '&' : '?')
. (is_array($params) ? http_build_query($params) : $params);
}
break;
}
curl_setopt($ci, CURLINFO_HEADER_OUT, TRUE);
curl_setopt($ci, CURLOPT_URL, $url);
if ($headers) {
curl_setopt($ci, CURLOPT_HTTPHEADER, $headers);
}
$response = curl_exec($ci);
curl_close($ci);
return $response;
}
//上传文件接口签名
public static function Autograph()
{
$url = Config('website.api_domain');
$data['k1'] = time();
$data['k2'] = MD5(MD5($data['k1']) . Config('website.upload_key'));
return '<script>
k1="' . $data['k1'] . '";
k2="' . $data['k2'] . '";
UploadImgUrl="' . $url . '"
</script>';
}
// 系统菜单
function Crumbs($menus, $uri)
{
$actives = [];
CheckActive($menus, $actives, $uri);
$ret = '';
foreach ($actives as $k => $v) {
if ($k == count($actives) - 1) {
$ret .= '<li class="active"><a>' . $menus[$actives[0]]->childs[$actives[1]]->title . '</a></li>';
} else {
$ret .= '<li><a href="#">' . $menus[$actives[0]]->title . '</a></li>';
}
}
return $ret;
}
/**
* 当前路由所在的菜单key值
* @param [type] $menus [系统菜单]
* @param [type] &$arr [存储当前路由所在的菜单key值]
* @param [type] $url [当前路由]
*/
static function CheckActive($menus, &$arr, $url)
{
for ($i = 0; $i < count($menus); $i++) {
$menu = $menus[$i];
array_push($arr, $i); // 插入当前菜单key值
if (isset($menu->href) && ($menu->href == $url || ($menu->href == '/' && $url == '//')))
return true;
if (isset($menu->childs) && count($menu->childs) > 0) { // 多级菜单递归查找
$ret = CheckActive($menu->childs, $arr, $url);
if ($ret)
return $ret;
}
array_pop($arr); // 删除最后插入的菜单key值
}
return false;
}
public static function createMenuReal($menus, $active, $level)
{
$subclass = ($level == 0) ? 'nav-second-level' : 'nav-third-level';
$ret = '';
for ($ii = 0; $ii < ($level == 0 ? 1 : 2); $ii++) {
for ($i = 0; $i < count($menus); $i++) {
$menu = $menus[$i];
$act = (count($active) > $level && $active[$level] == $i) ? true : false;
$actclass = $act ? ' class="active"' : '';
$actmenu = $act ? ' in' : '';
if (isset($menu->childs) && count($menu->childs) > 0) {
if ($ii != 0 && $level > 0)
continue;
$ret .= '<li' . $actclass . '><a><i class="'
. $menu->class . '"></i><span class="nav-label">'
. $menu->title . '</span><span class="fa arrow"></span></a>'
. '<ul class="nav ' . $subclass . ' collapse' . $actmenu . '">'
. \App\Http\Functions::createMenuReal($menu->childs, $act ? $active : [], $level + 1)
. '</ul></li>';
} else {
if ($ii != 1 && $level > 0)
continue;
$ret .= '<li' . $actclass . '><a href="' . $menu->href . '"><i class="' .
$menu->class . '"></i><span class="nav-label">' . $menu->title . '</span></a></li>';
}
}
}
return $ret;
}
public static function createMenu($menus, $url)
{
$actives = [];
$ret = self::CheckActive($menus, $actives, $url);
if (!$ret)
$actives = [];
return self::createMenuReal($menus, $actives, 0);
}
/**
* @param string $url
* @param array|bool $params
* @param int|bool $ispost
* @param array $header
* @return bool|mixed
*/
function curl($url, $params = false, $ispost = 0, $header = [], &$httpInfo = [])
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36');
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); // 对认证证书来源的检查
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); // 从证书中检查SSL加密算法是否存在
if (!empty($header)) {
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
}
if (is_array($params)) {
$result = array_filter($params, function ($v) {
return is_object($v) && get_class($v) == 'CURLFile';
});
if (empty($result)) {
$params = http_build_query($params);
}
}
if ($ispost) {
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_URL, $url);
} else {
if ($params) {
curl_setopt($ch, CURLOPT_URL, $url . '?' . $params);
} else {
curl_setopt($ch, CURLOPT_URL, $url);
}
}
$response = curl_exec($ch);
$httpInfo = curl_getinfo($ch);
if ($response === FALSE) {
// echo "cURL Error: " . curl_error($ch);
return false;
}
curl_close($ch);
return $response;
}
}
<?php
namespace App\Http;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel
{
/**
* The application's global HTTP middleware stack.
*
* These middleware are run during every request to your application.
*
* @var array<int, class-string|string>
*/
protected $middleware = [
// \App\Http\Middleware\TrustHosts::class,
\App\Http\Middleware\TrustProxies::class,
\Fruitcake\Cors\HandleCors::class,
\App\Http\Middleware\PreventRequestsDuringMaintenance::class,
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\App\Http\Middleware\TrimStrings::class,
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
];
/**
* The application's route middleware groups.
*
* @var array<string, array<int, class-string|string>>
*/
protected $middlewareGroups = [
'web' => [
\App\Http\Middleware\CheckLogin::class,
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
// \Illuminate\Session\Middleware\AuthenticateSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
'api' => [
// \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
'throttle:api',
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
'noauth' => [],
];
/**
* The application's route middleware.
*
* These middleware may be assigned to groups or used individually.
*
* @var array<string, class-string|string>
*/
protected $routeMiddleware = [
'auth' => \App\Http\Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
'can' => \Illuminate\Auth\Middleware\Authorize::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
];
}
<?php
namespace App\Http\Middleware;
use Illuminate\Auth\Middleware\Authenticate as Middleware;
class Authenticate extends Middleware
{
/**
* Get the path the user should be redirected to when they are not authenticated.
*
* @param \Illuminate\Http\Request $request
* @return string|null
*/
protected function redirectTo($request)
{
if (! $request->expectsJson()) {
return route('login');
}
}
}
<?php
namespace App\Http\Middleware;
use App\Http\Error;
use App\Http\Output;
use App\Http\Service\LoginService;
use App\Http\Service\PermService;
use Closure;
use App\Http\Controllers\LoginController;
use Illuminate\Support\Facades\Log;
class CheckLogin
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
$isApi = false;
if (strpos($request->path(), 'api/') === 0)
$isApi = true;
$ret = LoginService::checkLoginStatus($request);
if ($ret["retcode"] != 0) {
if ($isApi) {
Log::error("not login");
return Output::makeResult($request, Error::E_NOT_LOGIN, "not login");
}
return redirect('/login' . '?redirect=' . urlencode($request->url()));
}
$user = (object)$ret['data'];
$user->header = $request->cookie('oa_header');
// $request->user= $user;
$request->setUserResolver(function () use ($user) {
return $user;
});
// 用户默认可以登录 dashboard, 展示个人信息,修改个人信息
if (in_array($request->path(), ['/', 'dashboard', 'my', 'api/update'])){
return $next($request);
}
// 若是搜索关键词(用户),则不判断权限
if (!preg_match('/api\/search/', $request->path())) {
// 判断用户访问权限
$access = PermService::checkAccess($request);
if (!$access) {
return view('no_access', ['bid'=>43]); // 返回无权限模板
}
}
return $next($request);
}
}
<?php
namespace App\Http\Middleware;
use Illuminate\Cookie\Middleware\EncryptCookies as Middleware;
class EncryptCookies extends Middleware
{
/**
* The names of the cookies that should not be encrypted.
*
* @var array<int, string>
*/
protected $except = [
//
];
}
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance as Middleware;
class PreventRequestsDuringMaintenance extends Middleware
{
/**
* The URIs that should be reachable while maintenance mode is enabled.
*
* @var array<int, string>
*/
protected $except = [
//
];
}
<?php
namespace App\Http\Middleware;
use App\Providers\RouteServiceProvider;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
class RedirectIfAuthenticated
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
* @param string|null ...$guards
* @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
*/
public function handle(Request $request, Closure $next, ...$guards)
{
$guards = empty($guards) ? [null] : $guards;
foreach ($guards as $guard) {
if (Auth::guard($guard)->check()) {
return redirect(RouteServiceProvider::HOME);
}
}
return $next($request);
}
}
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;
class TrimStrings extends Middleware
{
/**
* The names of the attributes that should not be trimmed.
*
* @var array<int, string>
*/
protected $except = [
'current_password',
'password',
'password_confirmation',
];
}
<?php
namespace App\Http\Middleware;
use Illuminate\Http\Middleware\TrustHosts as Middleware;
class TrustHosts extends Middleware
{
/**
* Get the host patterns that should be trusted.
*
* @return array<int, string|null>
*/
public function hosts()
{
return [
$this->allSubdomainsOfApplicationUrl(),
];
}
}
<?php
namespace App\Http\Middleware;
use Illuminate\Http\Middleware\TrustProxies as Middleware;
use Illuminate\Http\Request;
class TrustProxies extends Middleware
{
/**
* The trusted proxies for this application.
*
* @var array<int, string>|string|null
*/
protected $proxies;
/**
* The headers that should be used to detect proxies.
*
* @var int
*/
protected $headers =
Request::HEADER_X_FORWARDED_FOR |
Request::HEADER_X_FORWARDED_HOST |
Request::HEADER_X_FORWARDED_PORT |
Request::HEADER_X_FORWARDED_PROTO |
Request::HEADER_X_FORWARDED_AWS_ELB;
}
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
class VerifyCsrfToken extends Middleware
{
/**
* The URIs that should be excluded from CSRF verification.
*
* @var array<int, string>
*/
protected $except = [
//
];
}
<?php
namespace App\Http;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
class Output
{
public static function makeResult(Request $req, $retcode, $errmsg=null, $data=null)
{
$ret = [ 'retcode' => $retcode ];
if ($errmsg !== null)
$ret['errMsg'] = $errmsg;
if ($data !== null)
$ret['data'] = $data;
if ($retcode != 0)
Log::error("path=`/" . $req->path() . "`, retcode=`{$retcode}`, errmsg=`{$errmsg}`, param=`" . json_encode($req->all()) . "`");
return $ret;
}
};
<?php
namespace App\Http\Service;
use Illuminate\Support\Facades\Redis;
class Cache
{
public static function getRedis()
{
return Redis::connection()->client();
}
}
<?php
namespace App\Http\Service;
use App\Models\user\DepartmentModel;
class DepartmentService
{
// 获取菜单
public static function getDepartmentHtml()
{
$department_id_name_parentId_list = DepartmentModel::getDepartmentIdNameParentIdList();
$department_tree = self::generateTree($department_id_name_parentId_list);
return self::makeDepartmentHtml($department_tree);
}
// 部门添加html
private static function makeDepartmentHtml($tree)
{
$html = '';
foreach ($tree as $v) {
$subClass = isset($v['_child']) ? 'class="dropdown-submenu"' : '';
if (isset($v['_child'])) {
$html .= '<li ' . $subClass . '>'
. '<a tabindex="-1" data-id="' . $v['department_id'] . '">' . $v['department_name'] . '</a>
<ul class="dropdown-menu">'
. self::makeDepartmentHtml($v['_child'])
. '</a></ul></li>';
} else {
$html .= '<li ' . $subClass . '><a data-id="' . $v['department_id'] . '">' . $v['department_name'] . '</a></li>';
}
}
return $html;
}
// 转换部门tree
private static function generateTree($list, $pk = 'department_id', $pid = 'parent_id', $child = '_child', $root = 0)
{
$department_tree = array();
$packData = array();
foreach ($list as $data) {
$packData[$data[$pk]] = $data;
}
foreach ($packData as $key => $val) {
if ($val[$pid] == $root) { //代表跟节点
$department_tree[] = &$packData[$key];
} else { //找到其父类
$packData[$val[$pid]][$child][] = &$packData[$key];
}
}
return $department_tree;
}
// 获取下级部门ID
public static function getSubDepartmentId($department_id, &$department_ids)
{
// 获取下级部门
$sub_department = DepartmentModel::getDepartmentIdWithNameList($department_id);
if ($sub_department) {
foreach ($sub_department as $v) {
self::getSubDepartmentId($v->department_id, $department_ids);
}
}
$department_ids[] = $department_id;
return $department_ids;
}
// 获取最顶层部门id
public static function getRootDepartmentId($department_id)
{
if (empty($department_id)) {
return $department_id;
}
$department_info = DepartmentModel::getDepartmentById($department_id);
if ($department_info['parent_id']) {
return self::getRootDepartmentId($department_info['parent_id']);
}
return ($department_info) ? $department_info['department_id'] : 0;
}
}
<?php
namespace App\Http\Service;
use App\Http\Error;
use App\Http\Output;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Log;
class LoginService{
public static function checkEmailDomain($email)
{
return substr($email, 1 + strpos($email, '@')) == Config::get('website.emailDomain');
}
public static function checkLoginStatus(Request $request): array
{
$skey = $request->cookie('oa_skey');
$userId = $request->cookie('oa_user_id');
try {
$info = self::checkSession($userId, $skey);
if (!$info) {
Log::error("not login, oa_user_id:{$userId}");
return Output::makeResult($request, Error::E_NOT_LOGIN, "not login");
}
unset($info['skey']);
return Output::makeResult($request, 0, null, $info);
} catch (\Exception $e) {
Log::error("unknown server error: " . $e->getMessage());
return Output::makeResult($request, Error::E_SERVER,
"unknown server error: " . $e->getMessage() . ", try again");
}
}
public static function checkSession($userId, $skey)
{
$sKey = null;
try {
$key = self::sessionKey($userId, $skey);
$sKey = Cache::getRedis()->get($key);
}catch (\Exception $e){
Log::error($e);
}
if ($sKey === null) {
return null;
}
$jsonResult = json_decode($sKey, true);
if (!$jsonResult) {
return null;
}
if ($jsonResult['skey'] != $skey) {
return null;
}
if (strtotime($jsonResult['expireTime']) < time()) {
return null;
}
return $jsonResult;
}
public static function sessionKey($userId, $skey): string
{
return $userId . ':' . substr($skey, 0, 8); // 8个字节足够了; 一个用户的空间范围内冲突概率很低
}
public static function isCookieDomain($url): bool
{
$domain_info = parse_url($url);
$domain = Config::get('website.cookieDomain');
$allow_domain_list = explode(",", $domain);
foreach ($allow_domain_list as $allow_domain) {
if (strpos($domain_info['host'], $allow_domain) !== false) {
return true;
}
}
return false;
}
}
<?php
namespace App\Http\Service;
use App\Models\config\ConfigModel;
class MenuService
{
// 获取菜单
public static function getMenu()
{
// 菜单
$menu_config = ConfigModel::getConfigTitle();
$menus = [];
if ($menu_config && !($menus = json_decode($menu_config->config_data))) {
$menus = [];
}
// 用户角色
$user_role = PermService::getUserRole(request());
// 获取权限菜单
if ($user_role != 1) {
$menus = PermService::getMenuPerm($menus, request()->user->userId);
}
// 当用户没有权限的时候,默认可以查看dashboard,个人信息,修改密码菜单
if (empty($menus)) {
$menus_json = '[{"title":"dashboard","href":"\/dashboard","class":"fa fa-dashboard","childs":[]},{"title":"\u6211\u7684\u4fe1\u606f","href":"\/my","class":"fa fa-table","childs":[]},{"title":"\u4fee\u6539\u5bc6\u7801","href":"\/resetpasswd","class":"fa fa-vine","childs":[]}]';
$menus = json_decode($menus_json);
}
return $menus;
}
}
<?php
namespace App\Http\Service;
use App\Models\user\TBusinessConfigModel;
use App\Models\user\TRolePermModel;
use App\Models\user\TUserPermModel;
use Illuminate\Http\Request;
class PermService
{
protected static $roles = [
'经理' => 2,
'技术' => 3,
'产品' => 4,
'运营' => 5,
'销售' => 6,
'客服' => 7,
'采购' => 8,
'行政' => 9,
];
// 检查用户是否具有系统访问权限
public static function checkAccess($request): bool
{
$user_id = $request->user->userId;
$role = self::getUserRole($request);
if ($role == 1) {
return true;
} // 超级管理员或系统管理员直接进入
$userPerms = self::getUserAllPerms($user_id, $role);
if (!$userPerms) {
return false;
}
if (in_array('apply_access', $userPerms)) {
return true;
} // 访问权限ID是否存在
return false;
}
// 获取用户角色:1-管理员,0-用户
public static function getUserRole(Request $request): int
{
$user = $request->getUserResolver()();
$uid = $user->userId;
$email = $user->email;
if ($email == 'admin@ichunt.com') {
return 1;
}
$business = TBusinessConfigModel::getBusinessInfoByTitle('内部用户管理系统');
if ($business) {
$bid = $business->bid;
// 权限系统配置的管理帐号
$admin_account = json_decode($business->admin, true);
if (in_array($email, $admin_account)) {
return 1;
}
// 根据用户ID和业务ID查看角色
$user_perm = TUserPermModel::getUserIdBid($uid, $bid);
if (empty($user_perm)) {
return 0;
} else {
if ($user_perm->roles == 'null') {
return 0;
}
$role = json_decode($user_perm->roles, true);
foreach ($role as $role_id) {
$role_info = TRolePermModel::getRoleInfoByRoleIdAndBid($role_id, $bid);
if ($role_info) {
return in_array($role_info->name, array_keys(self::$roles)) ? array_get(self::$roles,
$role_info->name) : 0;
}
}
}
}
return 0;
}
// 获取用户所有权限
public static function getUserAllPerms($user_id, $role = 0)
{
// 根据域名查询系统业务ID
$business = TBusinessConfigModel::getBusinessInfoByTitle('内部用户管理系统');
if ($business) {
if ($role != 1) {
$bid = $business->bid;
$url = Config('website.perm_api') . $user_id . '/' . $bid;
$user_perms = json_decode(\App\Http\Functions::curlApi($url), true);
if ($user_perms && $user_perms['retcode'] == 0) {
return $user_perms['data']['perms'];
}
} else { // 获取管理员所有权限
return self::getAllPerms(json_decode($business->configs, true));
}
}
return [];
}
// 获取系统配置权限
public static function getAllPerms($configs)
{
$perms = [];
foreach ($configs as $k => $v) {
$perm_a = [];
$perm_b = [];
if (isset($v['childs']) && count($v['childs']) > 0) {
$perm_b = self::getAllPerms($v['childs']);
} else {
$perm_a[] = $v['permId'];
}
$perms = array_merge($perms, array_merge($perm_a, $perm_b));
}
return $perms;
}
// 处理菜单
public static function handleMenus($menus, $perms)
{
foreach ($menus as $k => $v) {
if (strlen($v->href) > 2) {
if (preg_match('/\/intracode\//', $v->href)) {
$perm_id = str_replace('/intracode/', '', $v->href);
} else {
if (preg_match('/\/role\//', $v->href)) {
$perm_id = str_replace('/role/', '', $v->href);
} else {
if (preg_match('/\/web\//', $v->href)) {
$perm_id = str_replace('/web/', '', $v->href);
} else {
$perm_id = str_replace('/', '', $v->href);
}
}
}
// 查看菜单权限
$perm_id = 'user_' . $perm_id . '_check';
if (!in_array($perm_id, $perms)) {
unset($menus[$k]);
}
}
if (count($v->childs) > 0) {
$menus[$k]->childs = array_values(self::handleMenus($v->childs, $perms));
if (empty($menus[$k]->childs)) {
unset($menus[$k]);
}
}
}
return array_values($menus);
}
// 获取权限菜单
public static function getMenuPerm($menus, $user_id)
{
$user_perms = PermService::getUserAllPerms($user_id);
if ($user_perms) {
return self::handleMenus($menus, $user_perms);
}
return false;
}
}
<?php
namespace App\Http\Service;
use App\Models\user\UserInfoModel;
use App\Models\user\UserModel;
class UserService
{
const SLAT_LENGTH = 32; // 用户密码加盐的随机数
const TABLE_NAME = 'user'; // 表名
public static function createSlat()
{
return base64_encode(openssl_random_pseudo_bytes(self::SLAT_LENGTH));
}
public static function createPasswd($passwd, $slat)
{
return hash('sha256', md5($passwd) . $slat);
}
public static function getUserInfo($userId, $isLimit)
{
$user_info = UserInfoModel::getNameWithEngNameMap($userId);
// UserInfoModel::getUsersByIds($userId);
// var_dump($user_info);exit();
if ($isLimit) {
unset($user_info->idCard);
unset($user_info->birthday);
unset($user_info->sex);
unset($user_info->abo);
unset($user_info->emergencyPeople);
unset($user_info->emergencyPhone);
unset($user_info->address);
}
$supTitle = $user_info->sup_engName;
if (!empty($user_info->sup_name)) {
$supTitle = $supTitle . '(' . $user_info->sup_name . ')';
}
unset($user_info->sup_engName);
unset($user_info->sup_name);
$user_info->supTitle = $supTitle;
return $user_info;
}
public static function getUserListMapByIds($user_ids)
{
$user_list = UserInfoModel::getUsersByIds($user_ids);
$user_list_map = [];
if ($user_list) {
$user_list_map = array_column($user_list, null, 'userId');
}
return $user_list_map;
}
public static function getUserInfoByName($type, $name)
{
$userInfo = UserInfoModel::QueryWhere([
[
($type == 1) ? 'email' : 'engName',
'=',
$name,
],
[
'status',
'<>',
'4',
]
]);
if (!$userInfo) {
return [];
}
$metaUser = UserModel::QueryWhere([
[
'userId',
'=',
$userInfo[0]->userId,
]
]);
if (!$metaUser) {
return [];
}
$userInfo[0]->passwd = $metaUser[0]->passwd;
$userInfo[0]->slat = $metaUser[0]->slat;
$userInfo[0]->status = $metaUser[0]->status;
return $userInfo;
}
}
<?php
namespace App\Http\Service;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\DB;
class UserTokenService{
const TOKEN_RESET_PASSWD_FORCE = 1;
const TOKEN_RESET_PASSWD_EMAIL = 2;
const TABLE_NAME = 'user_token';
const TOKEN_LENGTH = 64; // token的随机数字节数; base64之后是 TOKEN_LENGTH * 2
public static function __createToken()
{
return bin2hex(openssl_random_pseudo_bytes(self::TOKEN_LENGTH));
}
public static function getExpire()
{
$expire = Config::get('website.tokenExpire');
return empty($expire) ? 86400 : $expire;
}
public static function createToken($userId, $expire = null)
{
$now = date('Y-m-d H:i:s');
if ($expire === null) {
$expire = self::getExpire();
}
$data = [
'userId' => $userId,
'token' => self::__createToken(),
'expireTime' => date('Y-m-d H:i:s', time() + $expire),
'status' => 0,
'ctime' => $now,
'mtime' => $now
];
$ret = DB::table(self::TABLE_NAME)->insert($data);
if (!$ret) {
return false;
}
return $data;
}
public static function setTokenStatus($userId, $token, $status)
{
return DB::table(self::TABLE_NAME)->where('userId', $userId)
->where('token', $token)->update(['status' => $status, 'mtime' => date('Y-m-d H:i:s')]);
}
public static function checkToken($userId, $token)
{
$count = DB::table(self::TABLE_NAME)->where('userId', $userId)
->where('status', 0)->where('token', $token)
->where('expireTime', '>=', date('Y-m-d H:i:s'))->count();
return $count == 1;
}
}
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class CommonModel extends Model
{
}
<?php
namespace App\Models\config;
use Illuminate\Database\Eloquent\Model;
class ConfigModel extends Model
{
protected $table = 'config';
protected $primaryKey = 'config_id';
const CREATED_AT = 'ctime';
const UPDATED_AT = 'mtime';
public static function getConfigTitle()
{
return self::where('config_title', '账号管理系统')->first();
}
}
<?php
namespace App\Models\user;
use App\Models\CommonModel;
class DepartmentModel extends CommonModel
{
protected $table = 'user_department';
protected $primaryKey = 'department_id';
protected $guarded = ['department_id'];
// protected $fillable = ['department_name', 'author', 'last_author'];
const CREATED_AT = 'ctime';
const UPDATED_AT = 'mtime';
public static function getDepartmentListByIds($ids)
{
$res = self::whereIn('department_id', $ids)->get();
return ($res) ? $res->toArray() : [];
}
public static function countDepartmentId($departmentId)
{
return self::where('parent', $departmentId)->count();
}
public static function deleteDepartmentId($departmentId)
{
self::where('department_id', $departmentId)->delete();
}
public static function getDepartmentIdWithNameList($department_id)
{
return self::where('parent_id', $department_id)->select('department_id', 'department_name')->get();
}
public static function getDepartmentIdWithNameMap()
{
return self::pluck('department_name', 'department_id');
}
public static function getDepartmentIdList($department_id)
{
return self::where('department_id', $department_id)->first();
}
// 根据部门id,获取部门信息
public static function getDepartmentById($department_id)
{
$res = self::where('department_id', $department_id)->first();
return ($res) ? $res->toArray() : [];
}
public static function getDepartmentNameWithIdList($map = '')
{
if ($map) {
return self::where($map)->pluck('department_name', 'department_id')->toArray();
}
return self::pluck('department_name', 'department_id')->toArray();
}
public static function getExistDepartmentIdsByIds($depart_ids)
{
return self::whereIn('department_id', $depart_ids)
->select(['department_name', 'department_id'])
->get()
->pluck(['department_id'])->toArray();
}
public static function getDepartmentNameList($department_name)
{
return self::where('department_name', $department_name)->first();
}
public static function updateDataByDepartmentId($departmentId, $data)
{
return self::where('department_id', $departmentId)->update($data);
}
public static function createData($data)
{
return self::create($data);
}
public function fromDateTime($value)
{
return strtotime(parent::fromDateTime($value));
}
//根据插入时间获取id
public static function getIdFormCtime($data)
{
return self::insertGetId($data);
}
public static function getDepartmentInfoList($field)
{
return self::select($field)
->get()
->toArray();
}
public static function getDepartmentIdNameParentIdList()
{
return self::select('department_id', 'department_name', 'parent_id')->get()->toArray();
}
public static function getDepartmentNameWithIdArray()
{
return self::lists('department_name', 'department_id');
}
}
<?php
namespace App\Models\user;
use App\Models\CommonModel;
class LoginModel extends CommonModel
{
protected $table = 'user_login';
public $timestamps = false;
public static function insertData($data)
{
return self::insert($data);
}
public static function getLoginListByUserIdAndTime($userId, $expire)
{
$res = self::where('userId', $userId)
->where('expireTime', '>', $expire)->get();
return ($res) ? $res->toArray() : [];
}
// 根据条件获取列表
public static function getListByWhere($where, $page, $limit, $field = "*")
{
$query = self::select($field);
if ($where) {
$query->where($where);
}
return $query->orderBy('loginTime', 'desc')->paginate($limit, ['*'], 'page', $page)->toArray();
}
}
<?php
namespace App\Models\user;
use App\Models\CommonModel;
class PositionModel extends CommonModel
{
protected $table = 'user_position';
protected $primaryKey = 'position_id';
protected $guarded = ['position_id'];
// protected $fillable = ['position_name', 'author', 'last_author'];
const CREATED_AT = 'ctime';
const UPDATED_AT = 'mtime';
public static function getPositionFieldList($where, $field, $limit, $page)
{
$query = self::select($field);
if ($where) {
$query->where($where);
}
return $query->orderBy('ctime', 'desc')
->orderBy('position_id', 'desc')
->paginate($limit, ['*'], 'page', $page)->toArray();
}
public function fromDateTime($value)
{
return strtotime(parent::fromDateTime($value));
}
// 获取所有职位名称
public static function getPositionNameMap()
{
$position = self::select('position_id', 'position_name', 'department_id', 'department_name')->get()->toArray();
$data = [];
foreach ($position as $v) {
$data[$v['department_name']][] = $v;
}
return $data;
}
public static function getPositionNameList($position_name)
{
return self::where('position_name', $position_name)->first();
}
public static function createData($data)
{
return self::create($data);
}
public static function updatedData($position_id, $data)
{
return self::where('position_id', $position_id)->update($data);
}
public static function deleteData($position_id)
{
return self::where('position_id', $position_id)->delete();
}
}
<?php
namespace App\Models\user;
use App\Models\CommonModel;
class TBusinessConfigModel extends CommonModel
{
protected $table = 't_business_config';
protected $primaryKey = 'bid';
public $timestamps = false;
// 获取所有业务系统名称
public static function getBusinessNameList()
{
return self::pluck('title', 'bid')->toArray();
}
//获取系统信息
public static function getBusinessInfo()
{
$domain = $_SERVER['SERVER_ADDR'] == '127.0.0.1' ? 'http://' . substr($_SERVER['HTTP_HOST'], 1) : 'http://' . $_SERVER['HTTP_HOST'];
// 根据域名查询系统业务ID
$business = self::where('url', $domain)->first();
return !empty($business) ? $business : false;
}
//根据title获取系统信息
public static function getBusinessInfoByTitle($title)
{
return self::where('title', $title)->first();
}
}
<?php
namespace App\Models\user;
use Illuminate\Database\Eloquent\Model;
Class TRolePermModel extends Model
{
protected $table = 't_role_perm';
protected $primaryKey = 'roleId';
public $timestamps = false;
// 获取所有业务系统角色
public static function getRoles($bid)
{
return self::where('bid', $bid)->pluck('name', 'roleId')->toArray();
}
//获取业务id和角色名
public static function getBidUsername($bid, $roleName)
{
return self::where(['bid' => $bid, 'name' => $roleName])->first();
}
//获取业务id和角色名
public static function getRoleInfoByRoleIdAndBid($role_id, $bid)
{
return self::where(['roleId' => $role_id, 'bid' => $bid])->first();
}
}
<?php
namespace App\Models\user;
use Illuminate\Database\Eloquent\Model;
class TUserPermModel extends Model
{
protected $table = 't_user_perm';
protected $primaryKey = 'userId';
const CREATED_AT = 'ctime';
const UPDATED_AT = 'mtime';
// 根据用户ID和业务ID查看角色
public static function getUserIdBid($uid, $bid)
{
return self::where(['userId' => $uid, 'bid' => $bid])->first();
}
//清除用户权限
public static function deleteUserRoot($map)
{
return self::where($map)->delete();
}
//设置角色权限
public static function setUserRoot($data)
{
return self::insertGetId($data);
}
//修改角色名称和时间
public static function updateRoleNameMtime($data)
{
return self::update($data);
}
//获取业务id和用户id
public static function getBidUserId($data)
{
return self::where($data)->first();
}
//
public static function selectBidRoles($bid,$roleId)
{
return self::where(['bid','=', $bid],['roles', 'REGEXP',$roleId])->select();
}
public static function insertData($user_perm){
return self::insert($user_perm);
}
}
<?php
namespace App\Models\user;
use App\Models\CommonModel;
class UserInfoModel extends commonModel
{
const tableName = 'user_info';
protected $table = 'user_info';
protected $primaryKey = 'userId';
public $timestamps = false;
const STATUS_WORKING = 0;
const STATUS_NOT_WORKING = 4;
public static function getUserDepartmentList()
{
return self::where([
'status' => self::STATUS_WORKING,
])->select([
'userId',
'name',
'department_id',
'department_name'
])->get();
}
// 根据用户ids,获取用户列表
public static function getUsersByIds($user_ids)
{
$res = self::whereIn('userId', $user_ids)->get();
return ($res) ? $res->toArray() : [];
}
// 根据用户email, 获取用户信息
public static function getUserByEmail($email)
{
$res = self::where('email', $email)->first();
return ($res) ? $res->toArray() : [];
}
public static function getDepartmentIdWithNameMap()
{
return self::where('department_id', '>', 0)->pluck('department_name', 'department_id');
}
public static function getUserIdWithEmail($data)
{
return self::where('position_id', $data)->select('userId', 'email')->get()->toArray();
}
public static function getUserIdNameEmailStatusMap()
{
return self::select('userId', 'name', 'email', 'status')->get();
}
public static function updateByDepartmentId($department_id, $data)
{
self::where('department_id', $department_id)->update($data);
}
public static function updateByPositionId($position_id, $data)
{
self::where('position_id', $position_id)->update($data);
}
public static function getUserIdNameStatus($id)
{
return self::where('userId', $id)->select('userId', 'name', 'status')->first();
}
public static function getUserNameEmailStatus($id)
{
$res = self::where('userId', $id)->select('name', 'email', 'status')->first();
return ($res) ? $res->toArray() : [];
}
public static function countIdByStatus($users, $status)
{
return self::whereIn('userId', $users)->where('status', '<>', $status)->count();
}
public static function getUserIdStatus($ids, $status)
{
return self::whereIn('userId', $ids)->select('userId', '<>', $status)->first();
}
public static function getIdByStatus($userId, $status)
{
return self::where('userId', $userId)->where('status', '<>', $status)->first();
}
public static function getIdByName($val)
{
return self::where('name', $val)->select('userId')->first();
}
public static function getNameWithEngNameMap($userId)
{
return self::leftJoin('user_info as t', 'user_info.superior', '=', 't.userId')
->where('user_info.userId', $userId)
->select('user_info.*', 't.engName as sup_engName', 't.name as sup_name')
->first();
}
public static function QueryWhere( array $whereCond)
{
return self::where($whereCond)->get();
}
}
<?php
namespace App\Models\user;
use App\Models\CommonModel;
class UserModel extends CommonModel {
protected $table = "user";
public static function QueryWhere( array $whereCond)
{
return self::where($whereCond)->get();
}
}
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
//
}
}
<?php
namespace App\Providers;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Gate;
class AuthServiceProvider extends ServiceProvider
{
/**
* The policy mappings for the application.
*
* @var array<class-string, class-string>
*/
protected $policies = [
// 'App\Models\Model' => 'App\Policies\ModelPolicy',
];
/**
* Register any authentication / authorization services.
*
* @return void
*/
public function boot()
{
$this->registerPolicies();
//
}
}
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Broadcast;
use Illuminate\Support\ServiceProvider;
class BroadcastServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Broadcast::routes();
require base_path('routes/channels.php');
}
}
<?php
namespace App\Providers;
use Illuminate\Auth\Events\Registered;
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Event;
class EventServiceProvider extends ServiceProvider
{
/**
* The event listener mappings for the application.
*
* @var array<class-string, array<int, class-string>>
*/
protected $listen = [
Registered::class => [
SendEmailVerificationNotification::class,
],
];
/**
* Register any events for your application.
*
* @return void
*/
public function boot()
{
//
}
}
<?php
namespace App\Providers;
use Illuminate\Cache\RateLimiting\Limit;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Support\Facades\Route;
class RouteServiceProvider extends ServiceProvider
{
/**
* The path to the "home" route for your application.
*
* This is used by Laravel authentication to redirect users after login.
*
* @var string
*/
public const HOME = '/home';
/**
* The controller namespace for the application.
*
* When present, controller route declarations will automatically be prefixed with this namespace.
*
* @var string|null
*/
// protected $namespace = 'App\\Http\\Controllers';
/**
* Define your route model bindings, pattern filters, etc.
*
* @return void
*/
public function boot()
{
$this->configureRateLimiting();
$this->routes(function () {
Route::prefix('api')
->middleware('api')
->namespace($this->namespace)
->group(base_path('routes/api.php'));
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/web.php'));
Route::middleware('noauth')
->namespace($this->namespace)
->group(base_path('routes/noauth.php'));
});
}
/**
* Configure the rate limiters for the application.
*
* @return void
*/
protected function configureRateLimiting()
{
RateLimiter::for('api', function (Request $request) {
return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());
});
}
}
#!/usr/bin/env php
<?php
define('LARAVEL_START', microtime(true));
/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader
| for our application. We just need to utilize it! We'll require it
| into the script here so that we do not have to worry about the
| loading of any of our classes manually. It's great to relax.
|
*/
require __DIR__.'/vendor/autoload.php';
$app = require_once __DIR__.'/bootstrap/app.php';
// 加载配置文件,公共读取配置文件函数
require __DIR__.'/bootstrap/init.php';
/*
|--------------------------------------------------------------------------
| Run The Artisan Application
|--------------------------------------------------------------------------
|
| When we run the console application, the current CLI command will be
| executed in this console and the response sent back to a terminal
| or another output device for the developers. Here goes nothing!
|
*/
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
$status = $kernel->handle(
$input = new Symfony\Component\Console\Input\ArgvInput,
new Symfony\Component\Console\Output\ConsoleOutput
);
/*
|--------------------------------------------------------------------------
| Shutdown The Application
|--------------------------------------------------------------------------
|
| Once Artisan has finished running, we will fire off the shutdown events
| so that any final work may be done by the application before we shut
| down the process. This is the last thing to happen to the request.
|
*/
$kernel->terminate($input, $status);
exit($status);
<?php
/*
|--------------------------------------------------------------------------
| Create The Application
|--------------------------------------------------------------------------
|
| The first thing we will do is create a new Laravel application instance
| which serves as the "glue" for all the components of Laravel, and is
| the IoC container for the system binding all of the various parts.
|
*/
$app = new Illuminate\Foundation\Application(
$_ENV['APP_BASE_PATH'] ?? dirname(__DIR__)
);
/*
|--------------------------------------------------------------------------
| Bind Important Interfaces
|--------------------------------------------------------------------------
|
| Next, we need to bind some important interfaces into the container so
| we will be able to resolve them when needed. The kernels serve the
| incoming requests to this application from both the web and CLI.
|
*/
$app->singleton(
Illuminate\Contracts\Http\Kernel::class,
App\Http\Kernel::class
);
$app->singleton(
Illuminate\Contracts\Console\Kernel::class,
App\Console\Kernel::class
);
$app->singleton(
Illuminate\Contracts\Debug\ExceptionHandler::class,
App\Exceptions\Handler::class
);
/*
|--------------------------------------------------------------------------
| Return The Application
|--------------------------------------------------------------------------
|
| This script returns the application instance. The instance is given to
| the calling script so we can separate the building of the instances
| from the actual running of the application and sending responses.
|
*/
return $app;
<?php
// 判断是否是命令模式
if (is_cli()) {
$default_env_dir = dirname(__DIR__);
} else {
$default_env_dir = dirname($_SERVER['DOCUMENT_ROOT']);
}
$default_env_file = $default_env_dir ;
$RESOURCE_CONFIG_DIR = $APP_STORAGE_PATH = '';
if (file_exists($default_env_file)) {
$EnvLoader = Dotenv\Dotenv::createImmutable($default_env_file);
$EnvLoader->load();
$RESOURCE_CONFIG_DIR = $_ENV["RESOURCE_CONFIG_DIR"];
}
// 定义资源配置文件目录
define('RESOURCE_CONFIG_DIR', (is_dir($RESOURCE_CONFIG_DIR)) ? $RESOURCE_CONFIG_DIR : '/data2/liexin_config');
function is_cli()
{
return preg_match("/cli/i", php_sapi_name()) ? true : false;
}
function get_resource_config($type)
{
if (!isset($GLOBALS['_lx_resource_config'][$type])) {
$path = RESOURCE_CONFIG_DIR . '/' . $type . '.ini';
$config = parse_ini_file($path, true);
$GLOBALS['_hz_resource_config'][$type] = $config;
} else {
$config = $GLOBALS['_lx_resource_config'][$type];
}
return $config;
}
function get_resource_config_section($type, $section)
{
if (!isset($GLOBALS['_lx_resource_config'][$type])) {
$path = RESOURCE_CONFIG_DIR . '/' . $type . '.ini';
$type_config = parse_ini_file($path, true);
$GLOBALS['_hz_resource_config'][$type] = $type_config;
$config = $type_config[$section];
} else {
$config = $GLOBALS['_lx_resource_config'][$type][$section];
}
return $config;
}
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.4|^8.0",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.0.1",
"laravel/framework": "^8.75",
"laravel/sanctum": "^2.11",
"laravel/tinker": "^2.5",
"ext-json": "*",
"ext-openssl": "*"
},
"require-dev": {
"facade/ignition": "^2.5",
"fakerphp/faker": "^1.9.1",
"laravel/sail": "^1.0.1",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^5.10",
"phpunit/phpunit": "^9.5.10"
},
"autoload": {
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"post-update-cmd": [
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
]
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true
}
This diff could not be displayed because it is too large.
<?php
return [
/*
|--------------------------------------------------------------------------
| Application Name
|--------------------------------------------------------------------------
|
| This value is the name of your application. This value is used when the
| framework needs to place the application's name in a notification or
| any other location as required by the application or its packages.
|
*/
'name' => env('APP_NAME', 'Laravel'),
/*
|--------------------------------------------------------------------------
| Application Environment
|--------------------------------------------------------------------------
|
| This value determines the "environment" your application is currently
| running in. This may determine how you prefer to configure various
| services the application utilizes. Set this in your ".env" file.
|
*/
'env' => env('APP_ENV', 'production'),
/*
|--------------------------------------------------------------------------
| Application Debug Mode
|--------------------------------------------------------------------------
|
| When your application is in debug mode, detailed error messages with
| stack traces will be shown on every error that occurs within your
| application. If disabled, a simple generic error page is shown.
|
*/
'debug' => (bool) env('APP_DEBUG', false),
/*
|--------------------------------------------------------------------------
| Application URL
|--------------------------------------------------------------------------
|
| This URL is used by the console to properly generate URLs when using
| the Artisan command line tool. You should set this to the root of
| your application so that it is used when running Artisan tasks.
|
*/
'url' => env('APP_URL', 'http://localhost'),
'asset_url' => env('ASSET_URL', null),
/*
|--------------------------------------------------------------------------
| Application Timezone
|--------------------------------------------------------------------------
|
| Here you may specify the default timezone for your application, which
| will be used by the PHP date and date-time functions. We have gone
| ahead and set this to a sensible default for you out of the box.
|
*/
'timezone' => 'UTC',
/*
|--------------------------------------------------------------------------
| Application Locale Configuration
|--------------------------------------------------------------------------
|
| The application locale determines the default locale that will be used
| by the translation service provider. You are free to set this value
| to any of the locales which will be supported by the application.
|
*/
'locale' => 'en',
/*
|--------------------------------------------------------------------------
| Application Fallback Locale
|--------------------------------------------------------------------------
|
| The fallback locale determines the locale to use when the current one
| is not available. You may change the value to correspond to any of
| the language folders that are provided through your application.
|
*/
'fallback_locale' => 'en',
/*
|--------------------------------------------------------------------------
| Faker Locale
|--------------------------------------------------------------------------
|
| This locale will be used by the Faker PHP library when generating fake
| data for your database seeds. For example, this will be used to get
| localized telephone numbers, street address information and more.
|
*/
'faker_locale' => 'en_US',
/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| This key is used by the Illuminate encrypter service and should be set
| to a random, 32 character string, otherwise these encrypted strings
| will not be safe. Please do this before deploying an application!
|
*/
'key' => env('APP_KEY'),
'cipher' => 'AES-256-CBC',
/*
|--------------------------------------------------------------------------
| Autoloaded Service Providers
|--------------------------------------------------------------------------
|
| The service providers listed here will be automatically loaded on the
| request to your application. Feel free to add your own services to
| this array to grant expanded functionality to your applications.
|
*/
'providers' => [
/*
* Laravel Framework Service Providers...
*/
Illuminate\Auth\AuthServiceProvider::class,
Illuminate\Broadcasting\BroadcastServiceProvider::class,
Illuminate\Bus\BusServiceProvider::class,
Illuminate\Cache\CacheServiceProvider::class,
Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
Illuminate\Cookie\CookieServiceProvider::class,
Illuminate\Database\DatabaseServiceProvider::class,
Illuminate\Encryption\EncryptionServiceProvider::class,
Illuminate\Filesystem\FilesystemServiceProvider::class,
Illuminate\Foundation\Providers\FoundationServiceProvider::class,
Illuminate\Hashing\HashServiceProvider::class,
Illuminate\Mail\MailServiceProvider::class,
Illuminate\Notifications\NotificationServiceProvider::class,
Illuminate\Pagination\PaginationServiceProvider::class,
Illuminate\Pipeline\PipelineServiceProvider::class,
Illuminate\Queue\QueueServiceProvider::class,
Illuminate\Redis\RedisServiceProvider::class,
Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
Illuminate\Session\SessionServiceProvider::class,
Illuminate\Translation\TranslationServiceProvider::class,
Illuminate\Validation\ValidationServiceProvider::class,
Illuminate\View\ViewServiceProvider::class,
/*
* Package Service Providers...
*/
/*
* Application Service Providers...
*/
App\Providers\AppServiceProvider::class,
App\Providers\AuthServiceProvider::class,
// App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
],
/*
|--------------------------------------------------------------------------
| Class Aliases
|--------------------------------------------------------------------------
|
| This array of class aliases will be registered when this application
| is started. However, feel free to register as many as you wish as
| the aliases are "lazy" loaded so they don't hinder performance.
|
*/
'aliases' => [
'App' => Illuminate\Support\Facades\App::class,
'Arr' => Illuminate\Support\Arr::class,
'Artisan' => Illuminate\Support\Facades\Artisan::class,
'Auth' => Illuminate\Support\Facades\Auth::class,
'Blade' => Illuminate\Support\Facades\Blade::class,
'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
'Bus' => Illuminate\Support\Facades\Bus::class,
'Cache' => Illuminate\Support\Facades\Cache::class,
'Config' => Illuminate\Support\Facades\Config::class,
'Cookie' => Illuminate\Support\Facades\Cookie::class,
'Crypt' => Illuminate\Support\Facades\Crypt::class,
'Date' => Illuminate\Support\Facades\Date::class,
'DB' => Illuminate\Support\Facades\DB::class,
'Eloquent' => Illuminate\Database\Eloquent\Model::class,
'Event' => Illuminate\Support\Facades\Event::class,
'File' => Illuminate\Support\Facades\File::class,
'Gate' => Illuminate\Support\Facades\Gate::class,
'Hash' => Illuminate\Support\Facades\Hash::class,
'Http' => Illuminate\Support\Facades\Http::class,
'Js' => Illuminate\Support\Js::class,
'Lang' => Illuminate\Support\Facades\Lang::class,
'Log' => Illuminate\Support\Facades\Log::class,
'Mail' => Illuminate\Support\Facades\Mail::class,
'Notification' => Illuminate\Support\Facades\Notification::class,
'Password' => Illuminate\Support\Facades\Password::class,
'Queue' => Illuminate\Support\Facades\Queue::class,
'RateLimiter' => Illuminate\Support\Facades\RateLimiter::class,
'Redirect' => Illuminate\Support\Facades\Redirect::class,
// 'Redis' => Illuminate\Support\Facades\Redis::class,
'Request' => Illuminate\Support\Facades\Request::class,
'Response' => Illuminate\Support\Facades\Response::class,
'Route' => Illuminate\Support\Facades\Route::class,
'Schema' => Illuminate\Support\Facades\Schema::class,
'Session' => Illuminate\Support\Facades\Session::class,
'Storage' => Illuminate\Support\Facades\Storage::class,
'Str' => Illuminate\Support\Str::class,
'URL' => Illuminate\Support\Facades\URL::class,
'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class,
],
];
<?php
return [
/*
|--------------------------------------------------------------------------
| Authentication Defaults
|--------------------------------------------------------------------------
|
| This option controls the default authentication "guard" and password
| reset options for your application. You may change these defaults
| as required, but they're a perfect start for most applications.
|
*/
'defaults' => [
'guard' => 'web',
'passwords' => 'users',
],
/*
|--------------------------------------------------------------------------
| Authentication Guards
|--------------------------------------------------------------------------
|
| Next, you may define every authentication guard for your application.
| Of course, a great default configuration has been defined for you
| here which uses session storage and the Eloquent user provider.
|
| All authentication drivers have a user provider. This defines how the
| users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data.
|
| Supported: "session"
|
*/
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
],
/*
|--------------------------------------------------------------------------
| User Providers
|--------------------------------------------------------------------------
|
| All authentication drivers have a user provider. This defines how the
| users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data.
|
| If you have multiple user tables or models you may configure multiple
| sources which represent each model / table. These sources may then
| be assigned to any extra authentication guards you have defined.
|
| Supported: "database", "eloquent"
|
*/
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => App\Models\User::class,
],
// 'users' => [
// 'driver' => 'database',
// 'table' => 'users',
// ],
],
/*
|--------------------------------------------------------------------------
| Resetting Passwords
|--------------------------------------------------------------------------
|
| You may specify multiple password reset configurations if you have more
| than one user table or model in the application and you want to have
| separate password reset settings based on the specific user types.
|
| The expire time is the number of minutes that each reset token will be
| considered valid. This security feature keeps tokens short-lived so
| they have less time to be guessed. You may change this as needed.
|
*/
'passwords' => [
'users' => [
'provider' => 'users',
'table' => 'password_resets',
'expire' => 60,
'throttle' => 60,
],
],
/*
|--------------------------------------------------------------------------
| Password Confirmation Timeout
|--------------------------------------------------------------------------
|
| Here you may define the amount of seconds before a password confirmation
| times out and the user is prompted to re-enter their password via the
| confirmation screen. By default, the timeout lasts for three hours.
|
*/
'password_timeout' => 10800,
];
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Broadcaster
|--------------------------------------------------------------------------
|
| This option controls the default broadcaster that will be used by the
| framework when an event needs to be broadcast. You may set this to
| any of the connections defined in the "connections" array below.
|
| Supported: "pusher", "ably", "redis", "log", "null"
|
*/
'default' => env('BROADCAST_DRIVER', 'null'),
/*
|--------------------------------------------------------------------------
| Broadcast Connections
|--------------------------------------------------------------------------
|
| Here you may define all of the broadcast connections that will be used
| to broadcast events to other systems or over websockets. Samples of
| each available type of connection are provided inside this array.
|
*/
'connections' => [
'pusher' => [
'driver' => 'pusher',
'key' => env('PUSHER_APP_KEY'),
'secret' => env('PUSHER_APP_SECRET'),
'app_id' => env('PUSHER_APP_ID'),
'options' => [
'cluster' => env('PUSHER_APP_CLUSTER'),
'useTLS' => true,
],
],
'ably' => [
'driver' => 'ably',
'key' => env('ABLY_KEY'),
],
'redis' => [
'driver' => 'redis',
'connection' => 'default',
],
'log' => [
'driver' => 'log',
],
'null' => [
'driver' => 'null',
],
],
];
<?php
use Illuminate\Support\Str;
return [
/*
|--------------------------------------------------------------------------
| Default Cache Store
|--------------------------------------------------------------------------
|
| This option controls the default cache connection that gets used while
| using this caching library. This connection is used when another is
| not explicitly specified when executing a given caching function.
|
*/
'default' => env('CACHE_DRIVER', 'file'),
/*
|--------------------------------------------------------------------------
| Cache Stores
|--------------------------------------------------------------------------
|
| Here you may define all of the cache "stores" for your application as
| well as their drivers. You may even define multiple stores for the
| same cache driver to group types of items stored in your caches.
|
| Supported drivers: "apc", "array", "database", "file",
| "memcached", "redis", "dynamodb", "octane", "null"
|
*/
'stores' => [
'apc' => [
'driver' => 'apc',
],
'array' => [
'driver' => 'array',
'serialize' => false,
],
'database' => [
'driver' => 'database',
'table' => 'cache',
'connection' => null,
'lock_connection' => null,
],
'file' => [
'driver' => 'file',
'path' => storage_path('framework/cache/data'),
],
'memcached' => [
'driver' => 'memcached',
'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
'sasl' => [
env('MEMCACHED_USERNAME'),
env('MEMCACHED_PASSWORD'),
],
'options' => [
// Memcached::OPT_CONNECT_TIMEOUT => 2000,
],
'servers' => [
[
'host' => env('MEMCACHED_HOST', '127.0.0.1'),
'port' => env('MEMCACHED_PORT', 11211),
'weight' => 100,
],
],
],
'redis' => [
'driver' => 'redis',
'connection' => 'cache',
'lock_connection' => 'default',
],
'dynamodb' => [
'driver' => 'dynamodb',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
'endpoint' => env('DYNAMODB_ENDPOINT'),
],
'octane' => [
'driver' => 'octane',
],
],
/*
|--------------------------------------------------------------------------
| Cache Key Prefix
|--------------------------------------------------------------------------
|
| When utilizing a RAM based store such as APC or Memcached, there might
| be other applications utilizing the same cache. So, we'll specify a
| value to get prefixed to all our keys so we can avoid collisions.
|
*/
'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'),
];
<?php
return [
/*
|--------------------------------------------------------------------------
| Cross-Origin Resource Sharing (CORS) Configuration
|--------------------------------------------------------------------------
|
| Here you may configure your settings for cross-origin resource sharing
| or "CORS". This determines what cross-origin operations may execute
| in web browsers. You are free to adjust these settings as needed.
|
| To learn more: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
|
*/
'paths' => ['api/*', 'sanctum/csrf-cookie'],
'allowed_methods' => ['*'],
'allowed_origins' => ['*'],
'allowed_origins_patterns' => [],
'allowed_headers' => ['*'],
'exposed_headers' => [],
'max_age' => 0,
'supports_credentials' => false,
];
<?php
use Illuminate\Support\Str;
return [
/*
|--------------------------------------------------------------------------
| Default Database Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify which of the database connections below you wish
| to use as your default connection for all database work. Of course
| you may use many connections at once using the Database library.
|
*/
'default' => env('DB_CONNECTION', 'mysql'),
/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Here are each of the database connections setup for your application.
| Of course, examples of configuring each database platform that is
| supported by Laravel is shown below to make development simple.
|
|
| All database work in Laravel is done through the PHP PDO facilities
| so make sure you have the driver for your particular database of
| choice installed on your machine before you begin development.
|
*/
'connections' => [
'sqlite' => [
'driver' => 'sqlite',
'url' => env('DATABASE_URL'),
'database' => env('DB_DATABASE', database_path('database.sqlite')),
'prefix' => '',
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
],
'mysql' => [
'driver' => 'mysql',
'url' => env('DATABASE_URL'),
'host' => get_resource_config_section('db', 'db_cms')['host'],
'database' => get_resource_config_section('db', 'db_cms')['db'],
'username' => get_resource_config_section('db', 'db_cms')['user'],
'password' => get_resource_config_section('db', 'db_cms')['passwd'],
'port' => env('DB_PORT', '3306'),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'prefix_indexes' => true,
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],
'pgsql' => [
'driver' => 'pgsql',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '5432'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'prefix_indexes' => true,
'schema' => 'public',
'sslmode' => 'prefer',
],
'sqlsrv' => [
'driver' => 'sqlsrv',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '1433'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'prefix_indexes' => true,
],
],
/*
|--------------------------------------------------------------------------
| Migration Repository Table
|--------------------------------------------------------------------------
|
| This table keeps track of all the migrations that have already run for
| your application. Using this information, we can determine which of
| the migrations on disk haven't actually been run in the database.
|
*/
'migrations' => 'migrations',
/*
|--------------------------------------------------------------------------
| Redis Databases
|--------------------------------------------------------------------------
|
| Redis is an open source, fast, and advanced key-value store that also
| provides a richer body of commands than a typical key-value system
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
*/
'redis' => [
'client' => env('REDIS_CLIENT', 'phpredis'),
'options' => [
'cluster' => env('REDIS_CLUSTER', 'redis'),
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
],
'default' => [
'url' => env('REDIS_URL'),
'host' => get_resource_config_section('redis', 'user')['host'],
'password' => get_resource_config_section('redis', 'user')['passwd'],
'port' => get_resource_config_section('redis', 'user')['port'],
'database' => env('REDIS_DB', '0'),
],
'cache' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', '6379'),
'database' => env('REDIS_CACHE_DB', '1'),
],
],
];
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Filesystem Disk
|--------------------------------------------------------------------------
|
| Here you may specify the default filesystem disk that should be used
| by the framework. The "local" disk, as well as a variety of cloud
| based disks are available to your application. Just store away!
|
*/
'default' => env('FILESYSTEM_DRIVER', 'local'),
/*
|--------------------------------------------------------------------------
| Filesystem Disks
|--------------------------------------------------------------------------
|
| Here you may configure as many filesystem "disks" as you wish, and you
| may even configure multiple disks of the same driver. Defaults have
| been setup for each driver as an example of the required options.
|
| Supported Drivers: "local", "ftp", "sftp", "s3"
|
*/
'disks' => [
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
],
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
],
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT'),
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
],
],
/*
|--------------------------------------------------------------------------
| Symbolic Links
|--------------------------------------------------------------------------
|
| Here you may configure the symbolic links that will be created when the
| `storage:link` Artisan command is executed. The array keys should be
| the locations of the links and the values should be their targets.
|
*/
'links' => [
public_path('storage') => storage_path('app/public'),
],
];
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Hash Driver
|--------------------------------------------------------------------------
|
| This option controls the default hash driver that will be used to hash
| passwords for your application. By default, the bcrypt algorithm is
| used; however, you remain free to modify this option if you wish.
|
| Supported: "bcrypt", "argon", "argon2id"
|
*/
'driver' => 'bcrypt',
/*
|--------------------------------------------------------------------------
| Bcrypt Options
|--------------------------------------------------------------------------
|
| Here you may specify the configuration options that should be used when
| passwords are hashed using the Bcrypt algorithm. This will allow you
| to control the amount of time it takes to hash the given password.
|
*/
'bcrypt' => [
'rounds' => env('BCRYPT_ROUNDS', 10),
],
/*
|--------------------------------------------------------------------------
| Argon Options
|--------------------------------------------------------------------------
|
| Here you may specify the configuration options that should be used when
| passwords are hashed using the Argon algorithm. These will allow you
| to control the amount of time it takes to hash the given password.
|
*/
'argon' => [
'memory' => 65536,
'threads' => 1,
'time' => 4,
],
];
<?php
use Monolog\Handler\NullHandler;
use Monolog\Handler\StreamHandler;
use Monolog\Handler\SyslogUdpHandler;
return [
/*
|--------------------------------------------------------------------------
| Default Log Channel
|--------------------------------------------------------------------------
|
| This option defines the default log channel that gets used when writing
| messages to the logs. The name specified in this option should match
| one of the channels defined in the "channels" configuration array.
|
*/
'default' => env('LOG_CHANNEL', 'stack'),
/*
|--------------------------------------------------------------------------
| Deprecations Log Channel
|--------------------------------------------------------------------------
|
| This option controls the log channel that should be used to log warnings
| regarding deprecated PHP and library features. This allows you to get
| your application ready for upcoming major versions of dependencies.
|
*/
'deprecations' => env('LOG_DEPRECATIONS_CHANNEL', 'null'),
/*
|--------------------------------------------------------------------------
| Log Channels
|--------------------------------------------------------------------------
|
| Here you may configure the log channels for your application. Out of
| the box, Laravel uses the Monolog PHP logging library. This gives
| you a variety of powerful log handlers / formatters to utilize.
|
| Available Drivers: "single", "daily", "slack", "syslog",
| "errorlog", "monolog",
| "custom", "stack"
|
*/
'channels' => [
'stack' => [
'driver' => 'stack',
'channels' => ['single'],
'ignore_exceptions' => false,
],
'single' => [
'driver' => 'single',
'path' => storage_path('logs/laravel.log'),
'level' => env('LOG_LEVEL', 'debug'),
],
'daily' => [
'driver' => 'daily',
'path' => storage_path('logs/laravel.log'),
'level' => env('LOG_LEVEL', 'debug'),
'days' => 14,
],
'slack' => [
'driver' => 'slack',
'url' => env('LOG_SLACK_WEBHOOK_URL'),
'username' => 'Laravel Log',
'emoji' => ':boom:',
'level' => env('LOG_LEVEL', 'critical'),
],
'papertrail' => [
'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'),
'handler' => SyslogUdpHandler::class,
'handler_with' => [
'host' => env('PAPERTRAIL_URL'),
'port' => env('PAPERTRAIL_PORT'),
],
],
'stderr' => [
'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'),
'handler' => StreamHandler::class,
'formatter' => env('LOG_STDERR_FORMATTER'),
'with' => [
'stream' => 'php://stderr',
],
],
'syslog' => [
'driver' => 'syslog',
'level' => env('LOG_LEVEL', 'debug'),
],
'errorlog' => [
'driver' => 'errorlog',
'level' => env('LOG_LEVEL', 'debug'),
],
'null' => [
'driver' => 'monolog',
'handler' => NullHandler::class,
],
'emergency' => [
'path' => storage_path('logs/laravel.log'),
],
],
];
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Mailer
|--------------------------------------------------------------------------
|
| This option controls the default mailer that is used to send any email
| messages sent by your application. Alternative mailers may be setup
| and used as needed; however, this mailer will be used by default.
|
*/
'default' => env('MAIL_MAILER', 'smtp'),
/*
|--------------------------------------------------------------------------
| Mailer Configurations
|--------------------------------------------------------------------------
|
| Here you may configure all of the mailers used by your application plus
| their respective settings. Several examples have been configured for
| you and you are free to add your own as your application requires.
|
| Laravel supports a variety of mail "transport" drivers to be used while
| sending an e-mail. You will specify which one you are using for your
| mailers below. You are free to add additional mailers as required.
|
| Supported: "smtp", "sendmail", "mailgun", "ses",
| "postmark", "log", "array", "failover"
|
*/
'mailers' => [
'smtp' => [
'transport' => 'smtp',
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
'port' => env('MAIL_PORT', 587),
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'timeout' => null,
'auth_mode' => null,
],
'ses' => [
'transport' => 'ses',
],
'mailgun' => [
'transport' => 'mailgun',
],
'postmark' => [
'transport' => 'postmark',
],
'sendmail' => [
'transport' => 'sendmail',
'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -t -i'),
],
'log' => [
'transport' => 'log',
'channel' => env('MAIL_LOG_CHANNEL'),
],
'array' => [
'transport' => 'array',
],
'failover' => [
'transport' => 'failover',
'mailers' => [
'smtp',
'log',
],
],
],
/*
|--------------------------------------------------------------------------
| Global "From" Address
|--------------------------------------------------------------------------
|
| You may wish for all e-mails sent by your application to be sent from
| the same address. Here, you may specify a name and address that is
| used globally for all e-mails that are sent by your application.
|
*/
'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
'name' => env('MAIL_FROM_NAME', 'Example'),
],
/*
|--------------------------------------------------------------------------
| Markdown Mail Settings
|--------------------------------------------------------------------------
|
| If you are using Markdown based email rendering, you may configure your
| theme and component paths here, allowing you to customize the design
| of the emails. Or, you may simply stick with the Laravel defaults!
|
*/
'markdown' => [
'theme' => 'default',
'paths' => [
resource_path('views/vendor/mail'),
],
],
];
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Queue Connection Name
|--------------------------------------------------------------------------
|
| Laravel's queue API supports an assortment of back-ends via a single
| API, giving you convenient access to each back-end using the same
| syntax for every one. Here you may define a default connection.
|
*/
'default' => env('QUEUE_CONNECTION', 'sync'),
/*
|--------------------------------------------------------------------------
| Queue Connections
|--------------------------------------------------------------------------
|
| Here you may configure the connection information for each server that
| is used by your application. A default configuration has been added
| for each back-end shipped with Laravel. You are free to add more.
|
| Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null"
|
*/
'connections' => [
'sync' => [
'driver' => 'sync',
],
'database' => [
'driver' => 'database',
'table' => 'jobs',
'queue' => 'default',
'retry_after' => 90,
'after_commit' => false,
],
'beanstalkd' => [
'driver' => 'beanstalkd',
'host' => 'localhost',
'queue' => 'default',
'retry_after' => 90,
'block_for' => 0,
'after_commit' => false,
],
'sqs' => [
'driver' => 'sqs',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
'queue' => env('SQS_QUEUE', 'default'),
'suffix' => env('SQS_SUFFIX'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
'after_commit' => false,
],
'redis' => [
'driver' => 'redis',
'connection' => 'default',
'queue' => env('REDIS_QUEUE', 'default'),
'retry_after' => 90,
'block_for' => null,
'after_commit' => false,
],
],
/*
|--------------------------------------------------------------------------
| Failed Queue Jobs
|--------------------------------------------------------------------------
|
| These options configure the behavior of failed queue job logging so you
| can control which database and table are used to store the jobs that
| have failed. You may change them to any database / table you wish.
|
*/
'failed' => [
'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
'database' => env('DB_CONNECTION', 'mysql'),
'table' => 'failed_jobs',
],
];
<?php
return [
/*
|--------------------------------------------------------------------------
| Stateful Domains
|--------------------------------------------------------------------------
|
| Requests from the following domains / hosts will receive stateful API
| authentication cookies. Typically, these should include your local
| and production domains which access your API via a frontend SPA.
|
*/
'stateful' => explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf(
'%s%s',
'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1',
env('APP_URL') ? ','.parse_url(env('APP_URL'), PHP_URL_HOST) : ''
))),
/*
|--------------------------------------------------------------------------
| Sanctum Guards
|--------------------------------------------------------------------------
|
| This array contains the authentication guards that will be checked when
| Sanctum is trying to authenticate a request. If none of these guards
| are able to authenticate the request, Sanctum will use the bearer
| token that's present on an incoming request for authentication.
|
*/
'guard' => ['web'],
/*
|--------------------------------------------------------------------------
| Expiration Minutes
|--------------------------------------------------------------------------
|
| This value controls the number of minutes until an issued token will be
| considered expired. If this value is null, personal access tokens do
| not expire. This won't tweak the lifetime of first-party sessions.
|
*/
'expiration' => null,
/*
|--------------------------------------------------------------------------
| Sanctum Middleware
|--------------------------------------------------------------------------
|
| When authenticating your first-party SPA with Sanctum you may need to
| customize some of the middleware Sanctum uses while processing the
| request. You may change the middleware listed below as required.
|
*/
'middleware' => [
'verify_csrf_token' => App\Http\Middleware\VerifyCsrfToken::class,
'encrypt_cookies' => App\Http\Middleware\EncryptCookies::class,
],
];
<?php
return [
/*
|--------------------------------------------------------------------------
| Third Party Services
|--------------------------------------------------------------------------
|
| This file is for storing the credentials for third party services such
| as Mailgun, Postmark, AWS and more. This file provides the de facto
| location for this type of information, allowing packages to have
| a conventional file to locate the various service credentials.
|
*/
'mailgun' => [
'domain' => env('MAILGUN_DOMAIN'),
'secret' => env('MAILGUN_SECRET'),
'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
],
'postmark' => [
'token' => env('POSTMARK_TOKEN'),
],
'ses' => [
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
],
];
<?php
use Illuminate\Support\Str;
return [
/*
|--------------------------------------------------------------------------
| Default Session Driver
|--------------------------------------------------------------------------
|
| This option controls the default session "driver" that will be used on
| requests. By default, we will use the lightweight native driver but
| you may specify any of the other wonderful drivers provided here.
|
| Supported: "file", "cookie", "database", "apc",
| "memcached", "redis", "dynamodb", "array"
|
*/
'driver' => env('SESSION_DRIVER', 'file'),
/*
|--------------------------------------------------------------------------
| Session Lifetime
|--------------------------------------------------------------------------
|
| Here you may specify the number of minutes that you wish the session
| to be allowed to remain idle before it expires. If you want them
| to immediately expire on the browser closing, set that option.
|
*/
'lifetime' => env('SESSION_LIFETIME', 120),
'expire_on_close' => false,
/*
|--------------------------------------------------------------------------
| Session Encryption
|--------------------------------------------------------------------------
|
| This option allows you to easily specify that all of your session data
| should be encrypted before it is stored. All encryption will be run
| automatically by Laravel and you can use the Session like normal.
|
*/
'encrypt' => false,
/*
|--------------------------------------------------------------------------
| Session File Location
|--------------------------------------------------------------------------
|
| When using the native session driver, we need a location where session
| files may be stored. A default has been set for you but a different
| location may be specified. This is only needed for file sessions.
|
*/
'files' => storage_path('framework/sessions'),
/*
|--------------------------------------------------------------------------
| Session Database Connection
|--------------------------------------------------------------------------
|
| When using the "database" or "redis" session drivers, you may specify a
| connection that should be used to manage these sessions. This should
| correspond to a connection in your database configuration options.
|
*/
'connection' => env('SESSION_CONNECTION', null),
/*
|--------------------------------------------------------------------------
| Session Database Table
|--------------------------------------------------------------------------
|
| When using the "database" session driver, you may specify the table we
| should use to manage the sessions. Of course, a sensible default is
| provided for you; however, you are free to change this as needed.
|
*/
'table' => 'sessions',
/*
|--------------------------------------------------------------------------
| Session Cache Store
|--------------------------------------------------------------------------
|
| While using one of the framework's cache driven session backends you may
| list a cache store that should be used for these sessions. This value
| must match with one of the application's configured cache "stores".
|
| Affects: "apc", "dynamodb", "memcached", "redis"
|
*/
'store' => env('SESSION_STORE', null),
/*
|--------------------------------------------------------------------------
| Session Sweeping Lottery
|--------------------------------------------------------------------------
|
| Some session drivers must manually sweep their storage location to get
| rid of old sessions from storage. Here are the chances that it will
| happen on a given request. By default, the odds are 2 out of 100.
|
*/
'lottery' => [2, 100],
/*
|--------------------------------------------------------------------------
| Session Cookie Name
|--------------------------------------------------------------------------
|
| Here you may change the name of the cookie used to identify a session
| instance by ID. The name specified here will get used every time a
| new session cookie is created by the framework for every driver.
|
*/
'cookie' => env(
'SESSION_COOKIE',
Str::slug(env('APP_NAME', 'laravel'), '_').'_session'
),
/*
|--------------------------------------------------------------------------
| Session Cookie Path
|--------------------------------------------------------------------------
|
| The session cookie path determines the path for which the cookie will
| be regarded as available. Typically, this will be the root path of
| your application but you are free to change this when necessary.
|
*/
'path' => '/',
/*
|--------------------------------------------------------------------------
| Session Cookie Domain
|--------------------------------------------------------------------------
|
| Here you may change the domain of the cookie used to identify a session
| in your application. This will determine which domains the cookie is
| available to in your application. A sensible default has been set.
|
*/
'domain' => env('SESSION_DOMAIN', null),
/*
|--------------------------------------------------------------------------
| HTTPS Only Cookies
|--------------------------------------------------------------------------
|
| By setting this option to true, session cookies will only be sent back
| to the server if the browser has a HTTPS connection. This will keep
| the cookie from being sent to you when it can't be done securely.
|
*/
'secure' => env('SESSION_SECURE_COOKIE'),
/*
|--------------------------------------------------------------------------
| HTTP Access Only
|--------------------------------------------------------------------------
|
| Setting this value to true will prevent JavaScript from accessing the
| value of the cookie and the cookie will only be accessible through
| the HTTP protocol. You are free to modify this option if needed.
|
*/
'http_only' => true,
/*
|--------------------------------------------------------------------------
| Same-Site Cookies
|--------------------------------------------------------------------------
|
| This option determines how your cookies behave when cross-site requests
| take place, and can be used to mitigate CSRF attacks. By default, we
| will set this value to "lax" since this is a secure default value.
|
| Supported: "lax", "strict", "none", null
|
*/
'same_site' => 'lax',
];
<?php
return [
/*
|--------------------------------------------------------------------------
| View Storage Paths
|--------------------------------------------------------------------------
|
| Most templating systems load templates from disk. Here you may specify
| an array of paths that should be checked for your views. Of course
| the usual Laravel view path has already been registered for you.
|
*/
'paths' => [
resource_path('views'),
],
/*
|--------------------------------------------------------------------------
| Compiled View Path
|--------------------------------------------------------------------------
|
| This option determines where all the compiled Blade templates will be
| stored for your application. Typically, this is within the storage
| directory. However, as usual, you are free to change this value.
|
*/
'compiled' => env(
'VIEW_COMPILED_PATH',
realpath(storage_path('framework/views'))
),
];
<?php
$domain_config = get_resource_config('domain');
return [
// 修改密码的token有效期
'tokenExpire' => 12 * 3600,
// 设置密码的token有效期
'setpasswdTokenExpire' => 3 * 24 * 3600,
// 登陆态的有效期
'skeyExpire' => 48 * 3600,
// skey打入的域名
'cookieDomain' => $domain_config['domain']['cookie_domains'],
// 注册邮箱的域名
'emailDomain' => 'ichunt.com',
// 邮件提醒重置密码的密码有效期
'passwdExpireDays' => 90,
// 邮件提醒重置密码最高次数
'passwdExpireNotifyTimes' => 3,
// 登陆错误锁定次数
'maxPasswdIncorrectTimes' => 5,
// 帐号系统的管理员
'admin' => [
'admin@ichunt.com',
'yyc@ichunt.com'
],
// ldap配置
'ldap' => [
'host' => get_resource_config_section('ldap', 'common')['host'],
'dn' => get_resource_config_section('ldap', 'common')['dn'],
'passwd' => get_resource_config_section('ldap', 'common')['passwd'],
'port' => get_resource_config_section('ldap', 'common')['port']
],
// 权限系统域名
'perm_url' => $domain_config['domain']['perm_url'],
// 账号系统
'user_url' => $domain_config['domain']['user_domain'],
// 获取用户权限接口
'perm_api' => $domain_config['domain']['perm_api'],
// API上传接口
'api_domain' => $domain_config['upload']['upload_url'],
'upload_key' => $domain_config['upload']['upload_key'],
"api_url" => $domain_config['domain']['api_domain'],
// 尽调账号屏蔽站点
'hide_site' => [
$domain_config['domain']['shuju_domain'],
$domain_config['domain']['crm_domain']
],
];
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
class UserFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'name' => $this->faker->name(),
'email' => $this->faker->unique()->safeEmail(),
'email_verified_at' => now(),
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
'remember_token' => Str::random(10),
];
}
/**
* Indicate that the model's email address should be unverified.
*
* @return \Illuminate\Database\Eloquent\Factories\Factory
*/
public function unverified()
{
return $this->state(function (array $attributes) {
return [
'email_verified_at' => null,
];
});
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->rememberToken();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('users');
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePasswordResetsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('password_resets', function (Blueprint $table) {
$table->string('email')->index();
$table->string('token');
$table->timestamp('created_at')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('password_resets');
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateFailedJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('failed_jobs', function (Blueprint $table) {
$table->id();
$table->string('uuid')->unique();
$table->text('connection');
$table->text('queue');
$table->longText('payload');
$table->longText('exception');
$table->timestamp('failed_at')->useCurrent();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('failed_jobs');
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePersonalAccessTokensTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('personal_access_tokens', function (Blueprint $table) {
$table->id();
$table->morphs('tokenable');
$table->string('name');
$table->string('token', 64)->unique();
$table->text('abilities')->nullable();
$table->timestamp('last_used_at')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('personal_access_tokens');
}
}
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder
{
/**
* Seed the application's database.
*
* @return void
*/
public function run()
{
// \App\Models\User::factory(10)->create();
}
}
This diff could not be displayed because it is too large.
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "mix",
"watch": "mix watch",
"watch-poll": "mix watch -- --watch-options-poll=1000",
"hot": "mix watch --hot",
"prod": "npm run production",
"production": "mix --production"
},
"devDependencies": {
"axios": "^0.21",
"laravel-mix": "^6.0.6",
"lodash": "^4.17.19",
"postcss": "^8.1.14"
}
}
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
>
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">./tests/Unit</directory>
</testsuite>
<testsuite name="Feature">
<directory suffix="Test.php">./tests/Feature</directory>
</testsuite>
</testsuites>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./app</directory>
</include>
</coverage>
<php>
<server name="APP_ENV" value="testing"/>
<server name="BCRYPT_ROUNDS" value="4"/>
<server name="CACHE_DRIVER" value="array"/>
<!-- <server name="DB_CONNECTION" value="sqlite"/> -->
<!-- <server name="DB_DATABASE" value=":memory:"/> -->
<server name="MAIL_MAILER" value="array"/>
<server name="QUEUE_CONNECTION" value="sync"/>
<server name="SESSION_DRIVER" value="array"/>
<server name="TELESCOPE_ENABLED" value="false"/>
</php>
</phpunit>
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Send Requests To Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
This diff could not be displayed because it is too large.
/* cyrillic-ext */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 300;
src: local('Open Sans Light'), local('OpenSans-Light'), url(/fonts/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTa-j2U0lmluP9RWlSytm3ho.woff2) format('woff2');
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
}
/* cyrillic */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 300;
src: local('Open Sans Light'), local('OpenSans-Light'), url(/fonts/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTZX5f-9o1vgP2EXwfjgl7AY.woff2) format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek-ext */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 300;
src: local('Open Sans Light'), local('OpenSans-Light'), url(/fonts/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTRWV49_lSm1NYrwo-zkhivY.woff2) format('woff2');
unicode-range: U+1F00-1FFF;
}
/* greek */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 300;
src: local('Open Sans Light'), local('OpenSans-Light'), url(/fonts/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTaaRobkAwv3vxw3jMhVENGA.woff2) format('woff2');
unicode-range: U+0370-03FF;
}
/* vietnamese */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 300;
src: local('Open Sans Light'), local('OpenSans-Light'), url(/fonts/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTf8zf_FOSsgRmwsS7Aa9k2w.woff2) format('woff2');
unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 300;
src: local('Open Sans Light'), local('OpenSans-Light'), url(/fonts/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTT0LW-43aMEzIO6XUTLjad8.woff2) format('woff2');
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 300;
src: local('Open Sans Light'), local('OpenSans-Light'), url(/fonts/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTegdm0LZdjqr5-oayXSOefg.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
/* cyrillic-ext */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
src: local('Open Sans'), local('OpenSans'), url(/fonts/opensans/v13/K88pR3goAWT7BTt32Z01mxJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
}
/* cyrillic */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
src: local('Open Sans'), local('OpenSans'), url(/fonts/opensans/v13/RjgO7rYTmqiVp7vzi-Q5URJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek-ext */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
src: local('Open Sans'), local('OpenSans'), url(/fonts/opensans/v13/LWCjsQkB6EMdfHrEVqA1KRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
unicode-range: U+1F00-1FFF;
}
/* greek */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
src: local('Open Sans'), local('OpenSans'), url(/fonts/opensans/v13/xozscpT2726on7jbcb_pAhJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
unicode-range: U+0370-03FF;
}
/* vietnamese */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
src: local('Open Sans'), local('OpenSans'), url(/fonts/opensans/v13/59ZRklaO5bWGqF5A9baEERJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
src: local('Open Sans'), local('OpenSans'), url(/fonts/opensans/v13/u-WUoqrET9fUeobQW7jkRRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
src: local('Open Sans'), local('OpenSans'), url(/fonts/opensans/v13/cJZKeOuBrn4kERxqtaUH3VtXRa8TVwTICgirnJhmVJw.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
/* cyrillic-ext */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 600;
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(/fonts/opensans/v13/MTP_ySUJH_bn48VBG8sNSq-j2U0lmluP9RWlSytm3ho.woff2) format('woff2');
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
}
/* cyrillic */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 600;
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(/fonts/opensans/v13/MTP_ySUJH_bn48VBG8sNSpX5f-9o1vgP2EXwfjgl7AY.woff2) format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek-ext */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 600;
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(/fonts/opensans/v13/MTP_ySUJH_bn48VBG8sNShWV49_lSm1NYrwo-zkhivY.woff2) format('woff2');
unicode-range: U+1F00-1FFF;
}
/* greek */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 600;
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(/fonts/opensans/v13/MTP_ySUJH_bn48VBG8sNSqaRobkAwv3vxw3jMhVENGA.woff2) format('woff2');
unicode-range: U+0370-03FF;
}
/* vietnamese */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 600;
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(/fonts/opensans/v13/MTP_ySUJH_bn48VBG8sNSv8zf_FOSsgRmwsS7Aa9k2w.woff2) format('woff2');
unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 600;
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(/fonts/opensans/v13/MTP_ySUJH_bn48VBG8sNSj0LW-43aMEzIO6XUTLjad8.woff2) format('woff2');
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 600;
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(/fonts/opensans/v13/MTP_ySUJH_bn48VBG8sNSugdm0LZdjqr5-oayXSOefg.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
/* cyrillic-ext */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 700;
src: local('Open Sans Bold'), local('OpenSans-Bold'), url(/fonts/opensans/v13/k3k702ZOKiLJc3WVjuplzK-j2U0lmluP9RWlSytm3ho.woff2) format('woff2');
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
}
/* cyrillic */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 700;
src: local('Open Sans Bold'), local('OpenSans-Bold'), url(/fonts/opensans/v13/k3k702ZOKiLJc3WVjuplzJX5f-9o1vgP2EXwfjgl7AY.woff2) format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek-ext */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 700;
src: local('Open Sans Bold'), local('OpenSans-Bold'), url(/fonts/opensans/v13/k3k702ZOKiLJc3WVjuplzBWV49_lSm1NYrwo-zkhivY.woff2) format('woff2');
unicode-range: U+1F00-1FFF;
}
/* greek */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 700;
src: local('Open Sans Bold'), local('OpenSans-Bold'), url(/fonts/opensans/v13/k3k702ZOKiLJc3WVjuplzKaRobkAwv3vxw3jMhVENGA.woff2) format('woff2');
unicode-range: U+0370-03FF;
}
/* vietnamese */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 700;
src: local('Open Sans Bold'), local('OpenSans-Bold'), url(/fonts/opensans/v13/k3k702ZOKiLJc3WVjuplzP8zf_FOSsgRmwsS7Aa9k2w.woff2) format('woff2');
unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 700;
src: local('Open Sans Bold'), local('OpenSans-Bold'), url(/fonts/opensans/v13/k3k702ZOKiLJc3WVjuplzD0LW-43aMEzIO6XUTLjad8.woff2) format('woff2');
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 700;
src: local('Open Sans Bold'), local('OpenSans-Bold'), url(/fonts/opensans/v13/k3k702ZOKiLJc3WVjuplzOgdm0LZdjqr5-oayXSOefg.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
/* cyrillic-ext */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 300;
src: local('Roboto Light'), local('Roboto-Light'), url(/fonts/roboto/v15/0eC6fl06luXEYWpBSJvXCBJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
}
/* cyrillic */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 300;
src: local('Roboto Light'), local('Roboto-Light'), url(/fonts/roboto/v15/Fl4y0QdOxyyTHEGMXX8kcRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek-ext */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 300;
src: local('Roboto Light'), local('Roboto-Light'), url(/fonts/roboto/v15/-L14Jk06m6pUHB-5mXQQnRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
unicode-range: U+1F00-1FFF;
}
/* greek */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 300;
src: local('Roboto Light'), local('Roboto-Light'), url(/fonts/roboto/v15/I3S1wsgSg9YCurV6PUkTORJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
unicode-range: U+0370-03FF;
}
/* vietnamese */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 300;
src: local('Roboto Light'), local('Roboto-Light'), url(/fonts/roboto/v15/NYDWBdD4gIq26G5XYbHsFBJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 300;
src: local('Roboto Light'), local('Roboto-Light'), url(/fonts/roboto/v15/Pru33qjShpZSmG3z6VYwnRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 300;
src: local('Roboto Light'), local('Roboto-Light'), url(/fonts/roboto/v15/Hgo13k-tfSpn0qi1SFdUfVtXRa8TVwTICgirnJhmVJw.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
/* cyrillic-ext */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
src: local('Roboto'), local('Roboto-Regular'), url(/fonts/roboto/v15/ek4gzZ-GeXAPcSbHtCeQI_esZW2xOQ-xsNqO47m55DA.woff2) format('woff2');
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
}
/* cyrillic */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
src: local('Roboto'), local('Roboto-Regular'), url(/fonts/roboto/v15/mErvLBYg_cXG3rLvUsKT_fesZW2xOQ-xsNqO47m55DA.woff2) format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek-ext */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
src: local('Roboto'), local('Roboto-Regular'), url(/fonts/roboto/v15/-2n2p-_Y08sg57CNWQfKNvesZW2xOQ-xsNqO47m55DA.woff2) format('woff2');
unicode-range: U+1F00-1FFF;
}
/* greek */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
src: local('Roboto'), local('Roboto-Regular'), url(/fonts/roboto/v15/u0TOpm082MNkS5K0Q4rhqvesZW2xOQ-xsNqO47m55DA.woff2) format('woff2');
unicode-range: U+0370-03FF;
}
/* vietnamese */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
src: local('Roboto'), local('Roboto-Regular'), url(/fonts/roboto/v15/NdF9MtnOpLzo-noMoG0miPesZW2xOQ-xsNqO47m55DA.woff2) format('woff2');
unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
src: local('Roboto'), local('Roboto-Regular'), url(/fonts/roboto/v15/Fcx7Wwv8OzT71A3E1XOAjvesZW2xOQ-xsNqO47m55DA.woff2) format('woff2');
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
src: local('Roboto'), local('Roboto-Regular'), url(/fonts/roboto/v15/CWB0XYA8bzo0kSThX0UTuA.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
/* cyrillic-ext */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 500;
src: local('Roboto Medium'), local('Roboto-Medium'), url(/fonts/roboto/v15/ZLqKeelYbATG60EpZBSDyxJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
}
/* cyrillic */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 500;
src: local('Roboto Medium'), local('Roboto-Medium'), url(/fonts/roboto/v15/oHi30kwQWvpCWqAhzHcCSBJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek-ext */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 500;
src: local('Roboto Medium'), local('Roboto-Medium'), url(/fonts/roboto/v15/rGvHdJnr2l75qb0YND9NyBJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
unicode-range: U+1F00-1FFF;
}
/* greek */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 500;
src: local('Roboto Medium'), local('Roboto-Medium'), url(/fonts/roboto/v15/mx9Uck6uB63VIKFYnEMXrRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
unicode-range: U+0370-03FF;
}
/* vietnamese */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 500;
src: local('Roboto Medium'), local('Roboto-Medium'), url(/fonts/roboto/v15/mbmhprMH69Zi6eEPBYVFhRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 500;
src: local('Roboto Medium'), local('Roboto-Medium'), url(/fonts/roboto/v15/oOeFwZNlrTefzLYmlVV1UBJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 500;
src: local('Roboto Medium'), local('Roboto-Medium'), url(/fonts/roboto/v15/RxZJdnzeo3R5zSexge8UUVtXRa8TVwTICgirnJhmVJw.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
/* cyrillic-ext */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 700;
src: local('Roboto Bold'), local('Roboto-Bold'), url(/fonts/roboto/v15/77FXFjRbGzN4aCrSFhlh3hJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
}
/* cyrillic */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 700;
src: local('Roboto Bold'), local('Roboto-Bold'), url(/fonts/roboto/v15/isZ-wbCXNKAbnjo6_TwHThJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek-ext */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 700;
src: local('Roboto Bold'), local('Roboto-Bold'), url(/fonts/roboto/v15/UX6i4JxQDm3fVTc1CPuwqhJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
unicode-range: U+1F00-1FFF;
}
/* greek */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 700;
src: local('Roboto Bold'), local('Roboto-Bold'), url(/fonts/roboto/v15/jSN2CGVDbcVyCnfJfjSdfBJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
unicode-range: U+0370-03FF;
}
/* vietnamese */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 700;
src: local('Roboto Bold'), local('Roboto-Bold'), url(/fonts/roboto/v15/PwZc-YbIL414wB9rB1IAPRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 700;
src: local('Roboto Bold'), local('Roboto-Bold'), url(/fonts/roboto/v15/97uahxiqZRoncBaCEI3aWxJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 700;
src: local('Roboto Bold'), local('Roboto-Bold'), url(/fonts/roboto/v15/d-6IYplOFocCacKzxwXSOFtXRa8TVwTICgirnJhmVJw.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
No preview for this file type
No preview for this file type
No preview for this file type
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
No preview for this file type
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
No preview for this file type
This diff could not be displayed because it is too large.
No preview for this file type
No preview for this file type
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment