|
@@ -9,6 +9,8 @@
|
|
|
*/
|
|
|
const crypto = require('crypto');
|
|
|
const moment = require('moment');
|
|
|
+const jwt = require('jsonwebtoken');
|
|
|
+const privateKey = 'zhzhjwtqwerty';
|
|
|
class DSK {
|
|
|
|
|
|
/**
|
|
@@ -24,7 +26,8 @@ class DSK {
|
|
|
}
|
|
|
|
|
|
getToken() {
|
|
|
- return crypto.createHash('md5').update(crypto.createHash('md5').update(this.tokenKey).digest('hex') + moment().format('DD-HH')).digest('hex');
|
|
|
+ // return crypto.createHash('md5').update(crypto.createHash('md5').update(this.tokenKey).digest('hex') + moment().format('DD-HH')).digest('hex');
|
|
|
+ return jwt.sign({ iat: Date.now() }, privateKey);
|
|
|
}
|
|
|
|
|
|
async sendSms(mobile) {
|