会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
㊀觉睡到小时候
博客园
首页
新随笔
联系
订阅
管理
2022年8月25日
ts提取html标签中的图片链接
摘要: async extractImg(html: string){ const arr = html.match(/<img.*?>/g); if (arr) return arr.map(item => item.match(/\s+src=['"](.*?)['"]/)![1]); }
阅读全文
posted @ 2022-08-25 20:30 ㊀觉睡到小时候
阅读(66)
评论(0)
推荐(0)
2022年8月24日
ts数组对象根据某个属性进行分组
摘要: async groupBy (sortData:OrderItem[]) { const arr = (array: OrderItem[], f: Function) => { const groups: { [key:string]: OrderItem[], } = {} array.forE
阅读全文
posted @ 2022-08-24 19:31 ㊀觉睡到小时候
阅读(392)
评论(0)
推荐(0)
2022年8月10日
js正则表达式验证邮箱和手机号
摘要: if (!/^1[3456789]\d{9}$/.test(sellerNewReqDto.mobile)) { throw new HttpErrors.BadRequest('手机号码错误'); } if(!/^\w+@\w+\.\w+$/i.test(sellerNewReqDto.email
阅读全文
posted @ 2022-08-10 15:31 ㊀觉睡到小时候
阅读(50)
评论(0)
推荐(0)
2022年8月9日
vscode node debug
摘要: { "name": "Current TS File", "type": "node", "request": "launch", "args": [ "${workspaceRoot}/src/index.ts" // 入口文件 ], "runtimeArgs": [ "--nolazy", "-
阅读全文
posted @ 2022-08-09 15:19 ㊀觉睡到小时候
阅读(21)
评论(0)
推荐(0)
判断数组对象某个值是否存在
摘要: boxList[boxItem].boxRelations.some(item => { if (item.product.id productId) return true; })
阅读全文
posted @ 2022-08-09 11:54 ㊀觉睡到小时候
阅读(86)
评论(0)
推荐(0)
2022年8月4日
判断内层数组对象中的某个值,根据内层数组的另一个值对外层数组排序
摘要: //判断name == bb,以num对外层data进行排序let bb = 'alala'; var data = [{ name : "jiang", age : 22, father: [{name: 'lalala', aihao: 'bo',num: 60},{name: 'alala',
阅读全文
posted @ 2022-08-04 13:03 ㊀觉睡到小时候
阅读(28)
评论(0)
推荐(0)
2022年6月14日
docker部署node项目
摘要: 部署node docker pull node:latest //拉取node镜像 docker images //查看所有镜像 docker run -itd --name node-test node //运行node容器 进入容器 docker exec -it node-test /bin/
阅读全文
posted @ 2022-06-14 15:20 ㊀觉睡到小时候
阅读(290)
评论(0)
推荐(0)
2022年2月16日
node.js集成authorize.net支付
摘要: 1.申请沙箱登录账号 2.登录后,申请api凭证和密钥 'use strict'; const ApiContracts = require('authorizenet').APIContracts; const ApiControllers = require('authorizenet').AP
阅读全文
posted @ 2022-02-16 20:26 ㊀觉睡到小时候
阅读(135)
评论(0)
推荐(0)
2022年1月19日
mysql从一个数据库向另一个数据库插数据
摘要: var mysqlr = require('mysql'); var readConnection = mysqlr.createConnection({//创建第一个连接 host: '112.74.82.181', user: 'root', password: 'root.', databas
阅读全文
posted @ 2022-01-19 02:55 ㊀觉睡到小时候
阅读(608)
评论(0)
推荐(0)
2022年1月13日
阿里云部署mysql密码修改无效问题
摘要: 1.刷新权限表 flush privileges; 2.初始化无密码,设置密码 ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456'; 3.登陆阿里云,设置安全组3306
阅读全文
posted @ 2022-01-13 01:09 ㊀觉睡到小时候
阅读(88)
评论(0)
推荐(0)
下一页
公告