1234567891011121314151617181920212223242526272829303132333435 |
- class Url(object):
- CODE = "https://open-oauth.jd.com/oauth2/to_login"
- TOKEN = "https://open-oauth.jd.com/oauth2/access_token"
- class Params(object):
- APP_KEY = "23A1C5CD45F7B2D2EE026E1C72F9CB90"
- RESPONSE_CODE = "code"
- REDIRECT_URI = "http://develop.5tao5ai.com/testJd"
- SCOPE = "snsapi_base"
- STATE = "13499"
- BID = "100000000006317"
- BRANDID = "13499"
- STROEID = "24629013"
- SKUID = "100001"
- def _join_params(self):
- return "&".join(
- [
- "app_key={}".format(self.APP_KEY),
- "response_type={}".format(self.RESPONSE_CODE),
- "redirect_uri={}".format(self.REDIRECT_URI),
- "scope={}".format(self.SCOPE),
- "state={}".format(self.STATE),
- ]
- )
- def get_url(self):
- return "{}?{}".format(Url.CODE, self._join_params())
- print Params().get_url()
|