12月
03
校准时间
有些时候,特别是虚拟机,跑着跑着,可能就不准了。校准时间就有必要了。
使用 ntpdate
这里使用 ntpdate
来纠正数据
# centos
yum install ntpdate
# ubuntu
apt-get install ntpdate
# 开始纠正
ntpdate -u ntp.api.bz
如果发现时间和上海时间相差 8 个小时,时区问题请解决,再执行上边的命令。
vim /etc/profile
G
# 调到末尾,加入下边的命令
export TZ='CST-8'
# 使得环境变量生效,再执行上边的命令纠正时区
source /etc/profile
如果经常纠正可以加入定时任务
参考
https://time.is/
https://www.cnblogs.com/luchuangao/p/7795293.html
https://blog.csdn.net/wblinux/article/details/81981328
https://blog.csdn.net/qq_27664167/article/details/80921327
https://www.cnblogs.com/st-jun/p/7737188.html
11月
24
官网
Homestead 安装的是 LTS 版本
sudo apt update
sudo apt install nodejs
11月
11
laravel 使用 npm
使用 yarn 来管理
npm config set registry=https://registry.npm.taobao.org
yarn config set registry https://registry.npm.taobao.org
yarn install
npm run watch-poll
假如使用 bootstrap
composer require laravel/ui --dev
php artisan ui bootstrap
11月
11
11月
10
uniapp 项目默认是没有 package.json,也就是默认不支持 npm 安装第三方包。有时候需要第三方包,这个时候自己就可以配置使用了。
文档
dcloud 文档
比如使用 TweenMax
比如使用 TweenMax
https://www.tweenmax.com.cn/
使用
npm init -y
npm install gsap
import { TweenLite } from 'gsap/TweenMax'
9月
25
商户操作:
- 安装操作证书 。 使用 mac chrome 安装完成控件后,发现 控件启动不了。这个时候可以这么操作。
- 浏览器输入 chrome://flags 回车
- 搜索 Native Client 将状态改成 enable
- 重启 chrome 即可。
- api 安全相关。
# 生成 32 位秘钥
# http://code.php.net.cn 在线编辑
// 创建随机字符串
function createNoncestr($length = 16)
{
$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
$str = "";
for($i = 0; $i < $length; $i ++)
{
$str .= substr ( $chars, mt_rand ( 0, strlen ( $chars ) - 1 ), 1 );
}
return $str;
}
$str = createNoncestr(32);
echo $str;
- api 证书
https://kf.qq.com/faq/180824JvUZ3i180824YvMNJj.html
- 点击更换证书,下载证书只做工具。
- 设置好路径,下一步生成即可。粘贴进网站上商户输入框。
- 再网站下一步,生成证书粘贴到工具中。下一步即可。然后打开之前设置的路径。就可以看到 zip文件了。
api 证书不影响支付,对提现等功能才有用。
9月
16
9月
12
这里的关键点:
1. redis 异步队列。
2. 多项目。
面对上边这种情况,怎么处理呢。如果不处理又会出现什么现象呢。
因为我们使用 supervisord 进行常驻队列侦听。如果不指定对应的 queue,多项目就会出现串的情况。这个是就可以用 queue 来处理该问题了。
处理
- 修改 supervisord 的配置文件。在 command 中指定一个 queue 。如
command=/alidata/service/php/bin/php /alidata/www/www.mlxiu.com/artisan queue:work redis --queue=test --sleep=3 --tries=3
- 在项目中,指定 queue。因为使用的是 laravel 框架。 队列继承 ShouldQueue。 可以在构造函数中指定 queue 即可。
public function __construct($id)
{
$queueName = config('queue.name');
if ($queueName) {
$this->onQueue($queueName);
}
}
queue.name 是自己额外在 queue.config 中添加的变量。
参考
https://www.cnblogs.com/zgxblog/p/10996112.html