|
@@ -4,6 +4,7 @@ import CryptoJS from 'crypto-js'
|
|
export class SmCrypto {
|
|
export class SmCrypto {
|
|
private readonly privateKey: string
|
|
private readonly privateKey: string
|
|
private readonly publicKey: string
|
|
private readonly publicKey: string
|
|
|
|
+
|
|
constructor(privateKey: string, publicKey: string) {
|
|
constructor(privateKey: string, publicKey: string) {
|
|
this.privateKey = privateKey
|
|
this.privateKey = privateKey
|
|
this.publicKey = publicKey
|
|
this.publicKey = publicKey
|
|
@@ -42,13 +43,15 @@ export class SmCrypto {
|
|
}
|
|
}
|
|
|
|
|
|
getNowFormatDate() {
|
|
getNowFormatDate() {
|
|
|
|
+ // const date = new Date()
|
|
|
|
+ // const month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
|
|
|
|
+ // const strDate = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
|
|
|
|
+ // const hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours()
|
|
|
|
+ // const minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
|
|
|
|
+ // const seconds = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()
|
|
|
|
+ // return `${date.getFullYear()}${month}${strDate}${hours}${minutes}${seconds}`
|
|
const date = new Date()
|
|
const date = new Date()
|
|
- const month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
|
|
|
|
- const strDate = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
|
|
|
|
- const hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours()
|
|
|
|
- const minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
|
|
|
|
- const seconds = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()
|
|
|
|
- return `${date.getFullYear()}${month}${strDate}${hours}${minutes}${seconds}`
|
|
|
|
|
|
+ return date.getTime() // 获取时间戳(毫秒)
|
|
}
|
|
}
|
|
|
|
|
|
uuid(len, radix) {
|
|
uuid(len, radix) {
|