2 changed files with 30 additions and 0 deletions
@ -0,0 +1,19 @@ |
|||||
|
const access_key = '6374106c5eb449a4ad6c2430f30796e6'; |
||||
|
const access_secret = '434fec85aa5846e88bbeb8fac6cf6d7f'; |
||||
|
// generateRandomNumber()
|
||||
|
const nonce = "887954"; |
||||
|
const timestamp = `${Date.now()}`; |
||||
|
|
||||
|
const str = [access_secret, nonce, timestamp] |
||||
|
.sort() |
||||
|
.reduce((str, item) => str += item, ''); |
||||
|
|
||||
|
// 最终还需要转成全小写
|
||||
|
const signature = sha1(str).toString().toLowerCase(); |
||||
|
var siqObject = { |
||||
|
access_key: access_key, |
||||
|
nonce: nonce, |
||||
|
timestamp: timestamp, |
||||
|
signature: signature, |
||||
|
}; |
||||
|
|
||||
@ -0,0 +1,11 @@ |
|||||
|
const getYear = () =>{ |
||||
|
var date = new Date(); |
||||
|
return date.getFullYear(); |
||||
|
} |
||||
|
const getMouth = () =>{ |
||||
|
var date = new Date(); |
||||
|
var month = date.getMonth(); |
||||
|
return month + 1; |
||||
|
} |
||||
|
|
||||
|
export { getYear, getMouth}; |
||||
Loading…
Reference in new issue