Skip to content
This repository has been archived by the owner on Jul 20, 2023. It is now read-only.

Commit

Permalink
格式
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuweiyou committed Feb 10, 2018
1 parent 9c90b3d commit a28a9e6
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 18 deletions.
2 changes: 1 addition & 1 deletion 包你懂我/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = {
} catch (e) {}
if (requestDetail.url.indexOf('/minapp/answer/question/') !== -1) {
if (data.question) {
//匹配出正确答案
// 匹配出正确答案
data.question.forEach(value => {
const answer = value.answers[value.right]
console.log(value.title + '答案:' + answer)
Expand Down
12 changes: 7 additions & 5 deletions 大家来找茬腾讯版/src/decrypt.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
const fs = require('fs-extra')
const Canvas = require('canvas-prebuilt')
const e = require('./e')
const r = require('./r')
// const r = require('./r')

function decryptFile (id, data) {
for (let key = getKey(id), i = 0; i < data.length; i += key.length)
for (let j = 0; i + j < data.length && j < key.length; ++j)
for (let key = getKey(id), i = 0; i < data.length; i += key.length) {
for (let j = 0; i + j < data.length && j < key.length; ++j) {
data[i + j] ^= key[j]
}
}
return data
}

function getKey (r) {
r += 'QQGameZC'
for (var t = e.hash(r, !0), a = new ArrayBuffer(16), o = new Uint8Array(a), n = 0; n < 16; n++)
for (var t = e.hash(r, !0), a = new ArrayBuffer(16), o = new Uint8Array(a), n = 0; n < 16; n++) {
o[n] = t.charCodeAt(n)
}
return o
}

Expand Down Expand Up @@ -44,4 +47,3 @@ function decrypt (id, data) {
}

module.exports = decrypt

1 change: 0 additions & 1 deletion 好友画我/src/friend.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ const userid = ''
const response = []

response.forEach(({_id}) => request(userid, _id))

2 changes: 1 addition & 1 deletion 悦动音符/src/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const request = require('./request')
const data = res.music.map(({title, music_id}) => ({
title,
music_id,
score: 3588,//推荐分数
score: 3588, // 推荐分数
is_request: true
}))
await fs.writeFile('data/songs.json', JSON.stringify(data, null, 2))
Expand Down
2 changes: 1 addition & 1 deletion 悦动音符/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const fs = require('fs-extra')
return
}
JSON.parse(data.toString())
.filter(({is_request}) => is_request)
.filter(({is_request}) => is_request) // eslint-disable-line camelcase
.forEach(({music_id, score}) => request('https://mp.weixin.qq.com/wxagame/wxagame_settlement', {
stage_id: music_id,
score_info: [{
Expand Down
2 changes: 1 addition & 1 deletion 我最在行/src/common/https.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = class Https {
'user-agent': 'Mozilla/5.0 (Linux; Android 7.0; MIX Build/NRD90M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.132 MQQBrowser/6.2 TBS/043906 Mobile Safari/537.36 MicroMessenger/6.6.2.1240(0x26060236) NetType/WIFI Language/zh_CN MicroMessenger/6.6.2.1240(0x26060236) NetType/WIFI Language/zh_CN',
referer: `https://servicewechat.com/${APPID}/${VERSION}/page-frame.html`,
uid: account_id,
/* eslint-disable camelcase */
// eslint-disable-next-line camelcase
jwt: `Bearer ${access_token}`
}
})
Expand Down
2 changes: 1 addition & 1 deletion 我最在行/src/match/event-round-result.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const QuestionModel = require('../common/question-model')
/* eslint-disable camelcase */
// eslint-disable-next-line camelcase
const event_battle_start = require('./event-battle-start')

module.exports = async (socket, data) => {
Expand Down
2 changes: 1 addition & 1 deletion 我最在行/src/match/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const events = {

module.exports = player => {
async function start () {
/* eslint-disable no-new */
// eslint-disable-next-line no-new
new MatchSocket({
options: await game(player, {match: true}),
events
Expand Down
2 changes: 1 addition & 1 deletion 我最在行/src/match/match-socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = class MatchSocket extends Socket {
const data = super.onMessage(options)
if (data.address) {
console.log('获取到房间地址', data.address)
/* eslint-disable no-new */
// eslint-disable-next-line no-new
new PkSocket({
options: {
...this.options,
Expand Down
2 changes: 1 addition & 1 deletion 我最在行/src/pk/event-round-result.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const QuestionModel = require('../common/question-model')
/* eslint-disable camelcase */
// eslint-disable-next-line camelcase
const event_battle_start = require('./event-battle-start')

module.exports = async (socket, data) => {
Expand Down
3 changes: 2 additions & 1 deletion 星途WeGoing/src/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const axios = require('axios')
module.exports = async ({session_id, newscore, level, baoshi, combo}) => {
const appid = 'wx7a727ff7d940bb3f'

// eslint-disable-next-line camelcase
const game_behav_list = [
{key: 'newscore', value: newscore},
{key: 'level', value: level},
Expand All @@ -12,7 +13,7 @@ module.exports = async ({session_id, newscore, level, baoshi, combo}) => {

const sign = () =>
game_behav_list
.reduce((ret, {key, value}) => ret += `_${key}:${value}`, appid)
.reduce((ret, {key, value}) => ret += `_${key}:${value}`, appid) // eslint-disable-line no-return-assign
.split('')
.reduce((ret, value) => (31 * ret + value.charCodeAt(0)) & 67108863, 0)

Expand Down
1 change: 0 additions & 1 deletion 跳一跳/src/encrypt.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ exports.decrypt = (text, key) => {
const bytes = CryptoJS.AES.decrypt(text, key, {iv})
return CryptoJS.enc.Utf8.stringify(bytes)
}

4 changes: 2 additions & 2 deletions 跳一跳/src/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = async ({session_id, score}) => {
}]
})

const [userInfo, friendsScore, init] = await Promise.all([
await Promise.all([
request.post('/wxagame_getuserinfo'),
request.post('/wxagame_getfriendsscore'),
request.post('/wxagame_init', {version: 9})
Expand All @@ -42,7 +42,7 @@ module.exports = async ({session_id, score}) => {
touchList.push([Math.round(100 + Math.random() * 200), Math.round(300 + Math.random() * 200)])
})

return await request.post('/wxagame_settlement', {
return request.post('/wxagame_settlement', {
action_data: encrypt({
score,
times: 666,
Expand Down

0 comments on commit a28a9e6

Please sign in to comment.