def _install_plugin(self): """ 初始化插件 """ install_redis_plugin(self.app) install_session_plugin(self.app)
from model import mysql from decimal import Decimal #from pyinapp import * ACCEPT_NUM_BASE = 198326 ACCEPT_TT = [md5.new(str(ACCEPT_NUM_BASE+i)).hexdigest() for i in xrange(10)] SESSION_TTL = 60*60 CHECK_SUCCESS = 1 #生成捕鱼APP fish_app = Bottle() #获取配置 conf = default_app().config #安装插件 install_redis_plugin(fish_app) install_session_plugin(fish_app) import fish_broad import fish_invite import fish_pay import fish_exchange FORMAT_PARAMS_POST_STR = "%s = request.forms.get('%s','').strip()" FORMAT_PARAMS_GET_STR = "%s = request.GET.get('%s','').strip()" #用户信息 USER_INFO = ('headImgUrl', 'sex', 'isVolntExitGroup','coin','exchange_ticket') DEFAULT_AGENT_ID = '540302' # DEFAULT_AGENT_ID = '000000'
""" Author:$Author$ Date:$Date$ Revision:$Revision$ Description: 后台APP应用入口 """ from bottle import Bottle from common.install_plugin import install_redis_plugin, install_session_plugin admin_app = Bottle() install_redis_plugin(admin_app) install_session_plugin(admin_app) import admin_index import admin_auth #会员模块 import admin_member # 数据统计模块 import admin_statistics # 个人信息模块 import admin_self # 代理模块 import admin_agent # 用户权限模块 import admin_power #游戏模块 import admin_game
#模板 bottle.TEMPLATE_PATH.append('mahjong/template/%s' % (TEMPLATE_NAME)) random.seed() #主应用 main_app = bottle.default_app() #配置文件 config_file = 'conf_release.json' # #从json中读取配置文件 with open(config_file) as f: main_app.config.load_dict(json.load(f)) #安装插件 install_redis_plugin(main_app) install_session_plugin(main_app) if main_app.config.get('download_view', 1): @main_app.get('/download/<res_path:path>') def download_path(res_path): ''' @description: 是否允许下载 ''' return bottle.static_file(res_path, root=DOWNLOAD_PATH, download=True) @main_app.get('/<res_path:path>') def content_path(res_path): ''' @description: 设置资源文件路径
#-*- coding:utf-8 -*- #!/usr/bin/python """ Author:$Author$ Date:$Date$ Revision:$Revision$ Description: 后台activice应用入口 """ from bottle import Bottle from common.install_plugin import install_redis_plugin,install_session_plugin activice_app = Bottle() install_redis_plugin(activice_app) install_session_plugin(activice_app)
#from common.log import * from datetime import datetime import time import urllib2 import json import random import md5 ACCEPT_NUM_BASE = 198326 ACCEPT_TT = [md5.new(str(ACCEPT_NUM_BASE + i)).hexdigest() for i in xrange(10)] #wechatApp hall_app = Bottle() #安装插件 install_redis_plugin(hall_app) install_session_plugin(hall_app) def onReg(redis, account, passwd, type): #传入参数:账号,密码,类型;返回参数:成功返回账号和密码,失败返回None, None curTime = datetime.now() #print print '[%s][wechat onReg][info] account[%s] passwd[%s] type[%s]' % ( curTime, account, passwd, type) if type == 1: #微信code登录 tokenMessage = checkWeixinCode(account) if tokenMessage: password = account