public Task <string> GetSecret() { var nonce = Guid.NewGuid(); var timestamp = Commons.GetCurrentTimeStepNumber().ToString(); var token = ValidHelper.GetSignature( ValidHelper.GetSecretParams(new SecretModels { apptype = "system", nonce = nonce.ToString(), timestamp = timestamp })); var secret = $"timestamp={timestamp}&nonce={nonce.ToString()}&apptype={"system"}&signature={token}"; return(Task.FromResult(ValidHelper.Base64Code(secret))); }
/// <summary> /// 构造Secret /// </summary> /// <returns></returns> protected virtual Task <string> CreateSecret() { var nonce = Guid.NewGuid(); var timestamp = GetCurrentTimeStepNumber().ToString(); //var dataparams = ValidHelper.GetSecretParams(new SecretModels //{ // apptype = "Web", // nonce = nonce.ToString(), // timestamp = timestamp //}); //var token = ValidHelper.GetSignature(dataparams); var token = ValidHelper.GetSignature( ValidHelper.GetSecretParams(new SecretModels { apptype = "system", nonce = nonce.ToString(), timestamp = timestamp })); var secret = $"timestamp={timestamp}&nonce={nonce.ToString()}&apptype={"system"}&signature={token}"; return(Task.FromResult(ValidHelper.Base64Code(secret))); }