Code.class.php
1.89 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
/**
* 常规的请求对应的code及解释
* @author xmg
* @version 0.1 2014.2.8
*
*/
abstract class Config_Code
{
/**
* 错误信息
*
* @var array
*/
public static $error = array
(
//系统提示
'system' => array('code' => 500, 'message' => '系统错误'),
'missing_parameter' => array('code' => 500001, 'message' => '缺少参数'),
//用户相关提示
'user_exist' => array('code' => 50100, 'message' => '该用户已存在'),
'user_not_exist' => array('code' => 50101, 'message' => '该用户不存在'),
'user_disabled' => array('code' => 50102, 'message' => '该用户已被禁用'),
'user_no_login' => array('code' => 50103, 'message' => '该用户未登录'),
//密码相关提示
'pwd_error' => array('code' => 50200, 'message' => '密码不正确'),
'pwd_format' => array('code' => 50201, 'message' => '密码不合法,至少6个字符'),
//账号相关提示
'account_format' => array('code' => 50300, 'message' => '账号不合法'),
'account_type' => array('code' => 50301, 'message' => '无效的账号类型'),
'account_set' => array('code' => 50302, 'message' => '绑定账号失败'),
'account_only_one' => array('code' => 50303, 'message' => '该账号不允许解除绑定'),
'account_exist' => array('code' => 50304, 'message' => '该账号已存在'),
//用户资料
'userinfo_set' => array('code' => 50400, 'message' => '更新用户资料失败'),
);
/**
* 正确信息
*
* @var array
*/
public static $success = array
(
//系统提示
'system' => array('code' => 200, 'message' => '成功操作'),
//用户相关提示
'user_register' => array('code' => 20100, 'message' => '成功注册'),
'user_login' => array('code' => 20101, 'message' => '成功登录'),
//用户资料
'userinfo_set' => array('code' => 20200, 'message' => '成功更新用户资料'),
);
}