コード例 #1
0
        /// <summary>
        /// Accesses the token.
        /// </summary>
        /// <returns></returns>
        public JsonResult AccessToken(Models.AccessTokenModel model)
        {
            TempToken2OfficialMap map = unitOfWork.TokenReposity.AccessToken(model.oauth_token);

            if (map != null)
            {
                OauthTokenPair pair = unitOfWork.TokenReposity.GetTokenPair(map.oauth_token);
                return(Json(pair, JsonRequestBehavior.AllowGet));
            }
            return(Json(new{ err = "err" }, JsonRequestBehavior.AllowGet));
        }
コード例 #2
0
 /// <summary>
 /// 存储AccessTokenModel
 /// </summary>
 /// <param name="key">关键字</param>
 /// <param name="model">AccessTokenModel</param>
 public static void Set(string key, Models.AccessTokenModel model)
 {
     dic.Remove(key);
     dic.Add(key, model);
 }