intelx722不支持百兆网络
一辈子很短,努力的做好两件事就好;
第一件事是热爱生活,好好的去爱身边的人;
第二件事是努力学习,在工作中取得不一样的成绩,实现自己的价值,而不是仅仅为了赚钱;
热爱生活,努力学习,实现自己的价值
intelx722不支持百兆网络
一辈子很短,努力的做好两件事就好;
第一件事是热爱生活,好好的去爱身边的人;
第二件事是努力学习,在工作中取得不一样的成绩,实现自己的价值,而不是仅仅为了赚钱;
步骤一、vi /etc/hosts,添加下面三句
1 | 140.82.113.4 github.com |
//上面的网址IP也许会发生变化,这样就要修改ip,但目前来看IP还是这个
需要查看IP对不对的自行度娘就可以了
重启网络
1 | service network restart |
顺便说一下:Windows的也是一样的,修改hosts文件,将上面三句添加进去
在目录 “C:\Windows\System32\drivers\etc”
然后运行cmd,刷新dns,执行ipconfig /flushdns
1 | ipconfig /flushdns |
配置完成,重新下载速度就正常了!
GitHub的网址IP可能会变化,可以用下面的网址查
https://www.ipaddress.com/
一辈子很短,努力的做好两件事就好;
第一件事是热爱生活,好好的去爱身边的人;
第二件事是努力学习,在工作中取得不一样的成绩,实现自己的价值,而不是仅仅为了赚钱;
假如有个数组testArray 如下:
1 | var testArray = ["test4","test2", "test1", "test3"]; |
如果让其按照数组standardArray的固定元素来排序,数组standardArray如下:
1 | var standardArray = ["test1", "test2", "test3", "test4","test5"]; |
期望得到的结果是:
1 | var testArray = ["test1", "test2", "test3", "test4"]; |
则方法如下:
1 | testArray.sort(function (a, b) { |
sort参数说明:
若 a 小于 b,在排序后的数组中 a 应该出现在 b 之前,则返回一个小于 0 的值。
若 a 等于 b,则返回 0。
若 a 大于 b,则返回一个大于 0 的值。
在本例中,先确定testArray的每个元素在standardArray的位置。
var fruits = [“test4”,”test2”, “test1”, “test3”];
对应为 4,2,1,3
1 |
|
使用select into 可以快速创建表并将表数据同时插入新建表中
1 |
|
备份表数据还原,使用insert into 插入数据
1 | insert into [saleDetail] |
1 |
|
merge into 目标表 a
using 源表 b
on a.条件字段1=b.条件字段1 and a.条件字段2=b.条件字段2 …
when matched update set a.字段1=b.字段1,
a.字段2=b.字段2
when not matched insert values (b.字段1,b.字段2)
when not matched by source
then delete
1 | 例子: |
create table targetTable(ID INT primary key identity(1,1),[name] varchar(50),age int)
create table sourceTable(ID INT primary key identity(1,1),[name] varchar(50),age int)
insert into targetTable([name],age) values(‘大卫’,40)
merge into targetTable as t
using sourceTable as S on t.ID=s.ID
when matched –更新 目标表中有ID,则更新
then update set t.[name]=S.[name]
when not matched –添加 目标表中没有ID,在原表中有,则插入相关数据
then insert values (s.[name],s.age)
when not matched by source –目标表存在,源表不存在,则删除
then delete;
```
ant design vue 网站中的实例
https://www.antdv.com/components/table-cn/
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24<Table
customRow={(record) => {
return {
props: {
xxx... //属性
},
on: { // 事件
click: (event) => {}, // 点击行
dblclick: (event) => {},
contextmenu: (event) => {},
mouseenter: (event) => {}, // 鼠标移入行
mouseleave: (event) => {}
},
};
)}
customHeaderRow={(column) => {
return {
on: {
click: () => {}, // 点击表头行
}
};
)}
/>
html代码:customRow绑定一个click方法,名字自己可以随便起
1 | <a-table |
js代码:
1 | methods: { |
在js中的methods中创建方法click(record, index)。record与index 分别是该行的数据(可以获取到放在data-source中的所有属性,即使没有在表格中呈现出来的也可以获取到)和该行数据在表格中的下标。
通过上面的写法,我可以在双击表格某一行的时候,打印出这一行所绑定的data的全部内容。
1 | <a-table |
methods: {
click:function(row,rowIndex){
const thisSelf = this;
return {
onClick: () => {
console.log(row, rowIndex)
if(row.btyAccountingSubjectCode ==”1012”||row.btyAccountingSubjectCode ==”1131”||row.btyAccountingSubjectCode ==”2121”){
thisSelf.openBtyAssistAccountingBalanceInit(row);
}
}
};
/**
```
最近在项目中遇到一个需求需要在一个项目中直接引用另一个项目,尝试各种情况无果后选择了iframe。现将调用过程中遇到的问题做一个分享。
router.go()的使用
此情况主要适用于更改iframe中src值以后导致的路由跳转混乱。
详细描述:当多次更改iframe->src属性后,调用router.go(-1),不能实现路由后退上一级,而是将iframe当作一个窗口文档,调用了该窗口文档的window.history.go(-1),并未更改父级项目的路由后退功能。
解决办法:
不通过改变iframe->src属性值去访问具体内容,采用window.location.replace(url)更改iframe将访问的内容,具体代码如下:
A.html
1 | <template> |
注意ref=”iframe” 中iframe,的名字若在多个页面情况下,建议用不同的名称,不然打包之后会报错
this.$refs.iframe.contentWindow.location.replace(val) 同样也需要修改
两个项目之间相互通信,涉及到跨域问题,子页面不能直接调用父页面的方法,父页面同样不能调用子页面的方法。
错误详情:Error in created hook: “SecurityError: Blocked a frame with origin “http://*” from accessing a cross-origin frame.”
解决办法: postMessage
window.postMessage() 方法可以安全地实现跨源通信。该方法被调用时,会在所有页面脚本执行完毕之后向目标窗口派发一个MessageEvent消息。代码如下:
index.html
1 | <!DOCTYPE html> |
test.html
1 | <!doctype html> |
上面的例子实现了两个不同域的页面之间的通信。但由于我们此处用的是动态更改iframe.contentWindow.location来访问的内容,如果此处父页面要向子页面发起通信需要在iframe中页面加载完毕以后,不然子页面无法获取到通信数据。
应用场景
子页面需要调用父页面的方法或则使用父页面的数据时候,我们可以在子页面向父页面发起通信,让父页面调用该方法,或让父页面将数据传输过来。
注意事项
postMessage支持对象传递,但不是所有浏览器都支持对象传递,在使用中还是使用字符串传值更好。
1 | [warn] 19#19: *23 an upstream response is buffered to a temporary file /var/ |
在nginx.conf 的http 里加入如下一段得到解决
1
2
3
4fastcgi_buffer_size 128k;
fastcgi_buffers 8 128k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 128k;
另,如果nginx以proxy模式运行,则需更改上面一段为如下内容:
1
2
3
4proxy_buffer_size 128k;
proxy_buffers 8 128k;
proxy_busy_buffers_size 128k;
proxy_temp_file_write_size 128k;
注意:很多网上教程 fastcgi_buffers 8 128k;忘记加k ,这个会造成 [emerg] 1#1: “fastcgi_busy_buffers_size” must be less than the size of all “fastcgi_buffers”
完整nginx.conf配置如下
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37# nginx.conf 例:
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
fastcgi_buffer_size 128k;
fastcgi_buffers 8 128;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 128k;
include /etc/nginx/conf.d/*.conf;
}