fix: 微信登录补充保存username和role
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Agent
2026-04-04 07:35:21 +00:00
parent 756444ef2b
commit d12eea7693
10597 changed files with 817047 additions and 3 deletions

151
node_modules/qrcode-reader/test/qrcode.js generated vendored Normal file
View File

@@ -0,0 +1,151 @@
var expect = require('chai').expect;
var fs = require('fs');
var QrCode = require('../dist/index.js');
var ImageParser = require("image-parser");
const Jimp = require("jimp");
const expectedResult = {
"result": 'Test',
"points": [
{
"count": 2,
"estimatedModuleSize": 8,
"x": 36,
"y": 148,
},
{
"count": 2,
"estimatedModuleSize": 8,
"x": 36,
"y": 36,
},
{
"count": 2,
"estimatedModuleSize": 8,
"x": 148,
"y": 36,
}
]
};
function copy(input) {
return JSON.parse(JSON.stringify(input));
}
it("should work with jimp", function(done) {
var buffer = fs.readFileSync(__dirname + '/image.png');
Jimp.read(buffer, function(err, image) {
if (err) {
return done(err);
}
var qr = new QrCode();
qr.callback = function(err, result) {
if (err) {
return done(err);
}
expect(copy(result)).to.deep.equal(expectedResult);
done();
};
qr.decode(image.bitmap);
});
});
it("should work with a zxing qr code with jimp", function(done) {
var buffer = fs.readFileSync(__dirname + '/image-zxing.png');
Jimp.read(buffer, function(err, image) {
if (err) {
return done(err);
}
var qr = new QrCode();
qr.callback = function(err, result) {
if (err) {
return done(err);
}
expect(copy(result)).to.deep.equal({
"result": 'Test',
"points": [
{
"count": 2,
"estimatedModuleSize": 9,
"x": 34.5,
"y": 160.5,
},
{
"count": 3,
"estimatedModuleSize": 9,
"x": 34.5,
"y": 34.5,
},
{
"count": 2,
"estimatedModuleSize": 9.428571428571429,
"x": 160.5,
"y": 34.5,
}
]
});
done();
};
qr.decode(image.bitmap);
});
});
it('should work with basic image', function(done) {
var buffer = fs.readFileSync(__dirname + '/image.png');
var img = new ImageParser(buffer);
img.parse(function(err) {
if (err) {
return done(err);
}
var qr = new QrCode();
qr.callback = function(err, result) {
if (err) {
return done(err);
}
expect(copy(result)).to.deep.equal(expectedResult);
done();
};
qr.decode({width: img.width(), height: img.height()}, img._imgBuffer);
});
});
it('should work with imageData format', function(done) {
var buffer = fs.readFileSync(__dirname + '/image.png');
var img = new ImageParser(buffer);
img.parse(function(err) {
if (err) {
return done(err);
}
var qr = new QrCode();
qr.callback = function(err, result) {
if (err) {
return done(err);
}
expect(copy(result)).to.deep.equal({
"result": 'Test',
"points": [
{
"count": 2,
"estimatedModuleSize": 8,
"x": 36,
"y": 148,
},
{
"count": 2,
"estimatedModuleSize": 8,
"x": 36,
"y": 36,
},
{
"count": 2,
"estimatedModuleSize": 8,
"x": 148,
"y": 36,
}
]
});
done();
};
qr.decode({height: img.height(), width: img.width(), data: img._imgBuffer});
});
});