自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

小北在远方

小小程序员一枚

  • 博客(60)
  • 资源 (1)
  • 收藏
  • 关注

原创 nodejs中查询时间段之间的数据如何处理前台时间和UTC时间转换?

当你在写程序时,是否遇到这种问题呢?查询2018-5-23到2018-5-26之间的数据得到结果:数据库数据为:程序代码:发现查询的数据和数据库的数据不一致,这是因为页面传入的时间和数据库时间存在时间转换的问题。解决方案:1.把前台发过来的数据转换成utc时间2.结束日期转成毫秒数加上86400000,转成utc时间,进行查询就可以得到想要的数据了。代码如下:查询结果如下:一起交流学习,更多内容请...

2018-05-23 23:11:24 6036 4

原创 微信公众号nodejs开发如何发送模板消息

如果第一次做,真的会出现bug,我的小小经验分享下。有没有遇到过这种情况?按照如下方案解决就可以得到如下图:第一步:先找到appid 和appsercretvar appid ='wx404e85e2c4fb7e5e';var appsercret ='bc414ae918cc55287b2d890c11866301';第二步:查看api 第三步:写代码进行测试:send.jsvar wechat...

2018-05-07 22:32:46 3782 2

原创 fatal: Authentication failed for git连接报错解决方案

第一次账号密码登录失败,git拉取代码报错,解决方案:控制面板,用户账号,账号,找到网址,修改正确账号密码,重新拉取就可以了

2020-03-16 21:42:13 314

转载 sequelize搭建模型代码

const fs = require('fs');const path = require('path');const Sequelize = require('sequelize');const basename = path.basename(module.filename);const env = process.env.NODE_ENV || 'development';cons...

2019-06-21 14:07:27 672

原创 TypeError: Super expression must either be null or a function, not undefined

解决方案:检查Component 大小写问题

2019-06-14 14:10:51 3238

原创 Unknown plugin "styled-jsx/babel" specified in "base" at 1解决方案

ErrorModule build failed (from ./node_modules/babel-loader/lib/index.js):ReferenceError: Unknown plugin "styled-jsx/babel" specified in "base" at 1, attempted to resolve relative to "D:\\zbyProject\...

2019-06-14 13:55:00 880

原创 fontawesome在react中使用步骤

安装依赖npm i --save @fortawesome/fontawesomenpm i --save @fortawesome/react-fontawesomenpm i --save @fortawesome/fontawesome-svg-core组件中引入import {FontAwesomeIcon} from '@fortawesome/react-fonta...

2019-06-13 15:47:36 1172

原创 React中报Object.value is not a function问题

nodejs版本原因,升级到8以上版本

2019-06-13 14:55:39 3485

转载 axios在react中用法

链接:https://www.npmjs.com/package/axios

2019-05-08 17:16:38 2801

转载 常用正则表达式链接

https://www.cnblogs.com/fozero/p/7868687.html

2019-05-07 09:31:08 716

转载 Web前端开发常用英文

(一)网页内容类标题: title摘要: summary箭头: arrow商标: label网站标志: logo转角/圆角: corner横幅广告: banner子菜单: subMenu搜索: search搜索框: searchBox登录: login登录条:loginbar工具条: toolbar下拉: drop标签页: tab当前的: current列表: ...

2019-04-28 00:07:32 7082 1

转载 jsxstyle安装方法

地址:https://www.npmjs.com/package/styled-jsxnpminstall--savestyled-jsx{"plugins":["styled-jsx/babel"]}

2019-04-26 11:54:49 121

转载 nwb和 react 搭建项目参考文档

https://github.com/insin/nwbnpm install -g nwbnwb new react-app my-appcd my-app/npm start

2019-04-26 09:31:50 598 1

转载 js代码规范参考文档

https://github.com/airbnb/javascript

2019-04-25 11:18:01 257

转载 react搭建项目修改端口文件位置

node_modules\react-scripts\scripts\start.js文件下:const DEFAULT_PORT = parseInt(process.env.PORT, 10) || 3000;const HOST = process.env.HOST || '0.0.0.0';

2019-04-20 20:17:51 785

转载 react搭建项目的快捷方式

1.先安装nodejs2.使用npm全局安装create-react-appnpm install -g create-react-app3.创建项目create-react-app myproject4切换到项目目录cd myproject5启动项目npm start...

2019-04-10 22:30:53 322

转载 vue 引入jquery bootstrap参考地址

https://www.cnblogs.com/hedeyong/p/7864842.html

2019-03-24 10:54:27 137

转载 前后端跨域问题解决方案express

