自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(28)
  • 收藏
  • 关注

原创 python pre-commit实现代码提交前进行格式化

1.安装pip install pre-commit2.在项目的根目录下创建 .pre-commit-config.yaml文件(根据项目的需要配置),内容如下:repos: #代码格式化- repo: https://github.com/python/black rev: 22.1.0 hooks: - id: black language_version: python3.9- repo: https://github.com/pycqa/iso

2022-03-18 11:34:46 1092

原创 python 项目使用pre-commit+black+isort+自动化(格式化代码)代码规范

第1步:安装pre-commitpip install pre-commit第2步:在项目的根目录下创建.pre-commit-config.yaml文件第3步:编写.pre-commit-config.yaml文件repos: #black库用于格式化代码- repo: https://github.com/python/black rev: 21.12b0 hooks: - id: black language_version: python3.9

2022-02-15 14:19:04 1398

原创 react-router v6替换history.goBack()和goForward()

import React from 'react'import { Link,Routes,Route ,useNavigate} from 'react-router-dom'import Detail from './Detail'export default function Messages() { const messageArr=[ {id:'1',title:'消息1'}, {id:'2',title:'消息2'}, {id:'

2022-01-26 16:39:41 1795

原创 react-router V6 push和replace使用

import React from 'react'import { Link,Routes,Route ,useNavigate} from 'react-router-dom'import Detail from './Detail'#userNavigate只能在函数式组件中使用export default function Messages() { const messageArr=[ {id:'1',title:'消息1'}, {id:'2',tit

2022-01-26 15:40:40 3701

原创 React-Router v6 传递和接收state参数

1.传递参数import React, { Component } from 'react'import { Link,Routes,Route} from 'react-router-dom'import Detail from './Detail'export default class Messages extends Component { state ={messageArr:[ {id:'1',title:'消息1'}, {id:'2',tit

2022-01-26 14:20:15 3171

原创 React router v6版本实现search参数传参

1.传参<Link to={`detail/?id=${messageObj.id}&title=${messageObj.title}`}>{messageObj.title}</Link>2.接收参数import { useSearchParams } from "react-router-dom"export default function Detail(){ const [params] = useSearchParams() const id = p

2022-01-24 17:02:28 1296

原创 echarts实现点击事件弹框

需求:点击echarts绘制的折线图或者散点图上的点实现js弹框cutChart.on('click',(params)=>{ var seriesName = params.seriesName var data = params.data if (seriesName ==="ecg"){ this.$confirm('当前可新增

2022-01-21 16:46:24 2503

原创 React router v6版本实现params传参

import React, { Component } from 'react'import { Link,Routes,Route, useParams } from 'react-router-dom'import Detail from './Detail'export default class Messages extends Component { state ={messageArr:[ {id:'1',title:'消息1'}, {id:'2

2022-01-10 10:36:59 1154

原创 React Router v6使用路由嵌套和重定向

前言:v6版本与v5版本差异较大,以下为V6使用路由嵌套及路由重定向方法,子路由路径不用加"/",v6中会自动拼接App.jsximport React, { Component } from 'react'import { Route,Routes,Navigate} from 'react-router-dom'import About from './pages/About'import Home from './pages/Home'import Header from './compo

2022-01-07 17:01:00 3375 2

原创 React中使用setupProxy.js配置跨域代理

1.http-proxy-middleware(旧版本)const proxy = require('http-proxy-middleware')module.exports = function(app){ app.use( proxy('/api',{//api是需要转发的请求(所有带有/api前缀的请求都会转发给5000) target: 'http://localhost:8000', //配置转发目标地址(能返回数据的服务器地址)

2022-01-06 11:16:06 944

原创 coding使用Jenkinfile持续集成pypi+docker镜像

pipeline { agent any #此处设置为any stages { stage('检出') { steps{ checkout([ $class: 'GitSCM', branches: [[name: env.GIT_BUILD_REF]], userRemoteConfigs: [[ url: env.GIT_REPO_URL, creden

2021-12-23 17:45:51 835

原创 在skwaling-python中实现忽略部分请求的全链路追踪

在启动Python agent的时候config skywalking(在里的skywalking的版本为0.6.0,需根据版本不同进行调整)from skywalking import config#通过环境变量设置忽略的请求路径,指定默认config.trace_ingore_path = os.getenv("SW_TRACE_IGNORE_PATH","/status,/health,/info,/actuator/**")#设置skywalking的日志登记...

2021-12-23 17:28:34 921

原创 echarts brush区域选择框(获取选择框的值)

最近在搞echarts的brush的时候遇到一个这样的问题,大概是这样的:在echart的demo里面做了一个brushEnd的监听事件,为了获取到选框的范围。在这里不用brushSelected的原因是使用echarts的过程中会频繁的触发该事件,虽然可以用brush.throttleType和brush。throttleDelay来解决,但总的来说体验不好。问题描述:1.首先我在echarts的demo里面进行了第一次brush,并console了内容这时候可以看到coordRange里面的

2021-10-28 10:55:36 5216 1

原创 解决js中异步改为同步执行函数顺序的问题

在js中会遇到某些想按顺序执行函数的情况,为了获取到上一个函数执行结果再执行下一个函数,但js中的函数调用是异步执行的。之前有试过对函数设置setTimeout,但未得到解决。解决方案(抛异常):function A () {return this.$http.get(`xxxxxxx`,{ ......}).then((dat)=>{ ......}).catch((error) { ...... throw error})},function B () {retu

2021-10-28 09:37:59 491

原创 Vue实现图片放大镜功能之vue-photo-zoom-pro

解决在前端项目中实现图片中的放大镜功能,可对图片进行局部放大1.安装vue-photo-zoom-pronpm install vue-photo-zoom-pro2.html中<template> <vue-photo-zoom-pro> <img class='image' :src='imageUrl' alt='暂无数据'/> </vue-photo-zoom-pro></template>3.js中<sc

2021-10-28 09:19:07 1200

原创 vue中button按钮实现对文本的复制

el-button实现对文本的复制1.html部分2.js部分3.效果展示

2021-10-11 09:45:06 322

原创 VsCode之在vue中HTML代码使用自动补全插件

Vue中写HTML代码时快速自动补全1.在vscode商城中安装和下载HTML Snippets2.在设置中找到setting.json。3.在setting.json中插入一下代码4.在html代码中输入标签名,按enter或tab键可自动补全

2021-10-11 09:08:22 4150

原创 yarn install 提示错误

使用yarn install 安装时提示错误,The engine “node” is incompatible with this module。解决办法:运行命令:yarn config set ignore-engines true

2021-09-28 21:48:11 1059

原创 pymysql.err.OperationalError: (1130, “xxx‘ is not allowed to connect to this MySQL server“)

is not allowed to connect to this MySQL server在购买阿里云服务器后安装了mysql,部署django项目后,执行python manage.py migrate创建表结构发现报错解决方案mysql -uroot -p #登录use mysql;select host,user from user; #查看数据库的权限信息发现localhost具有root权限,因此需要更改权限update user set host = '%' where

2021-08-05 18:18:48 5021 1

原创 了解阿里云服务器的简单使用(入门篇)

阿里云服务器的简单使用1.购买云服务器地址:https://www.aliyun.com/acts/hi-group-buying2.控制台管理注:购买之后,先去修改root账户密码,修改之后需重启才生效3.使用Xshell工具远程登录云服务器验证...

2021-08-05 17:47:28 181

原创 python使用sphinx快速生成项目开发文档

sphinx快速生成开发文档1.安装pip install sphinx2.在项目的目录下创建docs目录终端切换到docs目录后,使用命令sphinx-quickstart,如下图所示:3.根据终端提示填写一系列的答案来快速构建。完成后将看到构建成功提示和docs目录下会生成build和source目录以及make.bat和Makefile文件,如下图所示:4.安装sphinx-autobuild(官方文档使用的是sphinx-build进行构建),这里为了方便采用autobuild自动构

2021-07-27 10:44:43 286

原创 python requests模块实现form-data文件上传

python requests 模拟postman发送post请求form-data类型上传文件postman请求方式如下:requests模块对应的请求代码如下:url="" #url路径(根据自己的补充,这里暂未填写)begintime="2021-07-09 11:53:02"endtime="2021-07-09 11:57:00"data = {"begin_time": str_begintime, "end_time": str_endtime}req = json.dumps

2021-07-19 15:15:08 1674 3

原创 DataFrame重置索引

删除DataFrame原有的索引,修改DataFrame的索引为自增idDataframe进行某一些条件过滤后索引会更改,如何重置Dataframe索引呢?执行:drop=True代表删除原有的索引

2021-07-07 09:39:13 980

原创 2020-12-15

Vue 使用插槽报错 ‘scope’ is defined but never used看到很多文章说新版vue中可以将scope属性改成slot-scope,因为scope属性已经被弃用了,还有小伙伴说把vetur里面检测Template给关掉。这两种方法都试过,但是vue编译的时候还是会报错。解决办法:编译成功,也没有报错。...

2020-12-15 18:14:10 28

原创 修改Dataframe里面任意数据的值

df_ind=pd.Dataframe({"record_id":1,2,3})df_ind.loc[0,"record_id"]=3修改后record_id的值变成3,2,30代表df_ind的第0个索引如果df_ind的索引不是从0开始,或者存在重复,那么就会造成数据覆盖,要先重置df_ind的索引:df_ind = df_ind.reset_index(drop=True)...

2020-08-20 10:23:31 2220

原创 windows下创建空文件

创建空文件的另一种写法

2020-08-19 15:33:09 467

原创 解决push to origin/master was rejected错误问题

在git push本地仓库的代码时发生一下错误:大概原因是:初始化项目时,远程仓库我建了README.md文件,而本地仓库与远程仓库尚未进行文件关联,或者是中途修改了远程库上面的README.md文件,本地库没有进行关联。解决方案:git push -u origin master -f强制推送到远程库...

2020-07-30 09:36:50 130

原创 解决gunicorn部署的时候遇到gunicorn中断的问题

gunicorn突然中断之前一个项目用docker+gunicorn部署,使用gunicorn做为服务器来启动,但是老是遇到突然中断,后来发现原来gunicorn有个默认的运行时间是(30s),在这个时间段没有给服务器响应,gunicorn就会挂掉。解决方法:在启动gunicorn的命令加上 -t (时间/s) 来控制服务器允许的响应时间...

2020-07-28 16:25:20 2035

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除