'alpha
url éèŠåžŠäž code å state (url?code=xxx&state=1)
code åstate æ¯ oauth æ¶ååæ¥ç
token èŠäŒ çšæ·ç token'

def create_js_edit_address_param(self, accesstoken, **params):

    params.update({'appId': self.appid, 'nonceStr': generate_token(8), 'timeStamp': int(time.time())})
    _params = [(k.lower(), str(v)) for (k, v) in params.items()]
    _params += [('accesstoken', accesstoken)]
    _params.sort()
    string1 = '&'.join([('%s=%s' % (p[0], p[1])) for p in _params])
    sign = sha1(string1).hexdigest()
    params = dict([(k, str(v)) for (k, v) in params.items()])
    params['addrSign'] = sign
    params['signType'] = 'sha1'
    params['scope'] = params.get('scope', 'jsapi_address')
    return params
