我正在使用asp.net核心身份2.1,我有一个随机的电子邮件确认问题,虽然电子邮件确认有时会说result.Error = InvalidToken.令牌也未过期.
注意:我们使用多个服务器,并且我们还将密钥存储在一个位置,以便所有服务器使用相同的密钥.
用于确认电子邮件的代码段.
邮件确认
var confCode = await _userManager.GenerateEmailConfirmationTokenAsync(user);
var callbackUrl = Url.Action("ConfirmEmail", "Account", new
{
userId = user.Id,
code = WebUtility.UrlEncode(confCode)
}, protocol: HttpContext.Request.Scheme);
string confirmationEmailBody = string.Format(GetTranslatedResourceString("ConfirmationEmailBody"), "<a href='" + callbackUrl + "'>") + "</a>";
Run Code Online (Sandbox Code Playgroud)
验证令牌
public async Task<bool> ConfirmEmailAsync(string userId, string code)
{
if (string.IsNullOrEmpty(userId) || string.IsNullOrEmpty(code))
return false;
var user = await _userManager.FindByIdAsync(userId);
if (user == null)
return false;
var result = await _userManager.ConfirmEmailAsync(user, code).ConfigureAwait(false);
if (!result.Succeeded)
result = …Run Code Online (Sandbox Code Playgroud) 我有一个HTML页面.在那个页面中,我正在尝试添加一个WYSIWYG编辑器.我决定用这个.我在我的应用程序中工作.但是,我似乎无法按照我想要的方式进行设计.我相信问题是因为我正在使用这个主题.我真的希望能够toolbar floating在文本框标签的右侧有上面的控件.与此同时,我想保持纸张外观而不是笨重的盒子.
在这一点上,我已经尝试过这个小提琴.造型完全错了.主要代码如下:
<div class="container">
<div class="form-group label-static is-empty">
<div class="row">
<div class="col-xs-3"><label class="control-label" for="Description">Description</label> </div>
<div class="col-xs-9">
<div id="toolbar" class="pull-right" style="vertical-align:top; margin-top:0; padding-top:0;">[toolbar]</div>
</div>
</div>
<input class="form-control" rows="3" id="Description" name="Description" onfocus="setMode('rich');" onblur="setMode(null);"></div>
</div>
Run Code Online (Sandbox Code Playgroud)
我正在使用以下JavaScript:
$(function () {
$.material.init();
});
function setMode(name) {
if (name === 'rich') {
$('#Description').summernote({ focus: true });
} else {
$('#Description').summernote('destroy');
}
}
Run Code Online (Sandbox Code Playgroud)
任何帮助表示赞赏.这真令人沮丧.
我想通过朋友的电子邮件获得完整的联系人列表.我可以获取联系人列表但没有电子邮件.
这是我的代码:
require_once APPPATH . 'vendor/google/src/Google_Client.php';
require_once APPPATH . 'vendor/google/src/contrib/Google_Oauth2Service.php';
$client = new Google_Client();
$client->setApplicationName("PHP Google Test");
$client->setClientId('xxx');
$client->setClientSecret('xxx');
$client->setRedirectUri('http://www.domain.xx/admin/others/google?test');
$client->setScopes("http://www.google.com/m8/feeds/");
$oauth2 = new Google_Oauth2Service($client);
if (isset($_GET['code'])) {
$client->authenticate();
$_SESSION['token'] = $client->getAccessToken();
$redirect = 'http://www.domain.xx/admin/others/google';
header('Location: ' . filter_var($redirect, FILTER_SANITIZE_URL));
}
if (isset($_SESSION['token'])) {
$client->setAccessToken($_SESSION['token']);
}
if (isset($_REQUEST['logout'])) {
unset($_SESSION['token']);
$client->revokeToken();
}
if ($client->getAccessToken()) {
$req = new Google_HttpRequest("https://www.google.com/m8/feeds/contacts/default/full");
$val = $client->getIo()->authenticatedRequest($req);
$response = json_encode(simplexml_load_string($val->getResponseBody()));
print "<pre>" . print_r(json_decode($response, true), true) . "</pre>";
$_SESSION['token'] = $client->getAccessToken();
} else { …Run Code Online (Sandbox Code Playgroud) 我是angular2的新手,我有一个问题,我的输入有一个属性autoGorw它是一个自定义指令,有两个events (焦点)和(模糊),onFocus()我想增加输入大小,onBlur()我想减小其大小默认大小,events在控制台中一直是触发和显示结果,但是input大小没有增加,我的控制台中没有任何错误,我不知道我缺少什么.
对不起,我尝试过Plunker现场演示,让你很容易理解,但无法制作一个.
这是我的代码
自动grow.directive.ts
import {Directive, ElementRef, Renderer} from '@angular/core'
// ElementRef => Gives access to host element
// Renderer => Gives access to modify that element
@Directive({
selector: '[autoGrow]',
host:{
'(focus)' : 'onFocus()',
'(blur)' : 'onBlur()'
}
})
export class AutoGrowDirective{
constructor(private el : ElementRef, private renderer : Renderer){
}
onFocus(){
console.log("Triggered !"); // its working upto this line.
this.renderer.setElementStyle(this.el.nativeElement,'Width','500'); …Run Code Online (Sandbox Code Playgroud) .net-core ×1
angular ×1
api ×1
asp.net ×1
asp.net-mvc ×1
c# ×1
css ×1
javascript ×1
json ×1
php ×1