Write the Code. Change the World.

12月 04

npm config set registry https://registry.npm.taobao.org 

npm config get registry 
– 或npm info express

安装 ant design pro

npm create umi

# 选择 ant design pro
# 选择 typescript或javascript

阅读全文 >>

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月 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

阅读全文 >>

9月 25

商户操作:

  1. 安装操作证书 。 使用 mac chrome 安装完成控件后,发现 控件启动不了。这个时候可以这么操作。
  • 浏览器输入 chrome://flags 回车
  • 搜索 Native Client 将状态改成 enable
  • 重启 chrome 即可。
  1. 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;
  1. api 证书

https://kf.qq.com/faq/180824JvUZ3i180824YvMNJj.html

  • 点击更换证书,下载证书只做工具。
  • 设置好路径,下一步生成即可。粘贴进网站上商户输入框。
  • 再网站下一步,生成证书粘贴到工具中。下一步即可。然后打开之前设置的路径。就可以看到 zip文件了。

api 证书不影响支付,对提现等功能才有用。

阅读全文 >>