#!/usr/bin/env python
# coding: utf-8
from time import strftime, localtime
import urllib, urllib2, json
import hmac, hashlib
class RandCode(object):
APP_ID = ''
APP_SECRET = ''
ACCESS_TOKEN = ''
RANDCODE_TOKEN = ''
TOKEN_API = 'https://oauth.api.189.cn/emp/oauth2/v2/access_token'
RANDCODE_TOKEN_API = 'http://api.189.cn/v2/dm/randcode/token'
RANDCODE_SEND_API = 'http://api.189.cn/v2/dm/randcode/send'
RANDCODE_SENDSMS_API = 'http://api.189.cn/v2/dm/randcode/sendSms'
def __init__(self, app_id='', app_secret='', access_token=''):
self.APP_ID = app_id or RandCode.APP_ID
self.APP_SECRET = app_secret or RandCode.APP_SECRET
self.ACCESS_TOKEN = access_token or self.__f