public UtilitiesModule() { Get("/Image/Token", async ctx => { var token = QiniuTool.GenerateToken(); await ctx.Ajax(new { token }); }); }
public IActionResult Token() { var token = QiniuTool.GenerateToken(); var result = new ApiMessage(); result.Data = token; result.Message = "success!"; result.Success = true; return(Json(result)); }
public IActionResult GetToken(string fileType) { var token = QiniuTool.GenerateToken(); return(Json(new { token = token, suffix = suffix })); }
public async Task <IActionResult> GetToken() { string token = ""; //if (!memoryCache.TryGetValue("getToken", out token)) //{ // token = qiniutool.GenerateToken(); // var cacheEntryOptions = new MemoryCacheEntryOptions() // .SetSlidingExpiration(TimeSpan.FromSeconds(30)); // memoryCache.Set("getToken", token, cacheEntryOptions); //} token = qiniutool.GenerateToken(); return(Json(new { token })); }
public IActionResult Token() { var result = new ApiMessage(); try { var token = QiniuTool.GenerateToken(); result.Data = token; result.Message = "success!"; result.Success = true; } catch (Exception exc) { result.SetFault(exc); } return(Json(result)); }
public string TokenByParam(string fileName, string bucket, ZoneID zoneID) { return(QiniuTool.GenerateToken(fileName, bucket, zoneID)); }
public string TokenByKey(string fileName) { return(QiniuTool.GenerateToken(fileName)); }
public string Token() { return(QiniuTool.GenerateToken()); }
public string GenerateQiniu() { var qiniu = new QiniuTool(settingService.File.AppKey, settingService.File.AppSecret, settingService.File.Bucket, settingService.File.Zone); return(qiniu.GenerateToken()); }