-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
111 lines (102 loc) · 48.4 KB
/
index.html
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<!DOCTYPE html><html lang="zh-CN"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="theme-color" content="#0078E7"><meta name="author" content="忘忧"><meta name="copyright" content="忘忧"><meta name="generator" content="Hexo 5.4.0"><meta name="theme" content="hexo-theme-yun"><title>忘忧的小站</title><link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@900&display=swap" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/yun/yun-markdown.min.css"><script src="//at.alicdn.com/t/font_1140697_dxory92pb0h.js" async></script><script src="https://cdn.jsdelivr.net/npm/scrollreveal/dist/scrollreveal.min.js" defer></script><script>function initScrollReveal() {
[".post-card",".post-content img"].forEach((target)=> {
ScrollReveal().reveal(target);
})
}
document.addEventListener("DOMContentLoaded", initScrollReveal);
document.addEventListener("pjax:success", initScrollReveal);
</script><link id="light-prism-css" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@latest/themes/prism.css" media="(prefers-color-scheme: light)"><link id="dark-prism-css" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@latest/themes/prism-tomorrow.css" media="(prefers-color-scheme: dark)"><link rel="icon" type="image/png" href="/images/miao.png"><link rel="mask-icon" href="/images/miao.png" color="#0078E7"><link rel="preload" href="/js/ui/banner.js" as="script"><link rel="preload" href="/css/hexo-theme-yun.css" as="style"><link rel="preload" href="/js/utils.js" as="script"><link rel="preload" href="/js/hexo-theme-yun.js" as="script"><link rel="prefetch" href="/js/sidebar.js" as="script"><link rel="preconnect" href="https://cdn.jsdelivr.net" crossorigin><script id="yun-config">
const Yun = window.Yun || {};
window.CONFIG = {"hostname":"wangyou.ink","root":"/","title":"忘忧的小站","version":"1.7.0","mode":"auto","copycode":true,"page":{"isPost":false},"i18n":{"placeholder":"搜索...","empty":"找不到您查询的内容: ${query}","hits":"找到 ${hits} 条结果","hits_time":"找到 ${hits} 条结果(用时 ${time} 毫秒)"},"anonymous_image":"https://cdn.jsdelivr.net/gh/YunYouJun/cdn/img/avatar/none.jpg","say":{"api":"/data/sentences.json"},"local_search":{"path":"/search.xml"},"fireworks":{"colors":["102, 167, 221","62, 131, 225","33, 78, 194"]}};
</script><link rel="stylesheet" href="/css/hexo-theme-yun.css"><script src="/js/utils.js"></script><script src="/js/hexo-theme-yun.js"></script><link rel="alternate" href="/atom.xml" title="忘忧的小站" type="application/atom+xml"><meta name="description" content="热情没及格">
<meta property="og:type" content="website">
<meta property="og:title" content="忘忧的小站">
<meta property="og:url" content="https://wangyou.ink/index.html">
<meta property="og:site_name" content="忘忧的小站">
<meta property="og:description" content="热情没及格">
<meta property="og:locale" content="zh_CN">
<meta property="article:author" content="忘忧">
<meta name="twitter:card" content="summary"><script src="/js/ui/mode.js"></script></head><body class="is-home"><script defer src="https://cdn.jsdelivr.net/npm/animejs@latest"></script><script defer src="/js/ui/fireworks.js"></script><canvas class="fireworks"></canvas><div class="container"><a class="sidebar-toggle hty-icon-button" id="menu-btn"><div class="hamburger hamburger--spin" type="button"><span class="hamburger-box"><span class="hamburger-inner"></span></span></div></a><div class="sidebar-toggle sidebar-overlay"></div><aside class="sidebar"><script src="/js/sidebar.js"></script><div class="sidebar-panel sidebar-panel-active" id="site-overview-wrap"><div class="site-info"><a class="site-author-avatar" href="/about/" title="忘忧"><img width="96" loading="lazy" src="/images/xiaohei.jpg" alt="忘忧"><span class="site-author-status" title="慢慢">😶</span></a><div class="site-author-name"><a href="/about/">忘忧</a></div><a class="site-name" href="/about/site.html">忘忧的小站</a><sub class="site-subtitle"></sub><div class="site-desciption">热情没及格</div></div><nav class="site-state"><a class="site-state-item hty-icon-button icon-home" href="/" title="首页"><span class="site-state-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-home-4-line"></use></svg></span></a><div class="site-state-item"><a href="/archives/" title="归档"><span class="site-state-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-archive-line"></use></svg></span><span class="site-state-item-count">8</span></a></div><div class="site-state-item"><a href="/categories/" title="分类"><span class="site-state-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-folder-2-line"></use></svg></span><span class="site-state-item-count">5</span></a></div><div class="site-state-item"><a href="/tags/" title="标签"><span class="site-state-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-price-tag-3-line"></use></svg></span><span class="site-state-item-count">10</span></a></div><a class="site-state-item hty-icon-button" href="/" title="文档"><span class="site-state-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-settings-line"></use></svg></span></a></nav><hr style="margin-bottom:0.5rem"><div class="links-of-author"><a class="links-of-author-item hty-icon-button" rel="noopener" href="/atom.xml" title="RSS" target="_blank" style="color:orange"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-rss-line"></use></svg></a><a class="links-of-author-item hty-icon-button" rel="noopener" href="https://qun.qq.com/qqweb/qunpro/share?_wv=3&_wwv=128&appChannel=share&inviteCode=1W76eEB&businessType=9&from=181074&biz=ka&shareSource=5" title="QQ 2712334479" target="_blank" style="color:#12B7F5"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-qq-line"></use></svg></a><a class="links-of-author-item hty-icon-button" rel="noopener" href="https://github.com/jywangyou" title="GitHub" target="_blank" style="color:#6e5494"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-github-line"></use></svg></a><a class="links-of-author-item hty-icon-button" rel="noopener" href="https://weibo.com/u/6649593159" title="微博" target="_blank" style="color:#E6162D"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-weibo-line"></use></svg></a><a class="links-of-author-item hty-icon-button" rel="noopener" href="https://www.douban.com/people/190330783/" title="豆瓣" target="_blank" style="color:#007722"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-douban-line"></use></svg></a><a class="links-of-author-item hty-icon-button" rel="noopener" href="https://music.163.com/#/user/home?id=3952557063" title="网易云音乐" target="_blank" style="color:#C20C0C"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-netease-cloud-music-line"></use></svg></a><a class="links-of-author-item hty-icon-button" rel="noopener" href="https://www.zhihu.com/people/biao-qing-14" title="知乎" target="_blank" style="color:#0084FF"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-zhihu-line"></use></svg></a><a class="links-of-author-item hty-icon-button" rel="noopener" href="https://space.bilibili.com/434470394" title="哔哩哔哩" target="_blank" style="color:#FF8EB3"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-bilibili-line"></use></svg></a><a class="links-of-author-item hty-icon-button" rel="noopener" href="https://img.wenhairu.com/images/2021/12/01/1vvHK.png" title="微信公众号" target="_blank" style="color:#1AAD19"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-wechat-2-line"></use></svg></a><a class="links-of-author-item hty-icon-button" rel="noopener" href="mailto:[email protected]" title="E-Mail" target="_blank" style="color:#8E71C1"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-mail-line"></use></svg></a><a class="links-of-author-item hty-icon-button" rel="noopener" href="https://travellings.link" title="Travelling" target="_blank" style="color:var(--hty-text-color)"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-train-line"></use></svg></a></div><hr style="margin:0.5rem 1rem"><div class="links"><a class="links-item hty-icon-button" href="/links/" title="我的小伙伴们" style="color:dodgerblue"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-genderless-line"></use></svg></a><a class="links-item hty-icon-button" href="/albums/" title="相册" style="color:rgb(255 0 102)"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-gallery-line"></use></svg></a></div><br><a class="links-item hty-icon-button" id="toggle-mode-btn" href="javascript:;" title="Mode" style="color: #f1cb64"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-contrast-2-line"></use></svg></a></div></aside><main class="sidebar-translate" id="content"><div id="banner"><div class="banner-line vertical-line-top"></div><div class="banner-char-container"></div><div class="banner-line vertical-line-bottom"></div><div class="cloud"><svg class="waves" viewBox="0 24 150 28" preserveAspectRatio="none" shape-rendering="auto"><defs><path id="gentle-wave" d="M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z" fill="white"></path></defs><g class="parallax"><use xlink:href="#gentle-wave" x="48" y="0" opacity="0.7"></use><use xlink:href="#gentle-wave" x="48" y="3" opacity="0.5"></use><use xlink:href="#gentle-wave" x="48" y="5" opacity="0.3"></use><use xlink:href="#gentle-wave" x="48" y="7"></use></g></svg></div><a id="goDown" aria-label="go-down" href="javascript:window.scrollTo(0, banner.clientHeight);"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-arrow-down-s-line"></use></svg></a></div><script src="/js/ui/banner.js"></script><div id="say"><span id="say-content"></span><small id="say-author"></small><small id="say-from"></small></div><script src="/js/say.js"></script><script>document.addEventListener("DOMContentLoaded", fetchApiToSay);
document.addEventListener("pjax:success", () => {
Yun.utils.isHome() ? fetchApiToSay() : null;
});</script><section class="flex flex-col" id="recent-posts"><article class="post-card w-full" itemscope itemtype="https://schema.org/Article"><link itemprop="mainEntityOfPage" href="https://wangyou.ink/2022/07/16/session/"><span hidden itemprop="author" itemscope itemtype="https://schema.org/Person"><meta itemprop="name" content="忘忧"><meta itemprop="description"></span><span hidden itemprop="publisher" itemscope itemtype="https://schema.org/Organization"><meta itemprop="name" content="忘忧的小站"></span><div class="post-card-header"><header class="post-header"><h2 class="post-title" itemprop="name headline"><a class="post-title-link" itemprop="url" href="/2022/07/16/session/">Session</a></h2><div class="post-meta"><div class="post-time" style="display:block"><span class="post-meta-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-calendar-line"></use></svg></span> <time title="创建时间:2022-07-16 16:30:00" itemprop="dateCreated datePublished" datetime="2022-07-16T16:30:00+08:00">2022-07-16</time></div><span class="post-count"><span class="post-symbolcount"><span class="post-meta-item-icon" title="本文字数"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-file-word-line"></use></svg></span> <span title="本文字数">635</span><span class="post-meta-divider">-</span><span class="post-meta-item-icon" title="阅读时长"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-timer-line"></use></svg></span> <span title="阅读时长">2m</span></span></span></div></header></div><div class="post-card-content text-center"><div class="post-card-excerpt markdown-body"><p><span style="color:red">session默认有效期是30分钟</span></p></div></div><div class="hty-card__actions post-card__actions"><div class="post-card-category"> <span class="post-meta-item-icon" style="margin-right:3px;"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-folder-line"></use></svg></span><span itemprop="about" itemscope itemtype="https://schema.org/Thing"><a class="category-item" href="/categories/%E5%90%8E%E7%AB%AF/" style="--text-color:var(--hty-text-color)" itemprop="url" rel="index"><span itemprop="text">后端</span></a></span></div><div class="post-card-tag"><a class="tag-item" href="/tags/Session/" style="--text-color:var(--hty-text-color)"><span class="post-meta-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-price-tag-3-line"></use></svg></span><span class="tag-name">Session</span></a></div></div></article><article class="post-card w-full" itemscope itemtype="https://schema.org/Article"><link itemprop="mainEntityOfPage" href="https://wangyou.ink/2022/01/22/Oracle/"><span hidden itemprop="author" itemscope itemtype="https://schema.org/Person"><meta itemprop="name" content="忘忧"><meta itemprop="description"></span><span hidden itemprop="publisher" itemscope itemtype="https://schema.org/Organization"><meta itemprop="name" content="忘忧的小站"></span><div class="post-card-header"><header class="post-header"><h2 class="post-title" itemprop="name headline"><a class="post-title-link" itemprop="url" href="/2022/01/22/Oracle/">Oracle的一些语法</a></h2><div class="post-meta"><div class="post-time" style="display:block"><span class="post-meta-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-calendar-line"></use></svg></span> <time title="创建时间:2022-01-22 16:00:00" itemprop="dateCreated datePublished" datetime="2022-01-22T16:00:00+08:00">2022-01-22</time></div><span class="post-count"><span class="post-symbolcount"><span class="post-meta-item-icon" title="本文字数"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-file-word-line"></use></svg></span> <span title="本文字数">544</span><span class="post-meta-divider">-</span><span class="post-meta-item-icon" title="阅读时长"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-timer-line"></use></svg></span> <span title="阅读时长">2m</span></span></span></div></header></div><div class="post-card-content text-center"><div class="post-card-excerpt markdown-body"><h2 id="merge-into语法"><a href="#merge-into语法" class="headerlink" title="merge into语法"></a>merge into语法</h2><blockquote>
<p> <strong>作用:判断B表和A表是否满足ON中条件,如果满足则用B表去更新A表,如果不满足,则将B表数据插入A表</strong></p>
</blockquote>
<pre class="language-sql" data-language="sql"><code class="language-sql"><span class="token keyword">MERGE</span> <span class="token keyword">INTO</span> <span class="token punctuation">[</span>target<span class="token operator">-</span><span class="token keyword">table</span><span class="token punctuation">]</span> A <span class="token keyword">USING</span> <span class="token punctuation">[</span>source<span class="token operator">-</span><span class="token keyword">table</span> <span class="token keyword">sql</span><span class="token punctuation">]</span> B <span class="token keyword">ON</span><span class="token punctuation">(</span><span class="token punctuation">[</span>conditional expression<span class="token punctuation">]</span> <span class="token operator">and</span> <span class="token punctuation">[</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">)</span>
<span class="token keyword">WHEN</span> <span class="token keyword">MATCHED</span> <span class="token keyword">THEN</span>
<span class="token punctuation">[</span><span class="token keyword">UPDATE</span> <span class="token keyword">sql</span><span class="token punctuation">]</span>
<span class="token keyword">WHEN</span> <span class="token operator">NOT</span> <span class="token keyword">MATCHED</span> <span class="token keyword">THEN</span>
<span class="token punctuation">[</span><span class="token keyword">INSERT</span> <span class="token keyword">sql</span><span class="token punctuation">]</span></code></pre>
<p>例:</p>
<pre class="language-sql" data-language="sql"><code class="language-sql"><span class="token keyword">merge</span> <span class="token keyword">into</span> TABLEA a <span class="token keyword">using</span> <span class="token punctuation">(</span><span class="token keyword">select</span> <span class="token string">'{0}'</span> <span class="token keyword">as</span> age<span class="token punctuation">,</span><span class="token string">'{1}'</span> <span class="token keyword">as</span> name<span class="token punctuation">,</span><span class="token string">'{2}'</span> <span class="token keyword">as</span> sex <span class="token keyword">from</span> dual<span class="token punctuation">)</span> b
<span class="token keyword">on</span> <span class="token punctuation">(</span>a<span class="token punctuation">.</span>age<span class="token operator">=</span>b<span class="token punctuation">.</span>age<span class="token punctuation">)</span> <span class="token keyword">when</span> <span class="token keyword">matched</span> <span class="token keyword">then</span>
<span class="token keyword">update</span> <span class="token keyword">set</span> a<span class="token punctuation">.</span>name<span class="token operator">=</span>b<span class="token punctuation">.</span>name<span class="token punctuation">,</span>a<span class="token punctuation">.</span>sex<span class="token operator">=</span>b<span class="token punctuation">.</span>sex
<span class="token keyword">when</span> <span class="token operator">not</span> <span class="token keyword">matched</span> <span class="token keyword">then</span>
<span class="token keyword">insert</span><span class="token punctuation">(</span>age<span class="token punctuation">,</span>name<span class="token punctuation">,</span>sex<span class="token punctuation">)</span> <span class="token keyword">values</span><span class="token punctuation">(</span>b<span class="token punctuation">.</span>age<span class="token punctuation">,</span>b<span class="token punctuation">.</span>name<span class="token punctuation">,</span>b<span class="token punctuation">.</span>sex<span class="token punctuation">)</span></code></pre></div></div><div class="hty-card__actions post-card__actions"><div class="post-card-category"> <span class="post-meta-item-icon" style="margin-right:3px;"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-folder-line"></use></svg></span><span itemprop="about" itemscope itemtype="https://schema.org/Thing"><a class="category-item" href="/categories/Oracle/" style="--text-color:var(--hty-text-color)" itemprop="url" rel="index"><span itemprop="text">Oracle</span></a></span></div><div class="post-card-tag"><a class="tag-item" href="/tags/SQL/" style="--text-color:var(--hty-text-color)"><span class="post-meta-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-price-tag-3-line"></use></svg></span><span class="tag-name">SQL</span></a><a class="tag-item" href="/tags/%E8%A1%A8%E6%9F%A5%E8%AF%A2/" style="--text-color:var(--hty-text-color)"><span class="post-meta-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-price-tag-3-line"></use></svg></span><span class="tag-name">表查询</span></a></div></div></article><article class="post-card w-full" itemscope itemtype="https://schema.org/Article"><link itemprop="mainEntityOfPage" href="https://wangyou.ink/2022/01/22/something/"><span hidden itemprop="author" itemscope itemtype="https://schema.org/Person"><meta itemprop="name" content="忘忧"><meta itemprop="description"></span><span hidden itemprop="publisher" itemscope itemtype="https://schema.org/Organization"><meta itemprop="name" content="忘忧的小站"></span><div class="post-card-header"><header class="post-header"><h2 class="post-title" itemprop="name headline"><a class="post-title-link" itemprop="url" href="/2022/01/22/something/">平时遇到的一些方法</a></h2><div class="post-meta"><div class="post-time" style="display:block"><span class="post-meta-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-calendar-line"></use></svg></span> <time title="创建时间:2022-01-22 14:10:00" itemprop="dateCreated datePublished" datetime="2022-01-22T14:10:00+08:00">2022-01-22</time></div><span class="post-count"><span class="post-symbolcount"><span class="post-meta-item-icon" title="本文字数"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-file-word-line"></use></svg></span> <span title="本文字数">1.7k</span><span class="post-meta-divider">-</span><span class="post-meta-item-icon" title="阅读时长"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-timer-line"></use></svg></span> <span title="阅读时长">8m</span></span></span></div></header></div><div class="post-card-content text-center"><div class="post-card-excerpt markdown-body"><h2 id="radio设置属性checked属性不生效"><a href="#radio设置属性checked属性不生效" class="headerlink" title="radio设置属性checked属性不生效"></a>radio设置属性checked属性不生效</h2><blockquote>
<p>jq中使用attr()函数来设置选择框的checked属性有时会不起作用<span style="color:red;">(设置不生效)</span></p>
<pre class="language-js" data-language="js"><code class="language-js"><span class="token function">$</span><span class="token punctuation">(</span><span class="token string">'#import'</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">attr</span><span class="token punctuation">(</span><span class="token string">'checked'</span><span class="token punctuation">,</span><span class="token string">'checked'</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre>
<p>这时可以用prop()函数来设置就可以了<span style="color:#1BD66C">(正常设置成功)</span></p>
<pre class="language-js" data-language="js"><code class="language-js"><span class="token function">$</span><span class="token punctuation">(</span><span class="token string">'#import'</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">prop</span><span class="token punctuation">(</span><span class="token string">'checked'</span><span class="token punctuation">,</span><span class="token string">'checked'</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre>
</blockquote>
<h3 id="attr-和prop-的区别"><a href="#attr-和prop-的区别" class="headerlink" title="attr()和prop()的区别"></a>attr()和prop()的区别</h3><p>attr()方法主要是用来处理自定义的DOM属性;</p>
<p>prop()方法主要是用来处理本身就带有的固有属性</p>
<p>使用: <strong>具有true和false属性的属性,就使用prop(),比如checked selected disabled等,其他的使用attr()</strong></p></div></div><div class="hty-card__actions post-card__actions"><div class="post-card-category"> <span class="post-meta-item-icon" style="margin-right:3px;"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-folder-line"></use></svg></span><span itemprop="about" itemscope itemtype="https://schema.org/Thing"><a class="category-item" href="/categories/JS/" style="--text-color:var(--hty-text-color)" itemprop="url" rel="index"><span itemprop="text">JS</span></a></span></div><div class="post-card-tag"><a class="tag-item" href="/tags/js/" style="--text-color:var(--hty-text-color)"><span class="post-meta-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-price-tag-3-line"></use></svg></span><span class="tag-name">js</span></a><a class="tag-item" href="/tags/%E5%B0%8F%E7%BB%93/" style="--text-color:var(--hty-text-color)"><span class="post-meta-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-price-tag-3-line"></use></svg></span><span class="tag-name">小结</span></a></div></div></article><article class="post-card w-full" itemscope itemtype="https://schema.org/Article"><link itemprop="mainEntityOfPage" href="https://wangyou.ink/2021/12/16/node/"><span hidden itemprop="author" itemscope itemtype="https://schema.org/Person"><meta itemprop="name" content="忘忧"><meta itemprop="description"></span><span hidden itemprop="publisher" itemscope itemtype="https://schema.org/Organization"><meta itemprop="name" content="忘忧的小站"></span><div class="post-card-header"><header class="post-header"><h2 class="post-title" itemprop="name headline"><a class="post-title-link" itemprop="url" href="/2021/12/16/node/">node.js&MongoDB</a></h2><div class="post-meta"><div class="post-time" style="display:block"><span class="post-meta-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-calendar-line"></use></svg></span> <time title="创建时间:2021-12-16 08:10:00" itemprop="dateCreated datePublished" datetime="2021-12-16T08:10:00+08:00">2021-12-16</time><span class="post-meta-divider">-</span><span class="post-meta-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-calendar-2-line"></use></svg></span> <time title="修改时间:2021-12-20 18:16:22" itemprop="dateModified" datetime="2021-12-20T18:16:22+08:00">2021-12-20</time></div><span class="post-count"><span class="post-symbolcount"><span class="post-meta-item-icon" title="本文字数"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-file-word-line"></use></svg></span> <span title="本文字数">6.4k</span><span class="post-meta-divider">-</span><span class="post-meta-item-icon" title="阅读时长"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-timer-line"></use></svg></span> <span title="阅读时长">25m</span></span></span></div></header></div><div class="post-card-content text-center"><div class="post-card-excerpt markdown-body"><h2 id="NodeJS介绍和安装"><a href="#NodeJS介绍和安装" class="headerlink" title="NodeJS介绍和安装"></a>NodeJS介绍和安装</h2><h3 id="什么是Node-js"><a href="#什么是Node-js" class="headerlink" title="什么是Node.js"></a>什么是Node.js</h3><ul>
<li>Node.js 是一个基于 Chrome V8 引擎的 JavaScript 运行环境(采用Google开发的V8引擎运行js代码)</li>
<li>Node.js 使用了事件驱动、非阻塞式 I/O 的模型,使其轻量又高效</li>
<li><img src="https://img.wenhairu.com/images/2021/12/16/5Whiu.png" alt="image-20201208211110291"></li>
</ul>
<h3 id="Node-js使用场景"><a href="#Node-js使用场景" class="headerlink" title="Node.js使用场景"></a>Node.js使用场景</h3><ul>
<li>高并发</li>
<li>即时通讯</li>
<li>推送消息</li>
</ul>
<h3 id="Node-js的特性"><a href="#Node-js的特性" class="headerlink" title="Node.js的特性"></a>Node.js的特性</h3><ul>
<li>它是一个JavaScript运行环境</li>
<li>依赖于Chrome V8引擎</li>
<li>轻量,适于实时数据交互应用</li>
<li>单线程</li>
<li>非阻塞I/O</li>
<li>事件驱动</li>
</ul></div></div><div class="hty-card__actions post-card__actions"><div class="post-card-category"> <span class="post-meta-item-icon" style="margin-right:3px;"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-folder-line"></use></svg></span><span itemprop="about" itemscope itemtype="https://schema.org/Thing"><a class="category-item" href="/categories/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/" style="--text-color:var(--hty-text-color)" itemprop="url" rel="index"><span itemprop="text">学习笔记</span></a></span></div><div class="post-card-tag"><a class="tag-item" href="/tags/node/" style="--text-color:var(--hty-text-color)"><span class="post-meta-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-price-tag-3-line"></use></svg></span><span class="tag-name">node</span></a></div></div></article><article class="post-card w-full" itemscope itemtype="https://schema.org/Article"><link itemprop="mainEntityOfPage" href="https://wangyou.ink/2021/12/11/JS-time/"><span hidden itemprop="author" itemscope itemtype="https://schema.org/Person"><meta itemprop="name" content="忘忧"><meta itemprop="description"></span><span hidden itemprop="publisher" itemscope itemtype="https://schema.org/Organization"><meta itemprop="name" content="忘忧的小站"></span><div class="post-card-header"><header class="post-header"><h2 class="post-title" itemprop="name headline"><a class="post-title-link" itemprop="url" href="/2021/12/11/JS-time/">关于JS和时间相关的函数</a></h2><div class="post-meta"><div class="post-time" style="display:block"><span class="post-meta-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-calendar-line"></use></svg></span> <time title="创建时间:2021-12-11 10:10:58" itemprop="dateCreated datePublished" datetime="2021-12-11T10:10:58+08:00">2021-12-11</time><span class="post-meta-divider">-</span><span class="post-meta-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-calendar-2-line"></use></svg></span> <time title="修改时间:2022-01-22 15:28:33" itemprop="dateModified" datetime="2022-01-22T15:28:33+08:00">2022-01-22</time></div><span class="post-count"><span class="post-symbolcount"><span class="post-meta-item-icon" title="本文字数"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-file-word-line"></use></svg></span> <span title="本文字数">1.4k</span><span class="post-meta-divider">-</span><span class="post-meta-item-icon" title="阅读时长"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-timer-line"></use></svg></span> <span title="阅读时长">7m</span></span></span></div></header></div><div class="post-card-content text-center"><div class="post-card-excerpt markdown-body"><h2 id="获取当前时间"><a href="#获取当前时间" class="headerlink" title="获取当前时间"></a>获取当前时间</h2><blockquote>
<p>得到当前时间的 YYYY-MM-DD HH:MI:ss 格式</p>
</blockquote>
<pre class="language-js" data-language="js"><code class="language-js"><span class="token keyword">function</span> <span class="token function">nowtime</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
<span class="token keyword">var</span> _this <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">Date</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">var</span> yy <span class="token operator">=</span> _this<span class="token punctuation">.</span><span class="token function">getFullYear</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">var</span> mm <span class="token operator">=</span> _this<span class="token punctuation">.</span><span class="token function">getMonth</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">+</span><span class="token number">1</span><span class="token operator"><</span><span class="token number">10</span><span class="token operator">?</span><span class="token string">'0'</span><span class="token operator">+</span><span class="token punctuation">(</span>_this<span class="token punctuation">.</span><span class="token function">getMonth</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">+</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token operator">:</span><span class="token punctuation">(</span>_this<span class="token punctuation">.</span><span class="token function">getMonth</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">+</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">var</span> dd <span class="token operator">=</span> _this<span class="token punctuation">.</span><span class="token function">getDate</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator"><</span><span class="token number">10</span><span class="token operator">?</span><span class="token string">'0'</span><span class="token operator">+</span>_this<span class="token punctuation">.</span><span class="token function">getDate</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">:</span> _this<span class="token punctuation">.</span><span class="token function">getDate</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">var</span> hh <span class="token operator">=</span> _this<span class="token punctuation">.</span><span class="token function">getHours</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator"><</span> <span class="token number">10</span> <span class="token operator">?</span> <span class="token string">'0'</span> <span class="token operator">+</span> _this<span class="token punctuation">.</span><span class="token function">getHours</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">:</span> _this<span class="token punctuation">.</span><span class="token function">getHours</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">var</span> mf <span class="token operator">=</span> _this<span class="token punctuation">.</span><span class="token function">getMinutes</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator"><</span> <span class="token number">10</span> <span class="token operator">?</span> <span class="token string">'0'</span> <span class="token operator">+</span> _this<span class="token punctuation">.</span><span class="token function">getMinutes</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">:</span> _this<span class="token punctuation">.</span><span class="token function">getMinutes</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">var</span> ss <span class="token operator">=</span> _this<span class="token punctuation">.</span><span class="token function">getSeconds</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator"><</span> <span class="token number">10</span> <span class="token operator">?</span> <span class="token string">'0'</span> <span class="token operator">+</span> _this<span class="token punctuation">.</span><span class="token function">getSeconds</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">:</span> _this<span class="token punctuation">.</span><span class="token function">getSeconds</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">var</span> nowtime <span class="token operator">=</span> yy <span class="token operator">+</span> <span class="token string">'-'</span> <span class="token operator">+</span> mm <span class="token operator">+</span> <span class="token string">'-'</span> <span class="token operator">+</span> dd <span class="token operator">+</span> <span class="token string">' '</span> <span class="token operator">+</span> hh <span class="token operator">+</span> <span class="token string">':'</span> <span class="token operator">+</span> mf <span class="token operator">+</span> <span class="token string">':'</span> <span class="token operator">+</span> ss<span class="token punctuation">;</span>
<span class="token keyword">return</span> nowtime<span class="token punctuation">;</span>
<span class="token punctuation">}</span></code></pre></div></div><div class="hty-card__actions post-card__actions"><div class="post-card-category"> <span class="post-meta-item-icon" style="margin-right:3px;"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-folder-line"></use></svg></span><span itemprop="about" itemscope itemtype="https://schema.org/Thing"><a class="category-item" href="/categories/JS/" style="--text-color:var(--hty-text-color)" itemprop="url" rel="index"><span itemprop="text">JS</span></a></span></div><div class="post-card-tag"><a class="tag-item" href="/tags/%E5%87%BD%E6%95%B8/" style="--text-color:var(--hty-text-color)"><span class="post-meta-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-price-tag-3-line"></use></svg></span><span class="tag-name">函數</span></a></div></div></article><article class="post-card w-full" itemscope itemtype="https://schema.org/Article"><link itemprop="mainEntityOfPage" href="https://wangyou.ink/2021/12/07/usemd/"><span hidden itemprop="author" itemscope itemtype="https://schema.org/Person"><meta itemprop="name" content="忘忧"><meta itemprop="description"></span><span hidden itemprop="publisher" itemscope itemtype="https://schema.org/Organization"><meta itemprop="name" content="忘忧的小站"></span><div class="post-card-header"><header class="post-header"><h2 class="post-title" itemprop="name headline"><a class="post-title-link" itemprop="url" href="/2021/12/07/usemd/">Markdown语法</a></h2><div class="post-meta"><div class="post-time" style="display:block"><span class="post-meta-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-calendar-line"></use></svg></span> <time title="创建时间:2021-12-07 18:10:58" itemprop="dateCreated datePublished" datetime="2021-12-07T18:10:58+08:00">2021-12-07</time><span class="post-meta-divider">-</span><span class="post-meta-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-calendar-2-line"></use></svg></span> <time title="修改时间:2021-12-30 19:40:28" itemprop="dateModified" datetime="2021-12-30T19:40:28+08:00">2021-12-30</time></div><span class="post-count"><span class="post-symbolcount"><span class="post-meta-item-icon" title="本文字数"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-file-word-line"></use></svg></span> <span title="本文字数">1k</span><span class="post-meta-divider">-</span><span class="post-meta-item-icon" title="阅读时长"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-timer-line"></use></svg></span> <span title="阅读时长">4m</span></span></span></div></header></div><div class="post-card-content text-center"><div class="post-card-excerpt markdown-body"><div class="info">
<blockquote>
<p>Markdown是一种轻量级标记语言,允许使用易读易写的纯文本格式编写文档,然后转换成有效的XHTML(或者HTML)文档</p>
</blockquote>
</div>
<pre><code>因为Markdown轻量高效,语法简单,因此写博客用此就很方便,下面介绍一些markdown的常用语法。
</code></pre></div></div><div class="hty-card__actions post-card__actions"><div class="post-card-category"> <span class="post-meta-item-icon" style="margin-right:3px;"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-folder-line"></use></svg></span><span itemprop="about" itemscope itemtype="https://schema.org/Thing"><a class="category-item" href="/categories/%E6%95%99%E7%A8%8B/" style="--text-color:var(--hty-text-color)" itemprop="url" rel="index"><span itemprop="text">教程</span></a></span></div><div class="post-card-tag"><a class="tag-item" href="/tags/markdown/" style="--text-color:var(--hty-text-color)"><span class="post-meta-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-price-tag-3-line"></use></svg></span><span class="tag-name">markdown</span></a></div></div></article><article class="post-card w-full" itemscope itemtype="https://schema.org/Article"><link itemprop="mainEntityOfPage" href="https://wangyou.ink/2021/12/04/grep/"><span hidden itemprop="author" itemscope itemtype="https://schema.org/Person"><meta itemprop="name" content="忘忧"><meta itemprop="description"></span><span hidden itemprop="publisher" itemscope itemtype="https://schema.org/Organization"><meta itemprop="name" content="忘忧的小站"></span><div class="post-card-header"><header class="post-header"><h2 class="post-title" itemprop="name headline"><a class="post-title-link" itemprop="url" href="/2021/12/04/grep/">正则</a></h2><div class="post-meta"><div class="post-time" style="display:block"><span class="post-meta-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-calendar-line"></use></svg></span> <time title="创建时间:2021-12-04 10:10:58" itemprop="dateCreated datePublished" datetime="2021-12-04T10:10:58+08:00">2021-12-04</time><span class="post-meta-divider">-</span><span class="post-meta-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-calendar-2-line"></use></svg></span> <time title="修改时间:2022-01-22 16:31:39" itemprop="dateModified" datetime="2022-01-22T16:31:39+08:00">2022-01-22</time></div><span class="post-count"><span class="post-symbolcount"><span class="post-meta-item-icon" title="本文字数"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-file-word-line"></use></svg></span> <span title="本文字数">852</span><span class="post-meta-divider">-</span><span class="post-meta-item-icon" title="阅读时长"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-timer-line"></use></svg></span> <span title="阅读时长">3m</span></span></span></div></header></div><div class="post-card-content text-center"><div class="post-card-excerpt markdown-body"><img src="https://img.wenhairu.com/images/2021/12/01/1xlgS.jpg" width="100%">
<p>正则表达式是一个描述字符模式的对象。也就是把规则说给计算机听。javascript中的RegExp类表示正则表达式。</p>
<p>可以使用RegExp()构造函数来创建RegExp对象,也可以通过直接量与法来创建。</p></div></div><div class="hty-card__actions post-card__actions"><div class="post-card-category"> <span class="post-meta-item-icon" style="margin-right:3px;"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-folder-line"></use></svg></span><span itemprop="about" itemscope itemtype="https://schema.org/Thing"><a class="category-item" href="/categories/JS/" style="--text-color:var(--hty-text-color)" itemprop="url" rel="index"><span itemprop="text">JS</span></a></span></div><div class="post-card-tag"><a class="tag-item" href="/tags/%E6%AD%A3%E5%88%99/" style="--text-color:var(--hty-text-color)"><span class="post-meta-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-price-tag-3-line"></use></svg></span><span class="tag-name">正则</span></a><a class="tag-item" href="/tags/js/" style="--text-color:var(--hty-text-color)"><span class="post-meta-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-price-tag-3-line"></use></svg></span><span class="tag-name">js</span></a></div></div></article><article class="post-card w-full" itemscope itemtype="https://schema.org/Article"><link itemprop="mainEntityOfPage" href="https://wangyou.ink/2021/11/30/ES6/"><span hidden itemprop="author" itemscope itemtype="https://schema.org/Person"><meta itemprop="name" content="忘忧"><meta itemprop="description"></span><span hidden itemprop="publisher" itemscope itemtype="https://schema.org/Organization"><meta itemprop="name" content="忘忧的小站"></span><div class="post-card-header"><header class="post-header"><h2 class="post-title" itemprop="name headline"><a class="post-title-link" itemprop="url" href="/2021/11/30/ES6/">ES6</a></h2><div class="post-meta"><div class="post-time" style="display:block"><span class="post-meta-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-calendar-line"></use></svg></span> <time title="创建时间:2021-11-30 18:10:58" itemprop="dateCreated datePublished" datetime="2021-11-30T18:10:58+08:00">2021-11-30</time><span class="post-meta-divider">-</span><span class="post-meta-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-calendar-2-line"></use></svg></span> <time title="修改时间:2021-12-18 17:39:49" itemprop="dateModified" datetime="2021-12-18T17:39:49+08:00">2021-12-18</time></div><span class="post-count"><span class="post-symbolcount"><span class="post-meta-item-icon" title="本文字数"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-file-word-line"></use></svg></span> <span title="本文字数">18.9k</span><span class="post-meta-divider">-</span><span class="post-meta-item-icon" title="阅读时长"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-timer-line"></use></svg></span> <span title="阅读时长">76m</span></span></span></div></header></div><div class="post-card-content text-center"><div class="post-card-excerpt markdown-body"><h1 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h1><p>ECMAScript 6.0(以下简称 ES6)是 JavaScript 语言的下一代标准,已经在 2015 (ES2015)年 6 月正式发布了。它的目标,是使得 JavaScript 语言可以用来编写复杂的大型应用程序,成为企业级开发语言。</p></div></div><div class="hty-card__actions post-card__actions"><div class="post-card-category"> <span class="post-meta-item-icon" style="margin-right:3px;"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-folder-line"></use></svg></span><span itemprop="about" itemscope itemtype="https://schema.org/Thing"><a class="category-item" href="/categories/JS/" style="--text-color:var(--hty-text-color)" itemprop="url" rel="index"><span itemprop="text">JS</span></a></span></div><div class="post-card-tag"><a class="tag-item" href="/tags/es6/" style="--text-color:var(--hty-text-color)"><span class="post-meta-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-price-tag-3-line"></use></svg></span><span class="tag-name">es6</span></a></div></div></article></section></main><footer class="sidebar-translate" id="footer"><div class="beian"><a rel="noopener" href="https://beian.miit.gov.cn/" target="_blank">豫ICP备2021038004号</a></div><div class="copyright"><span>© 2021 – 2022 </span><span class="with-love" id="animate"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-cloud-line"></use></svg></span><span class="author"> 忘忧</span></div><div class="powered"><span>由 <a href="https://hexo.io" target="_blank" rel="noopener">Hexo</a> 驱动 v5.4.0</span><span class="footer-separator">|</span><span>主题 - <a rel="noopener" href="https://github.com/YunYouJun/hexo-theme-yun" target="_blank"><span>Yun</span></a> v1.7.0</span></div></footer><a class="hty-icon-button" id="back-to-top" aria-label="back-to-top" href="#"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-arrow-up-s-line"></use></svg><svg class="progress-circle-container" viewBox="0 0 100 100"><circle class="progress-circle" id="progressCircle" cx="50" cy="50" r="48" fill="none" stroke="#0078E7" stroke-width="2" stroke-linecap="round"></circle></svg></a><a class="popup-trigger hty-icon-button icon-search" id="search" href="javascript:;" title="搜索"><span class="site-state-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-search-line"></use></svg></span></a><script>window.addEventListener("DOMContentLoaded", () => {
// Handle and trigger popup window
document.querySelector(".popup-trigger").addEventListener("click", () => {
document.querySelector(".popup").classList.add("show");
setTimeout(() => {
document.querySelector(".search-input").focus();
}, 100);
});
// Monitor main search box
const onPopupClose = () => {
document.querySelector(".popup").classList.remove("show");
};
document.querySelector(".popup-btn-close").addEventListener("click", () => {
onPopupClose();
});
window.addEventListener("keyup", event => {
if (event.key === "Escape") {
onPopupClose();
}
});
});
</script><script src="/js/search/local-search.js" defer></script><div class="popup search-popup"><div class="search-header"><span class="popup-btn-close close-icon hty-icon-button"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-close-line"></use></svg></span></div><div class="search-input-container"><input class="search-input" id="local-search-input" type="text" placeholder="搜索..." value=""></div><div id="local-search-result"></div></div></div></body></html>