rn.js
1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
'use strict';
const md5 = require('md5');
const PRIVATE_KEY = 'fd4ad5fcsa0de589af23234ks1923ks';
const v1 = (req, res) => {
let result = {
code: 400,
message: 'Config Success',
data: {}
};
let version = req.body.app_version || '';
switch (version) {
case '4.0.1':
result.data.url = 'http://cdn.yoho.cn/app-reactnative/4.0.1/main.zip';
result.data.rnv = '101';
result.data.minv = '4.0.1';
result.data.filecode = md5('dffb998e43a33215b4c47a4ccd3cf619yohorn2016');
result.md5 = md5(PRIVATE_KEY + ':' + JSON.stringify(result.data));
break;
case '4.1.0':
result.data.url = 'http://cdn.yoho.cn/app-downfiles/index.android.bundle.zip';
result.data.rnv = '101';
result.data.minv = '4.1.0';
result.data.filecode = md5('47c47db1eec6159f940e2018d3a83676yohorn2016');
result.md5 = md5(PRIVATE_KEY + ':' + JSON.stringify(result.data));
break;
default:
result.data.url = '';
result.data.rnv = '';
result.data.minv = '';
result.data.filecode = '';
result.md5 = md5(PRIVATE_KEY + ':' + JSON.stringify(result.data));
}
return res.json(result);
};
module.exports = {
v1
};