Files
order/common/libs/UrlManager.py

23 lines
663 B
Python
Raw Normal View History

2019-07-18 08:59:26 +08:00
# -*- coding: utf-8 -*-
2019-07-29 15:28:02 +08:00
import time
from application import app
2019-07-18 08:59:26 +08:00
class UrlManager(object):
def __init__(self):
pass
@staticmethod
def buildUrl( path ):
return path
@staticmethod
def buildStaticUrl(path):
2019-07-29 15:28:02 +08:00
release_version = app.config.get('RELEASE_VERSION')
ver = "%s" % (int(time.time())) if not release_version else release_version
2019-07-18 08:59:26 +08:00
path = "/static" + path + "?ver=" + ver
2019-08-02 18:24:04 +08:00
return UrlManager.buildUrl( path )
@staticmethod
def buildImageUrl( path ):
app_config = app.config['APP']
url = app_config['domain'] + app.config['UPLOAD']['prefix_url'] + path
return url