Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

one-sport

Package Overview
Dependencies
Maintainers
1
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

one-sport - npm Package Compare versions

Comparing version 1.1.10 to 1.1.11

28

lib/index.js
import axios from 'axios';
import md5 from 'js-md5';
import CryptoJS from 'crypto-js'
const { base64decode } = require('nodejs-base64')
var CancelToken = axios.CancelToken;

@@ -43,2 +46,20 @@ var source = CancelToken.source();

}
/**
* @function 对登录的时候密码进行解密
* @param {String} word 要被解密的文本
* @param {String} keyStr 密钥
* @param {String} ivStr 偏移量
* @returns {String} 返回解密后的文本
*/
let decrypt = function(word, keyStr, ivStr) {
const key = CryptoJS.enc.Utf8.parse(keyStr)
const iv = CryptoJS.enc.Utf8.parse(ivStr)
const decrypt = CryptoJS.AES.decrypt(word, key, {
iv,
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7,
})
const decryptedStr = CryptoJS.enc.Utf8.stringify(decrypt).toString()
return decryptedStr
}
export default function({store, isloaded = false, whiteList = []}) {

@@ -154,2 +175,3 @@ /**

config.headers['X-Timestamp'] = timestamp
config.headers['Accept-Language'] = store.state.Language === 0 ? 'zh-CN' : 'en-US'
if (store.state.TOKEN) {

@@ -167,2 +189,8 @@ config.headers['X-XSRF-TOKEN'] = store.state.TOKEN

})
// 判断是否需要解密
if (result.data.isEncrypt) {
let data = base64decode(base64decode(result.data.data).split('').reverse().join(''))
data = decrypt(data, 'One@-!Sports456G', 'One@-!SportsG654')
result.data.data = JSON.parse(data)
}
// console.log(result)

@@ -169,0 +197,0 @@ /* result 为服务器响应回来的数据 */

2

package.json
{
"name": "one-sport",
"version": "1.1.10",
"version": "1.1.11",
"description": "use for one-sport company",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc