-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
79 lines (75 loc) · 5.99 KB
/
config.py
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# -*- coding: utf-8 -*-
import os
import uimodules
app_config = {
"static_path": os.path.join(os.path.dirname(__file__), "static"),
'template_path' : os.path.join(os.path.dirname(__file__), 'tpl'),
"cookie_secret": 'ZjLpnC7ZRy+1mucQHlQZRsGxxBXkLku6lPNBcpl0FTI=',#base64.b64encode(uuid.uuid4().bytes + uuid.uuid4().bytes),
"login_url": "/signin",
"xsrf_cookies": False,
'debug' : True,
'autoescape' : None,
'ui_modules': {"Entry": uimodules.EntryModule,
'Aside': uimodules.AsideModule,
"FeedEntry" : uimodules.FeedModule,
"PeopleEntry" : uimodules.PeopleModule
},
}
mysql_config = {
'mysql_host' : 'localhost:3306',
'mysql_database' : 'wishing',
'mysql_user' : 'root',
'mysql_password' : '',
}
#json ajax ret map
#req_stat 表示请求某件事儿是失败了还是完成了 fail & done
#res_stat 表示服务器端处理情况,是否是异常?是否是服务器错误(包括验证错误等)?
ret_code_map = {
#登录相关
'0': {'ret':'0','req_stat':'fail','res_stat':'success','msg':u'登录失败,密码错误','data':None},
'1': {'ret':'1','req_stat':'done','res_stat':'success','msg':u'登录成功','data':None},
'2': {'ret':'2','req_stat':'fail','res_stat':'success','msg':u'没有该账号','data':None},
'3': {'ret':'3','req_stat':'fail','res_stat':'failure','msg':u'请输入账号和密码','data':None},
'4': {'ret':'4','req_stat':'done','res_stat':'success','msg':u'已经登录','data':None},
'5': {'ret':'5','req_stat':'fail','res_stat':'success','msg':u'该账号已经被注册','data':None},
'6': {'ret':'6','req_stat':'done','res_stat':'success','msg':u'注册成功,已经自动登录','data':None},
'7': {'ret':'7','req_stat':'done','res_stat':'success','msg':u'添加用户成功','data':None},
#通用:
'000' : {'ret':'000','req_stat':'fail','res_stat':'success','msg':u'提交参数错误','data':None},
'001' : {'ret':'001','req_stat':'done','res_stat':'success','msg':u'常规数据返回:user feed','data':None},
'002' : {'ret':'002','req_stat':'done','res_stat':'success','msg':u'操作成功','data':None},
'003' : {'ret':'003','req_stat':'done','res_stat':'failure','msg':u'操作失败','data':None},
'004' : {'ret':'004','req_stat':'fail','res_stat':'failure','msg':u'请求错误','data':None},
'005' : {'ret':'005','req_stat':'done','res_stat':'success','msg':u'请求成功:用户好友','data':None},
'006' : {'ret':'006','req_stat':'done','res_stat':'success','msg':u'常规数据返回:more motice','data':None},
'007' : {'ret':'007','req_stat':'done','res_stat':'success','msg':u'常规数据返回:more wish','data':None},
'008' : {'ret':'008','req_stat':'done','res_stat':'success','msg':u'常规数据返回:more message','data':None},
'009' : {'ret':'008','req_stat':'done','res_stat':'success','msg':u'常规数据返回:more conversation','data':None},
#愿望相关:
'100' : {'ret':'100','req_stat':'done','res_stat':'success','msg':u'保存愿望成功','data':None},
'101' : {'ret':'101','req_stat':'done','res_stat':'failure','msg':u'保存愿望失败:未找到该愿望','data':None},
'102' : {'ret':'102','req_stat':'done','res_stat':'failure','msg':u'保存愿望失败','data':None},
'103' : {'ret':'103','req_stat':'done','res_stat':'success','msg':u'添加评论成功','data':None},
#通知系统:
'201' : {'ret':'201','req_stat':'done','res_stat':'success','msg':u'通知数据返回','data':None},
'202' : {'ret':'202','req_stat':'done','res_stat':'success','msg':u'清除全部未读通知成功','data':None},
'203' : {'ret':'203','req_stat':'done','res_stat':'success','msg':u'清除未读通知成功','data':None},
'204' : {'ret':'204','req_stat':'fail','res_stat':'success','msg':u'清除未读通知失败','data':None},
#私信:
'300' : {'ret':'300','req_stat':'done','res_stat':'success','msg':u'发送私信成功','data':None},
'301' : {'ret':'301','req_stat':'done','res_stat':'failure','msg':u'发送私信失败:对方设置了不接受陌生人私信,需要在关注你后你才能发送私信给对方','data':None},
#账户设置
'400' : {'ret':'400','req_stat':'done','res_stat':'success','msg':u'修改密码成功','data':None},
'401' : {'ret':'401','req_stat':'done','res_stat':'failure','msg':u'修改密码失败:原始密码输入错误','data':None},
'402' : {'ret':'402','req_stat':'done','res_stat':'success','msg':u'修改基本资料成功','data':None},
'403' : {'ret':'403','req_stat':'done','res_stat':'failure','msg':u'修改基本资料失败','data':None},
'404' : {'ret':'404','req_stat':'done','res_stat':'success','msg':u'修改私信设置成功','data':None},
'405' : {'ret':'405','req_stat':'done','res_stat':'failure','msg':u'修改私信设置失败','data':None},
'406' : {'ret':'406','req_stat':'done','res_stat':'success','msg':u'修改email设置成功','data':None},
'407' : {'ret':'407','req_stat':'done','res_stat':'failure','msg':u'修改email设置失败','data':None},
#关系:
#其他:
'0000': {'ret':'0000','req_stat':'fail','res_stat':'failure','msg':u'未知错误'}
}
#需要记录日志的 code
log_code_map = []