在nodejs中app.js内添加如下代码就可以解决了app.all('*', function (req, res, next) {res.header("Access-Control-Allow-Origin", "*");res.header("Access-Control-Allow-Headers", "X-Requested-With");res.header("Acc...

2019-03-16 19:27:29 477

转载 vue前后端端口不一致解决方案

在config index.js文件中引入如下代码即可proxyTable: {'/api': {target: 'http://localhost:3000',//要访问的后端接口changeOrigin: true,pathRewrite: {'^/api': '/'//这里的配置是正则表达式,以/api开头的将会被用用‘/api'替换掉,假如后台文档...

2019-03-16 19:25:54 13967 2

转载 web前端开发常用英文

(一)网页内容类标题: title摘要: summary箭头: arrow商标: label网站标志: logo转角/圆角: corner横幅广告: banner子菜单: subMenu搜索: search搜索框: searchBox登录: login登录条:loginbar工具条: toolbar下拉: drop标签页: tab当前的: current列表: ...

2019-03-10 10:58:37 4093

转载 nodejs图片上传Multer

参考文档链接:https://github.com/expressjs/multer/blob/master/doc/README-zh-cn.md

2019-01-02 11:00:13 988

转载 nodejs图片上传下载链接multer

https://github.com/expressjs/multer/blob/master/doc/README-zh-cn.md

2018-12-18 18:18:24 471

转载 nodejs发送http请求代码链接

https://www.cnblogs.com/bruce-gou/p/6375180.html

2018-12-18 18:17:08 1947 1

原创 Dialect needs to be explicitly supplied as of v4.0.0解决方案

nodejs报错:Dialect needs to be explicitly supplied as of v4.0.0解决方案:少了dialect配置 

2018-12-14 12:02:50 5258

转载 mysql在windows下的下载和安装技巧

下载教程https://jingyan.baidu.com/article/a3f121e4a6eb67fc9052bbf4.html安装连接教程:https://jingyan.baidu.com/article/a3f121e4a6eb67fc9052bbf4.html下载连接https://dev.mysql.com/downloads/file/?id=479862...

2018-10-20 23:36:45 98

原创 字符串中汉字和数字转换成拼音

var transliteration =require(‘transliteration’);ToPin('你好123');代码:function ToPin(str){var array =[];var newstr ="";for(var i=0;i<str.length;i++){var charat =str.charAt(i)+"";var reg...

2018-09-21 10:02:41 1102

转载 websocket链接

https://www.npmjs.com/package/ws

2018-09-18 16:14:05 190

转载 nodejs 中map技巧

var myMap = new Map();myMap.set(0, "zero");myMap.set(1, "one");for (var [key, value] of myMap) { console.log(key + " = " + value);}

2018-09-16 17:15:21 26145

原创 nodejs保存自动启动程序方法

 插件:supervisornpm install supervisor -g 如果启动是 node app.js    使用命令:supervisor app.js启动是 n'p'm start        使用命令:supervisor  ./bin/www 

2018-09-10 12:47:33 1498

转载 给已经建好的表加上唯一性约束

 给已经建好的表加上唯一性约束ALTER TABLE `users` ADD unique(`username`);

2018-09-08 10:20:55 10849

转载 Lua下载地址链接windows

Lua下载地址链接windows:https://github.com/rjpcomputing/luaforwindows/releases

2018-09-07 14:15:11 1688

原创 数据库时间转化

数据库时间:2018-09-03 00:00:00不转化页面时间:2018-09-03 08:00:00 数据库时间转化方法:function changeTime(time){var time1 =new Date(time).getTime()-86400000/3;return new Date(time1).toLocaleString();}转化后时间:2...

2018-09-04 18:32:10 457

翻译 vue搭建开发环境命令

条件:电脑已将安装和配置了nodejs环境npm install -g cnpm --registry=https://registry.npm.taobao.orgcnpm install vue -gvue init webpack-simple mytestcd mytestnpm installnpm run devlocallhost:8080...

2018-09-02 12:20:30 145

原创 vue搭建开发环境

第一步:进入文件目录第二步:在命令窗口输入:npm install -g cnpm –registry=https://registry.npm.taobao.org第三步:cnpm install -g vue-cli第四步:vue -V第五步:vue init webpack demo1第六步:进入目录 输入npm run dev页面输入:1...

2018-08-24 14:30:29 143

原创 nodejs后台获得access_token

var http = require('http');var request = require('request');var qs = require('querystring'); function getToken(req,res){varurl="https://api.weixin.qq.com/cgi-bin/token?grant_type=client_cred...

2018-08-23 17:35:46 2342

原创 GET /socket.io/?EIO=3&transport=polling&t=MLaWYlC 404 10.986 ms - 1665报错解决方案

nodejs启动程序报:GET /socket.io/?EIO=3&transport=polling&t=MLaWYlC 404 10.986 ms - 1665 解决方案:在bin 下的www中加入var io = require('socket.io').listen(server);...

2018-08-23 10:05:32 19606 1

原创 小程序发送模板信息案例

越简单越好,代码简洁就是效率。复制粘贴就可以测试了,不用谢我,哈哈!!var http = require('http');var request = require('request');var qs = require('querystring');router.get('/',function(req,res){//// 模板消息 // 引入req...

2018-08-13 21:26:45 746

原创 微信小程序登陆核心代码

//微信小程序登陆核心代码router.get('/mobile',function(req,resp){    //appid   //小程序后台代码    const appid = 'aaaa';      const appsecret = 'bbbbbbb';      var code =req.query.code;      console.log(code);  ...

2018-08-07 12:05:46 444

原创 腾讯云nodejs短信模板案例

 //传入参数电话号码,短信模板//phoneNumbers, 发送的电话号码//templId,短信模板//params短信中变量的实际参数function sendMessage(phoneNumbers,templId,params,res){var QcloudSms = require("qcloudsms_js");var appid = 123456;...

2018-07-31 16:04:08 1048

转载 腾讯云nodejs发送短信文档

地址:https://cloud.tencent.com/document/product/382/3772

2018-07-31 15:12:56 1234

express搭建nodejs项目源代码

nodejs基于express框架搭建项目的代码,直接通过127.0.0.1:3000就可以直接访问

2018-07-17

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除