Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
2
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
cl
9 years ago
Committed by
Niall
9 years ago
Commit
5334e19864d46540165022bae03dbef62ed33149
1 parent
1caae86f
新增rn接口
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
76 additions
and
0 deletions
yohobuy/m.yohobuy.com/application/controllers/Rn.php
yohobuy/m.yohobuy.com/application/controllers/Rn.php
0 → 100644
View file @
5334e19
<?php
use
Action\AbstractAction
;
/**
* Created by PhpStorm.
* User: Leo
* Date: 16/2/17
* Time: 上午11:48
*/
class
RnController
extends
AbstractAction
{
const
PRIVATE_KEY
=
'fd4ad5fcsa0de589af23234ks1923ks'
;
/**
* V1版本
*
* 参数列表
* -------------------------------------------------------------------------
* 字段 描述 类型 示例
* app_version 当前版本号 string 3.8.0
* uid 用户ID string 13423331
* client_type 用户手机系统:Android,IOS string Android
* screen_size 屏幕尺寸 string 1080x1920
* udid 设备唯一码 string 1d123sadao3
* os_version 设备版本号 string 1d123sadao3
* rnv bundle版本号,如果本地没有补丁,传空 string 100
* minv 最低支持的版本号
*
* 返回列表
* -------------------------------------------------------------------------
* 字段 描述 类型 示例
* code 返回的code,200,304等,具体的服务器定义 int 200
* message 信息 string "Config Success"
* md5 当前请求的唯一码 string "1234567890123456"
* data 配置参数数据,参考data列表 object
* [
* url 补丁url地址,没有传空 string http://yohocdn.com/fpath/fpkk.js
* rnv 当前bundle的版本号,没有就传空 string "100"
* filecode md5(md5(文件内容) + "yohorn2016") string "1233321121212332"
* ]
* echo md5(file_get_contents('http://cdn.yoho.cn/app-hotfix/yohobuy/4.0.0/main2.js'));
*/
public
function
v1Action
()
{
$result
=
array
(
'code'
=>
200
,
'message'
=>
'Config Success'
,
'md5'
=>
''
,
'data'
=>
array
());
s
// 根据版本号返回补丁文件信息
$version
=
$this
->
post
(
'app_version'
);
switch
(
$version
)
{
case
'4.0.0'
:
// 版本号
$result
[
'data'
][
'url'
]
=
''
;
$result
[
'data'
][
'rnv'
]
=
''
;
$result
[
'data'
][
'minv'
]
=
''
;
// $result['data']['filecode'] = md5('b3e54e59cb41453623360a55e9588361' . 'yohorn2016');
$result
[
'data'
][
'filecode'
]
=
''
;
$result
[
'md5'
]
=
md5
(
self
::
PRIVATE_KEY
.
':'
.
json_encode
(
$result
[
'data'
]));
break
;
default
:
// 默认
$result
[
'data'
][
'url'
]
=
''
;
$result
[
'data'
][
'rnv'
]
=
''
;
$result
[
'data'
][
'filecode'
]
=
''
;
$result
[
'md5'
]
=
md5
(
self
::
PRIVATE_KEY
.
':'
.
json_encode
(
$result
[
'data'
]));
}
$this
->
echoJson
(
$result
);
}
}
...
...
Please
register
or
login
to post a comment