2.1.0 • Published 6 years ago
pro-auth-helper v2.1.0
proAuthHelper
product authorization helper
Requirements
On Windows, you'll need to install some dependencies first:
- node-gyp (npm install -g node-gyp)
- python 2.7 and a compatible version Visual Studio installed first. Even with that, node-gyp installation or use can have issues on Windows. The node-gyp README file has detailed instructions if you have difficulties. This post is also a good reference.
Installing
npm install pro-auth-helper --save
Requires nodejs >= 0.10.x
Example
var ProAuthHelper = require('pro-auth-helper');
var helper = new ProAuthHelper();
检验license文件有效性
filepath —
{string}
— the xx.lic file pathhelper.checkLicenseInfo(filepath, function(err, result){ console.log(result); });
result: {code: 'time',msg: 'Authorization expired'} or {code: 'machine',msg: 'The current machine is not authorized'} or {code: 'ok'}
生成.dat文件
- filepath —
{string}
— xx.dat file path- data —
{object}
— the file content- result —
{bool}
— The results of the generated file.
helper.createDatFile(filepath, {produceId:xxx,username:xxxx,...}, function(err, result){
if(err) {
console.log(err);
}else{
console.log(result);
}
});
result: { msg: 'the file Have been generated' }