Add an 8G memory module to the notebook Author: Chuwen Time: 2021-04-30 Classification: life comment Samsung DDR4 2666MHz 8G memory module from a Baomai, price 279 >Maybe it's expensive. I choose to buy it when the price rises ! [Samsung DDR4 2666MHz 8G memory module, price 279 yuan]( https://cdn.nowtime.cc/2021/04/30/1134560955.png ) Poor 8 gigabytes of memory. If you open Chrome, PHP Storm and Docker, the memory usage will be 92%+ The laptop is Xiaomi game book i5-8300H, which has been bought for nearly three years (what is the experience of buying a game book without playing games?) This book screw is not a regular screw. I had to buy another screwdriver set and spent more than ten yuan to remove it ##A close-up of the memory module ! []( https://cdn.nowtime.cc/2021/04/30/1846415086.png ) ##Disassembly ! []( https://cdn.nowtime.cc/2021/04/30/4136275747.png ) ! []( https://cdn.nowtime.cc/2021/04/30/2797685884.png ) ##After installation, compare with the built-in memory module ! []( https://cdn.nowtime.cc/2021/04/30/3241826213.png ) --- #Screenshot of CPU-Z ! []( https://cdn.nowtime.cc/2021/04/30/2327183755.png ) ###Internal memory module: ! []( https://cdn.nowtime.cc/2021/04/30/2074823145.png ) ###Self purchased memory module: >It was produced in the 50th week of the 20th year, that is, in the second week of December 2020. It's relatively new, isn't it > > ! []( https://cdn.nowtime.cc/2021/04/30/1649786813.png ) ! []( https://cdn.nowtime.cc/2021/04/30/1719172725.png ) #Feeling after installation I feel happier when I start up under Windows. Of course, the memory is just made up The memory in MacOS is enough. Open several PHPStorms, open more than ten or twenty tabs in Chrome, and pull the Docker memory directly to 3GB. There is still more memory left, and the interface operation is not stuck
The reason and solution of Nginx configuration reverse proxy add_header not effective Author: Chuwen Time: 2021-04-30 Classification: Nginx comment ##Background Because my colleague used the interface built by Hyperf, and then used the front end written by Vue.js to call it, there was a cross domain problem ##Invalid reason >Nginx 'add_header' is only effective for '2002204206301302304307' status codes, but not for 401 405 403 status codes. I happened to visit a link casually during the test, and the returned status code was * * 404 * *. The result was that the added 'header' was never refreshed` ##Solution Add an 'always' at the end, that is: ```conf add_header Access-Control-Allow-Origin * always; ``` In addition, if you set the value of the * * Access Control Allow Origin * * header to '*', the browser console will prompt this error when the front end makes a request ! []( https://cdn.nowtime.cc/2021/04/30/1343951322.png ) > Access to XMLHttpRequest at ' http://api.xxxxxxx.com/v1/userinfo from origin ' http://localhost:8080 ' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute. > >* * Machine translation into Chinese:** > >Blocked from source by CORS policy“ http://localhost:8080 ”Access“ http://api.xxxxxxx.com/v1/userinfo ”XMLHttpRequest at: The response to the pre check request failed the access control check: when the credential mode of the request is "Include", the value of the "Access Control Allowed - Source" header in the response must not be a wildcard "*". The credential mode of the request initiated by XMLHttpRequest is controlled by the withCredentials attribute. > >Related links: https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials ###The reason is that when the current end (such as axios) is configured with 'withCredentials=true', the backend configuration 'Access Control Allow Origin' cannot be '*', but must be the corresponding address ###Axios Set withCredentials to false ```js //Axios configuration axios.defaults.withCredentials = false; // Carry cookies ``` --- For more relevant cross issues, this article can be used as a reference: https://juejin.cn/post/6844903748288905224 The following is an extract from the above link slag ###Question 1 >Solution: When the current side configuration withCredentials=true, the backend configuration Access Control Allow Origin cannot be *, and must be the corresponding address ``` Access to XMLHttpRequest at ' http://127.0.0.1:8081/getInfo?t=1545900042823 ' from origin ' http://localhost:8080 ' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute. ``` ###Question 2 >Solution: When withCredentials=true is configured, Access Control Allow Credentials needs to be configured on the backend ``` Access to XMLHttpRequest at ' http://127.0.0.1:8081/getInfo?t=1545899934853 ' from origin ' http://localhost:8080 ' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow-Credentials' header in the response is '' which must be 'true' when the request's credentials mode is 'include'. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute. ``` ###Question 3 >Solution: When configuring the request header at the front end, the backend needs to configure Access Control Allow Headers as the corresponding request header collection ``` Access to XMLHttpRequest at ' http://127.0.0.1:8081/getInfo?t=1545898876243 ' from origin ' http://localhost:8080 ' has been blocked by CORS policy: Request header field x-requested-with is not allowed by Access-Control-Allow-Headers in preflight response. ```
The Git file content has not changed, but the status shows the solution for modification Author: Chuwen Time: 2021-04-24 Classification: Linux comment The reason found on the Internet is that the file permissions have changed, resulting in * * displaying modifications** ##Solution >Do not let git detect the difference of file permissions Execute the following command to solve the problem ```shell git config core.filemode false ```
Record some small problems encountered in the combination of box shadow and border radius Author: Chuwen Time: 2021-04-17 Classification: HTML5 comment ##Current code structure >The expected effect is that the mouse moves to the card, and shadows appear around >Use 'box shadow' instead of 'border', because the use of 'border' will lead to changes in container width ```html <div class="card"> <div class="item"> This is the content </div> <div class="item"> This is the content </div> <div class="item"> This is the content </div> </div> <style> .card .item { height: 40px; width: 40px; padding: 2rem; margin: 1rem; } .card .item:hover { box-shadow: 1px 1px #e1e3e5, -1px -1px #e1e3e5; border-radius: 0.3rem; } </style> ``` Preview effect: >There is a gap at the edge, which obviously can not meet the desired expectations ! []( https://cdn.nowtime.cc/2021/04/17/2254024021.png ) --- ###Finally, read the MDN box shadow document again, try again, and change it to the following code ```html <div class="card"> <div class="item"> This is the content </div> <div class="item"> This is the content </div> <div class="item"> This is the content </div> </div> <style> .card .item { height: 40px; width: 40px; padding: 2rem; margin: 1rem; } .card .item:hover { box-shadow: #e1e3e5 0 0 0 1px; border-radius: 0.3rem; } </style> ``` effect: ! []( https://cdn.nowtime.cc/2021/04/17/1227956365.png )
Resolve Ant is not defined error reported by Ant Design For Vue Author: Chuwen Time: 2021-04-12 Classification: Vue.js , JavaScript comment ##Solution ```js import Vue from 'vue' //Change import Antd from 'ant design vue' to the following import Antd from 'ant-design-vue/es' Vue.use(Antd) ```