Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复大概22MB左右文件上传报错 #345

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/workflows/pack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Package and Release

on:
push:
tags:
- 'v*.*.*'

jobs:
build:
strategy:
matrix:
os:
- ubuntu-latest
node-version:
- 16

runs-on: ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '16'

- name: Install dependencies
run: npm install

- name: Run pack script
run: |
tarball=$(npm pack)
echo "TARBALL_NAME=$tarball" >> $GITHUB_ENV

- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.TARBALL_NAME }}
asset_name: ${{ env.TARBALL_NAME }}
tag: ${{ github.ref }}
overwrite: true
body: ${{ github.ref }}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wechat4u",
"version": "0.7.14",
"version": "0.7.16",
"description": "web wechat lib for user",
"main": "lib/wechat.js",
"scripts": {
Expand Down
27 changes: 19 additions & 8 deletions run-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ bot.on('logout', () => {
* 联系人更新事件,参数为被更新的联系人列表
*/
bot.on('contacts-updated', contacts => {
console.log(contacts)
// console.log(contacts)
console.log('联系人数量:', Object.keys(bot.contacts).length)
})
/**
Expand Down Expand Up @@ -143,16 +143,27 @@ bot.on('login', () => {
bot.emit('error', err)
})

/**
* 发送大文件 测试
*/
// bot.sendMsg({
// file: fs.createReadStream('./media/21mb.zip'),
// filename: '21mb.zip'
// }, ToUserName)
// .catch(err => {
// bot.emit('error', err)
// })

/**
* 发送文件
*/
bot.sendMsg({
file: fs.createReadStream('./media/test.txt'),
filename: 'test.txt'
}, ToUserName)
.catch(err => {
bot.emit('error', err)
})
// bot.sendMsg({
// file: fs.createReadStream('./media/2mb.mp4'),
// filename: '2mb.mp4'
// }, ToUserName)
// .catch(err => {
// bot.emit('error', err)
// })

/**
* 发送撤回消息请求
Expand Down
Loading