会员
周边
众包
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
snakej
博客园
首页
新随笔
联系
订阅
管理
2023年10月7日
npm run dev 提示 { parser: "babylon" } is deprecated; we now treat it as { parser: "babel" }
摘要: 修改 emacs node_modules/vue-loader/lib/template-compiler/index.js 将以下代码中的 babylon 替换 babel if (!isProduction) { code = prettier.format(code, { semi: fal
阅读全文
posted @ 2023-10-07 15:22 snake_j
阅读(44)
评论(0)
推荐(0)
2023年9月27日
npm
摘要: // 查询源 npm config get registry // 更换国内源 npm config set registry https://registry.npmmirror.com // 恢复官方源 npm config set registry https://registry.npmjs
阅读全文
posted @ 2023-09-27 15:07 snake_j
阅读(8)
评论(0)
推荐(0)
2023年9月22日
FastAPI Request中存储信息
摘要: 在请求前拦截,检测token 使用 Request.state.XXX 存信息 from fastapi import Request, FastAPI from py_jwt.use_jwt import decode_token def register_middleware(app: Fast
阅读全文
posted @ 2023-09-22 14:28 snake_j
阅读(135)
评论(0)
推荐(0)
2023年7月12日
python pip 国内源
摘要: #### 使用 ``` pip install xxx -i url ``` ``` 清华大学(完全度和速度都很好,是一个优秀的pip镜像源) https://pypi.tuna.tsinghua.edu.cn/simple 阿里云(完全度和速度也很好,是一个不错的选择) https://mirro
阅读全文
posted @ 2023-07-12 16:19 snake_j
阅读(43)
评论(0)
推荐(0)
vue-json-viewer
摘要: ####npm ``` $ npm install vue-json-viewer@2 --save // Vue2 $ npm install vue-json-viewer@3 --save // Vue3 ``` ####例子 ``` import JsonViewer from 'vue-j
阅读全文
posted @ 2023-07-12 10:10 snake_j
阅读(350)
评论(0)
推荐(0)
2023年7月11日
npm run dev 提示 { parser: “babylon“ } is deprecated; we now treat it as { parser: “babel“ }.
摘要: #### 方法1 修改文件 : ..../node_modules/vue-loader/lib/template-compiler/index.js ``` //原来是这样的 if (!isProduction) { code = prettier.format(code, { semi: fal
阅读全文
posted @ 2023-07-11 11:58 snake_j
阅读(110)
评论(0)
推荐(0)
2023年7月7日
Gin 接受 json 结构 数据
摘要: #### BindJSON() ``` type pdata struct { User string `json:"user"` Act string `json:"act"` } func CdnTask(c *gin.Context) { var body pdata if err := c.
阅读全文
posted @ 2023-07-07 15:05 snake_j
阅读(134)
评论(0)
推荐(0)
2023年7月6日
Celery 使用 Ansible API 结果 返回 None 无返回
摘要: ####方法1 ``` # 在celery task 中 加入 # from multiprocessing import current_process # current_process()._config={"semprefix":"/mp"} @app.task def create_tas
阅读全文
posted @ 2023-07-06 14:15 snake_j
阅读(69)
评论(0)
推荐(0)
2023年7月5日
Django REST framework drf 后端分页 结合 Vue前端
摘要: #### 后端 DRF ```python view.py from rest_framework import pagination class default_pagination(pagination.PageNumberPagination): page_size = 15 # 分页的条数
阅读全文
posted @ 2023-07-05 15:10 snake_j
阅读(47)
评论(0)
推荐(0)
Go Gin 文件上传下载
摘要: ``` //判断文件是否存在 存在返回 true 不存在返回false // func checkFileIsExist(filename string) bool { // var exist = true // if _, err := os.Stat(filename); os.IsNotEx
阅读全文
posted @ 2023-07-05 14:29 snake_j
阅读(201)
评论(0)
推荐(0)
下一页
公告
点击右上角即可分享