diff --git a/20191117/20171117.md b/20191117/20171117.md index f416136..3d86bc0 100644 --- a/20191117/20171117.md +++ b/20191117/20171117.md @@ -11,7 +11,7 @@ * 不关注过程,只关注结果 * 是模拟的类,抽象 * 特点 - * 封装:把一个功能封装成一个函数,把代码放进文件,把变量放进数组,把表达式放进函数,能重用的东西封装 + * 封装:把一个功能封装成一个函数,把代码放进文件,把变量放进数组,把表达式放进函数,属性放进对象,能重用的东西封装 * 继承:类与类的关系,js是模拟类,本质基于原型对象 * 多态:同一个行为,对不同的对象产生不同效果 * Object Oriented Programming 面向对象程序设计 oop diff --git a/20191211/20191211.md b/20191211/20191211.md index cca4c93..16460df 100644 --- a/20191211/20191211.md +++ b/20191211/20191211.md @@ -20,7 +20,7 @@ Object.__proto__ = null * 面向对象编程思想,都有类的概念,但是js没有类,但是可以通过构造函数模拟类,通过原型对象机继承,继承的目的是为了共享数据 * 原型的作用之一:共享数据,节省内存 * 原型的作用之二:实现继承 -* 多态 同一对象的不同行为或者同一行为针对同一对象产生的不同效果,现有继承后有多态 +* 多态 同一对象的不同行为或者同一行为针对同一对象产生的不同效果,先有继承后有多态 * 动物类 有名字, 颜色,都能吃 * 狗类 有名字, 颜色,也都能吃, 也能看门 diff --git a/20191221/20191221.md b/20191221/20191221.md new file mode 100644 index 0000000..9007471 --- /dev/null +++ b/20191221/20191221.md @@ -0,0 +1,31 @@ +# 20191221 + + + +* 原型的作用 + 1. 数据共享 + 2. 节省内存 +* 实现继承 ----> 数据共享 +* 通过原型进行继承 +* 缺陷:因为改变原型指向实现继承,必须同时进行初始化赋值,所以导致属性重复,如果想改变属性,只有通过调用对象属性重新赋值 +```js +function Person(name) { + this.name = name +} +Person.prototype.eat = function() { + console.log('真好吃') +} +// 创建学生对象 +function Student(score) { + this.score = score +} +Student.prototype = new Person('张三') +Student.prototype.play = function() { + console.log('每天都在写代码') +} +var st1 = new Student(100) +console.log(st1.name) +console.log(st1.eat) +console.log(st1.play) + +``` \ No newline at end of file diff --git a/Miscellaneous/cache.md b/Miscellaneous/cache.md new file mode 100644 index 0000000..cd125cb --- /dev/null +++ b/Miscellaneous/cache.md @@ -0,0 +1,34 @@ +* 学生端 + * 登录 学号,密码 学号密码身份证后六位 + * post + * cid + * psw + * md5 + * {'user_name', 'user_cid', 'content':[{},{}]} +* 管理端 + * 登录 is_admin + * post + * cid + * psw + * md5 + * [{'user_name', 'user_cid', 'content':[{},{}]},{}] + + * update + * cid + * week: NUM + * date: NUM + * type: STR + * content: STR + + * del + * cid + * week: NUM + * date: NUM + * type: STR + + * add + * cid + * week: NUM + * date: NUM + * type: STR + * content: STR \ No newline at end of file diff --git a/Miscellaneous/nginx.conf b/Miscellaneous/nginx.conf index b51f450..a50c467 100644 --- a/Miscellaneous/nginx.conf +++ b/Miscellaneous/nginx.conf @@ -28,34 +28,10 @@ server { } } -server { - listen 80; - server_name yb.powerrain.cn; - - location / { - root /data/yiban/yiban; - index index.html index.htm; - try_files $uri $uri/ /index.html; - } - - location /api/photo/show/ { - alias /data/yiban/backend/upload/; - } - - location /api { - proxy_pass http://127.0.0.1:8000; - } - - error_page 500 502 503 504 /50x.html; - location = /50x.html { - root /data/wwwroot; - } -} - server { listen 80; server_name blog.powerrain.cn; - + add_header Strict-Transport-Security "max-age=31536000"; location / { root /data/blog; index index.html index.htm; @@ -90,6 +66,30 @@ server { } } +server { + listen 80; + server_name yb.powerrain.cn; + add_header Strict-Transport-Security "max-age=31536000"; + location / { + root /data/yiban/yiban; + index index.html index.htm; + try_files $uri $uri/ /index.html; + } + + location /api/photo/show/ { + alias /data/yiban/backend/upload/; + } + + location /api { + proxy_pass http://127.0.0.1:8000; + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /data/wwwroot; + } +} + server { #SSL 访问端口号为 443 listen 443 ssl http2; #填写绑定证书的域名 @@ -127,7 +127,7 @@ server { server { listen 80; server_name m.yb.powerrain.cn; - + add_header Strict-Transport-Security "max-age=31536000"; location / { root /data/yiban/yiban; index index.html index.htm; @@ -185,21 +185,7 @@ server { server { listen 80; server_name powerrain.cn; - - location / { - root /data/wwwroot; - index index.html index.htm; - } - error_page 500 502 503 504 /50x.html; - location = /50x.html { - root /data/wwwroot; - } -} - -server { - listen 80; - server_name localhost; - + add_header Strict-Transport-Security "max-age=31536000"; location / { root /data/wwwroot; index index.html index.htm; @@ -233,3 +219,17 @@ server { root /data/wwwroot; } } + +server { + listen 80; + server_name localhost; + + location / { + root /data/wwwroot; + index index.html index.htm; + } + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /data/wwwroot; + } +} \ No newline at end of file diff --git a/README.md b/README.md index af8a88b..c9fc72f 100644 --- a/README.md +++ b/README.md @@ -147,4 +147,11 @@ * [上课视频链接](https://pan.baidu.com/s/1RFngCxipb5ZMZMx9nsNHBQ) 提取码:s3un ---- \ No newline at end of file +--- + +## 寒假作业 + * 面向对象 + * 轮播图 + * 选项卡 + * 放大镜 + * 计算器 \ No newline at end of file