iOS创建开发者证书,不需要再通过CertificateSigningRequest.certSigningRequest申请。应该直接用Xcode,window-organizer-选一个archive-distribute App-Development-next-Distribution certificate下拉框中选择manage Certificates-点加号即可新增一个证书。
月度归档: 2023 年 3 月
如何修复“Issues with peer dependencies found ”
运行以下命令
pnpm config set auto-install-peers true
在当前项目目录下会生成一个.npmrc 文件,并生成以下设置
auto-install-peers = true
auto-install-peers 设置为 true ,在运行pnpm后,缺失的peer dependenices 会自动安装。
当然,也可以删除node_modules,再重新安装
rm -rf node_modules
pnpm install
参考文档:
https://pnpm.io/next/npmrc#peer-dependency-settings
magicApi-分页代码示例
var page = body.page // 默认值要在底部工具栏里加
var size = body.size
var shops = db.table('shop')
if (body.status && body.status > 0){
shops = shops.where().eq('status',body.status)
}
return shops.orderBy('id').page(size, (page - 1) * size)
pinia基本使用
export const useUserStore = defineStore('user', () => {
const user = ref({
name: '张三',
age: 18,
})
const getUser = computed(() => user.value)
const setUser = (value) => {
user.value = value
}
return { user, getUser, setUser }
})
python3下载图片并插入到Excel中
import requests
from PIL import Image
from io import BytesIO
from openpyxl import Workbook
from openpyxl.drawing.image import Image as xlImage
# 下载图片
url = "https://dalongji.oss-cn-guangzhou.aliyuncs.com/021b9862-0374-4309-a3be-c7eb394f8449.jpg"
response = requests.get(url)
img = Image.open(BytesIO(response.content))
# 创建 Excel 文件
workbook = Workbook()
worksheet = workbook.active
# 将图像文件插入到 Excel 文件中
xl_img = xlImage(img)
worksheet.add_image(xl_img, 'A1')
# 保存 Excel 文件
workbook.save('2.xlsx')
import requests
from openpyxl import Workbook
from openpyxl.drawing.image import Image
# 下载图片并保存到本地
url = 'https://dalongji.oss-cn-guangzhou.aliyuncs.com/021b9862-0374-4309-a3be-c7eb394f8449.jpg'
response = requests.get(url)
with open('image.jpg', 'wb') as f:
f.write(response.content)
# 创建Excel文件并写入图片
book = Workbook()
sheet = book.active
sheet['A1'] = 'Image'
img = Image('image.jpg')
sheet.add_image(img, 'B2')
book.save('example.xlsx')
.vscode/setting.json项目设置
{
"explorer.confirmDelete": false, //删除文件的时候直接删
"editor.formatOnSave": true, //保存文件的时候格式化代码
"editor.formatOnPaste": true, //粘贴代码的时候自动格式化
"git.autofetch": true, //自动拉取
"turboConsoleLog.logMessagePrefix": "⭕️", //日志前缀
"turboConsoleLog.includeFileNameAndLineNum": false, //是否包含文件名和行号
"turboConsoleLog.quote": "'", //单引号
"editor.defaultFormatter": "dbaeumer.vscode-eslint", //默认的格式化工具
"[vue]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint" //vue默认格式化工具
},
"[javascript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint" //js默认格式化工具
},
"[jsonc]": {
"editor.defaultFormatter": "vscode.json-language-features" //json默认格式化工具
},
"eslint.format.enable": true, //启用eslint格式化功能
"[markdown]": {
"editor.defaultFormatter": "esbenp.prettier-vscode" //markdown默认格式化工具
}
}
user/setting.json基础设置
{
"workbench.colorTheme": "Default Light+", //白色主题
"editor.minimap.enabled": false, //隐藏小地图
"git.decorations.enabled": false, //git不启用装饰
"[python]": {
"editor.formatOnType": true
},
"editor.inlineSuggest.enabled": true, //启用内联建议
"http.proxySupport": "off",//禁用代理
"git.openRepositoryInParentFolders": "always"
}