我正在尝试使用Symfony2实现对网站访问的单点登录.
身份验证本身似乎工作正常,但仅适用于初始页面.在加载的下一页上,用户不再登录.
相关代码:
$token = new UsernamePasswordToken($user, null, 'main', $user->getRoles());
$event = new InteractiveLoginEvent($request, $token);
$this->get("event_dispatcher")->dispatch(SecurityEvents::INTERACTIVE_LOGIN, $event);
$this->get("security.context")->setToken($token);
return $this->redirect($this->generateUrl('sonata_user_profile_show'));
Run Code Online (Sandbox Code Playgroud)
第一页(没有重定向):

第二页:

我正在尝试使用Moai SDK为游戏创建网格.网格中的每个图块都应该能够填充颜色.
所以实际上我有两个问题:

谢谢
function checkConnection() {
var networkState = navigator.connection.type;
var states = {};
states[Connection.UNKNOWN] = 'Unknown connection';
states[Connection.ETHERNET] = 'Ethernet connection';
states[Connection.WIFI] = 'WiFi connection';
states[Connection.CELL_2G] = 'Cell 2G connection';
states[Connection.CELL_3G] = 'Cell 3G connection';
states[Connection.CELL_4G] = 'Cell 4G connection';
states[Connection.NONE] = 'No network connection';
alert(Connection.WIFI);
alert(navigator.connection.type);
alert('Connection type: ' + states[networkState]);
}
Run Code Online (Sandbox Code Playgroud)