月度归档: 2020年3月

nginx 的 if 逻辑运算判断PC或移动端

“proxy_pass” cannot have URI part in location given by regular expression, or inside named location nginx无法在proxy_pass指令中处理所需的URI部分,因为位于指定的位置(因此是错误消息)。这是因为nginx是以模块化的方式构建的,每个配置块都是由各个模块在各个阶段读取的。proxy_pass在以下情况下,指令中不能有URI : 正则表达式位置 命名的地点 if 块 正确示例: server {     listen       81;     server_ …

nodemailer 发送邮件坑点

送信服务代码请查看前序文章: nodejs发邮件 POP3/SMTP服务、需获取授权码 首先需要开启邮箱的 POP3/SMTP 服务。 163邮箱需要使用第三方客户端授权码,而不是163邮箱密码。 进入163邮箱,设置-账户-开启服务 POP3/SMTP 服务,并生成授权码,现在获取授权码需要验证手机短信。 535 错误 Error: Invalid login: 535 Error: authentication failed 认证失败: 可能是账号密码错误 链接资源池时加 ssl:secureConnection: true, QQ 的 host 是 http://smtp.qq.com; …

解决 Could not find a version that satisfies the requirement torch==1.4.0

安装 torchvision pip install torchvision 结果显示: ERROR: Could not find a version that satisfies the requirement torch==1.4.0 (from torchvision) (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2) ERROR: No matching distribution found for torch==1.4.0 (from torchvision) 解决方案 第一步 pip install torch==1.3.1 -f …

javascript 调用摄像头

MediaDevices.getUserMedia() 会提示用户给予使用媒体输入的许可,媒体输入会产生一个MediaStream,里面包含了请求的媒体类型的轨道。此流可以包含一个视频轨道(来自硬件或者虚拟视频源,比如相机、视频采集设备和屏幕共享服务等等)、一个音频轨道(同样来自硬件或虚拟音频源,比如麦克风、A/D转换器等等),也可能是其它轨道类型。 <!doctype html> <html> <head>   <title>js调用摄像头拍照上传图片</title>   <meta charset=“utf-8& …