摘要: 创建一个最基本的http服务,需要引入两个核心模块。 http模块及fs模块。 在http创建的服务里,有两个基本参数(request、response) request能够获取,请求方法 、请求的url地址 、请求头 (实际客户端传来的有,方法、url、协议版本(http协议)、请求头、请求体) 阅读全文
posted @ 2017-12-05 09:40 星光璀璨的夜空 阅读(201) 评论(0) 推荐(0) 编辑
摘要: axios({ url: '/api/index/getIndexlbt', method: 'post', data: { relevanceId:this.$route.params.id, pictureType:4 }, ... 阅读全文
posted @ 2017-11-15 19:30 星光璀璨的夜空 阅读(13706) 评论(0) 推荐(0) 编辑
摘要: let http = require('http'); let util = require('util'); http.get('http://www.hao123.com/sugdata_s4.json?r=-838709', (res) => { const { statusCode } = res; const contentType = res.headers['con... 阅读全文
posted @ 2017-11-03 10:16 星光璀璨的夜空 阅读(192) 评论(0) 推荐(0) 编辑
摘要: let http = require('http'); let url = require('url'); let util = require('util'); let server = http.createServer((req,res)=>{ res.statusCode = 200; res.setHeader("Content-Type","text/plain; cha... 阅读全文
posted @ 2017-11-03 10:11 星光璀璨的夜空 阅读(192) 评论(0) 推荐(0) 编辑
摘要: /*User.js*/ exports.userName = 'Tom'; exports.sayHello = function () { return 'wwwwww' } /*或者*/ module .exports = { userName:"jack", sayHello: function () { return 'Hello'; } } /*引用*... 阅读全文
posted @ 2017-11-03 10:09 星光璀璨的夜空 阅读(195) 评论(0) 推荐(0) 编辑
摘要: let checkLogin = function () { return new Promise(function (resolve, reject) { let flag = document.cookie.indexOf('userId')>-1?true:false; if(!flag){ ... 阅读全文
posted @ 2017-11-01 11:36 星光璀璨的夜空 阅读(194) 评论(0) 推荐(0) 编辑
摘要: function sum(x,y,z){ let total = 0; if(x)total+=x; if(y)total+=y; if(z)total+=z; console.log(`total:${total}`); } sum(5,'',9) function sum2(.... 阅读全文
posted @ 2017-11-01 11:35 星光璀璨的夜空 阅读(224) 评论(0) 推荐(0) 编辑
摘要: 其一: 给html和body添加 其二: 给需要滑动的div添加 其三: 隐藏掉侧边栏 阅读全文
posted @ 2017-08-10 14:16 星光璀璨的夜空 阅读(563) 评论(0) 推荐(0) 编辑
摘要: 和数组一样,Vue 不能检测到对象属性的添加或删除。由于 Vue 会在初始化实例时对属性执行 getter/setter 转化过程,所以属性必须在 data 对象上存在才能让 Vue 转换它,这样才能让它是响应的。 两种不同情况下使用的方法: 如果想向已有对象上添加一些属性,例如使用 Object. 阅读全文
posted @ 2017-07-19 11:59 星光璀璨的夜空 阅读(4791) 评论(0) 推荐(0) 编辑
摘要: 进来后与出去前皆为100%宽 阅读全文
posted @ 2017-07-01 16:50 星光璀璨的夜空 阅读(290) 评论(0) 推荐(0) 编辑