2023年Web前端UI框架推荐
1、View UI Plus
https://iviewui.com/
2、Navie UI
https://www.naiveui.com/zh-CN/os-theme
3、Element Plus
https://element-plus.gitee.io/zh-CN/
4、Layui
https://layui.gitee.io/v2/
5、Bootstrap
https://www.bootcss.com/
1、View UI Plus
https://iviewui.com/
2、Navie UI
https://www.naiveui.com/zh-CN/os-theme
3、Element Plus
https://element-plus.gitee.io/zh-CN/
4、Layui
https://layui.gitee.io/v2/
5、Bootstrap
https://www.bootcss.com/
类型 | 示例 |
---|---|
整型(整数类型) | sbyte、byte、short、ushort、int、uint、long、ulong、char |
浮点型 | float、double |
十进制类型 | decimal |
布尔型 | true、false |
空类型 | 可为空值的数据类型 |
语言 | 主要用途 |
---|---|
C | 操作系统、嵌入式、驱动开发 |
C++ | 图形图像、科研、通信、桌面软件、游戏、游戏服务器 |
C# | window桌面应用、.Net web、服务器 |
Java | Java SE:跨平台的桌面应用、Android Java EE:企业级应用、web开发、服务器后端 Java ME:手机应用、流行非智能手机时代 Java Android:用于开发安卓手机应用 |
Go | 高性能服务器应用、比较年轻 |
Erlang | 高并发服务器应用,多用于游戏服务器 |
Python | Web、科学计算、运维 |
PHP | Web应用、后端服务器开发 |
Ruby | Web |
Perl | 运维、文本处理 |
Lisp | 科研、一种逻辑语言,用于人工智能 |
Node | 一个 Javascript运行环境 |
Haskell | 一种标准化的通用函数式编程语言,用于数学逻辑方面 |
Scala | 一种类似Java的编程语言,集成面向对象和函数式编程的各种特性 |
Javascript | 前端,在node中可以做后端 |
TypeScript | 前端,是javascript的超级,增加了强类型等特性 |
Html/CSS | 标记语言,主要是给web前端工程师构建页面 |
还有一些没考虑到的,望见谅!
记:*[4]Type
记:[4]*Type
记:
var a func()
a = fun1
a()
linux
平台:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build main.go
windows
平台下.exe:
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build main.go
/**
* 检查登录频率限制
*
* @param $username
* @return void
* @throws BusinessException
*/
protected function checkLoginLimit($username)
{
$username = 'liziyu';
$limit_log_path = runtime_path() . '/login';
if (!is_dir($limit_log_path)) {
mkdir($limit_log_path, 0777, true);
}
$limit_file = $limit_log_path . '/' . md5($username) . '.limit';
$time = date('YmdH') . ceil(date('i')/5);
$limit_info = [];
if (is_file($limit_file)) {
$json_str = file_get_contents($limit_file);
$limit_info = json_decode($json_str, true);
}
if (!$limit_info || $limit_info['time'] != $time) {
$limit_info = [
'username' => $username,
'count' => 0,
'time' => $time
];
}
$limit_info['count']++;
file_put_contents($limit_file, json_encode($limit_info));
if ($limit_info['count'] >= 5) {
throw new BusinessException('登录失败次数过多,请5分钟后再试');
}
}
转自:https://github.com/webman-php/admin/blob/main/src/plugin/admin/app/controller/common/AccountController.php
<?php
/**
* MineAdmin is committed to providing solutions for quickly building web applications
* Please view the LICENSE file that was distributed with this source code,
* For the full copyright and license information.
* Thank you very much for using MineAdmin.
*
* @Author X.Mo<root@imoi.cn>
* @Link https://gitee.com/xmo/MineAdmin
*/
namespace Mine\Redis;
use Hyperf\Utils\Coroutine;
use Mine\Abstracts\AbstractRedis;
use Mine\Exception\NormalStatusException;
use Mine\Interfaces\MineRedisInterface;
class MineLockRedis extends AbstractRedis implements MineRedisInterface
{
/**
* 设置 key 类型名
* @param string $typeName
*/
public function setTypeName(string $typeName): void
{
$this->typeName = $typeName;
}
/**
* 获取key 类型名
* @return string
*/
public function getTypeName(): string
{
return $this->typeName;
}
/**
* 运行锁,简单封装
* @param \Closure $closure
* @param string $key
* @param int $expired
* @param int $timeout
* @param float $sleep
* @return bool
* @throws \Throwable
*/
public function run(\Closure $closure, string $key, int $expired, int $timeout = 0, float $sleep = 0.1): bool
{
if (! $this->lock($key, $expired, $timeout, $sleep)) {
return false;
}
try {
call_user_func($closure);
} catch (\Throwable $e) {
logger('Redis Lock')->error(t('mineadmin.redis_lock_error'));
throw new NormalStatusException(t('mineadmin.redis_lock_error'), 500);
} finally {
$this->freed($key);
}
return true;
}
/**
* 检查锁
* @param string $key
* @return bool
* @throws \Psr\Container\ContainerExceptionInterface
* @throws \Psr\Container\NotFoundExceptionInterface
*/
public function check(string $key): bool
{
return redis()->exists($this->getKey($key));
}
/**
* 添加锁
* @param string $key
* @param int $expired
* @param int $timeout
* @param float $sleep
* @return bool
* @throws \Psr\Container\ContainerExceptionInterface
* @throws \Psr\Container\NotFoundExceptionInterface
*/
public function lock(string $key, int $expired, int $timeout = 0, float $sleep = 0.1): bool
{
$retry = $timeout > 0 ? intdiv($timeout * 100, 10) : 1;
$name = $this->getKey($key);
while ($retry > 0) {
$lock = redis()->set($name, 1, ['nx', 'ex' => $expired]);
if ($lock || $timeout === 0) {
break;
}
Coroutine::id() ? Coroutine::sleep($sleep) : usleep(9999999);
$retry--;
}
return true;
}
/**
* 释放锁
* @param string $key
* @return bool
* @throws \Psr\Container\ContainerExceptionInterface
* @throws \Psr\Container\NotFoundExceptionInterface
*/
public function freed(string $key): bool
{
$luaScript = <<<Lua
if redis.call("GET", KEYS[1]) == ARGV[1] then
return redis.call("DEL", KEYS[1])
else
return 0
end
Lua;
return redis()->eval($luaScript, [$this->getKey($key), 1], 1) > 0;
}
}
获取系统的高精度时间,还是有点点限制的!
hrtime(true);
如下:
128817029472663
128817029474711
128817029476773
128817029478813
128817029480874
$ which php
$ vim ~/.bash_profile
$ export PATH=/Applications/MAMP/bin/php/php7.2.7/bin:$PATH
$ #/Applications/MAMP/bin/php/php7.2.7/bin是我的php版本路径
$ source ~/.bash_profile
$ php -v
1、vim ~/.zshrc
2、source~/.bash_profile