- 博客(16)
- 问答 (1)
- 收藏
- 关注
原创 React路由传递参数
向路由组件传递参数 1.params参数 路由链接(携带参数):<Link to='/demo/test/tom/18'}>详情</Link> 注册路由(声明接收):<Route path="/demo/test/:name/:age" component={Test}/> 接收参数:this.props.match.params...
2021-11-04 16:34:47
139
原创 React遍历问题
React遍历中,不要用index作为key。因为当添加修改数据时,index会产生变化,导致不断产生真实DOM,严重浪费性能。最好用固定的唯一标识作为key,比如数据的ID。
2021-10-31 19:26:15
127
原创 React语法
给一个Person数组添加一个Personpersons:[{id:1,name:'小张',age:18},{id:2,name:'小李',age:19},]person={id:persons.length+1,name:'小王',age:20}this.setState({persons:[person,...persons]})...
2021-10-31 19:08:33
59
原创 JS语句和表达式
1,表达式aa+bdemo(1)arr.map()functiontest(){}如果能用constx=?接收,就是表达式2,语句ifforswitch...
2021-10-20 17:07:28
100
原创 React jsx规则
jsx语法规则:1,定义虚拟dom时,不要写引号2,标签中混入js表达式时要用{}3,样式的类名指定不要用class,要用className4,内联样式要用style={{key:value}}的形式去写5,虚拟dom必须只有一个根标签6,标签必须闭合7,标签首字母(1),若小写字母开头,则将该标签转为html中同名标签,若...
2021-10-20 16:51:27
111
原创 selenium中遇到Message: element click intercepted
由web.find_element_by_xpath('//[@id="s_position_list"]/div[1]/div[1]/a/h3').click()改为button=web.find_element_by_xpath('//[@id="s_position_list"]/div[1]/div[1]/a/h3')web.execute_script("$(arguments[0]).click()",button)
2021-10-10 21:49:28
397
原创 selenium的环境配置
from selenium.webdriver import Chromefrom selenium import webdriverimport selenium#1,创建浏览器对象selenium.webdriver.ChromeOptions.binary_location=r"D:\Chrome\Application\chrome.exe"web=Chrome()web.get("http://www.baidu.com")
2021-10-10 20:56:20
933
原创 爬虫的Crypto加密出现 TypeError: Object type class ‘str‘ cannot be passed to C code
要注意编码问题iv="0000000000000000".encode("utf-8")aes=AES.new(key=key.encode("utf-8"),IV=iv,mode=AES.MODE_CBC)key和iv都要进行编码
2021-10-10 16:36:54
609
原创 python爬虫遇到ConnectionResetError: [WinError 10054] 远程主机强迫关闭了一个现有的连接。
这种情况可以用回调函数来多次访问,直到访问成功为止。def spider(): try: 爬取 except: spider()spider()
2021-10-07 22:08:11
910
原创 Github授权登录流程
1,首先授权账号的 OAuth 服务。2,Get https://github.com/login/oauth/authorize 携带的必须参数的是client_id , redirect_uri(和设置OAuth时的地址相同) 然后Github会返回一个code,并重定向到我们的redirect_uri。3,Posthttps://github.com/login/oauth/access_token 携带的必须参数...
2021-09-05 22:17:44
1427
原创 关于RedirectAttributes
SpringMvc的RedirectAttributes重定向携带数据,利用的是session原理,将数据放在session中 ,只要跳到下一个页面后session里面的数据就会被删掉。分布式下会有问题。
2021-09-04 22:07:53
124
原创 Nginx的代理问题
niginx代理给网关的时候会丢失请求头的host信息。需要自己手动设置。proxy_set_header Host $host
2021-08-05 22:43:12
89
空空如也
idea文件目录问题,怎么把方法单列一个文件关闭
2021-10-15
TA创建的收藏夹 TA关注的收藏夹
TA关注的人