我收到这些错误:
2014/05/24 11:49:06 [错误] 8376#0:*54031上游从上游读取响应头时发送过大头,客户端:107.21.193.210,服务器:aamjanata.com,请求:"GET/the-洗脑-编年史主办逐古吉拉特邦政府/,%20https:/aamjanata.com/the-brainwash-chronicles-sponsored-by-gujarat-government /,%20https:/aamjanata.com/the-brainwash-chronicles-赞助逐古吉拉特邦政府/,%20https:/aamjanata.com/the-brainwash-chronicles-sponsored-by-gujarat-government /,%20https:/aamjanata.com/the-brainwash-chronicles-sponsored-by-古吉拉特邦政府/,%20https:/aamjanata.com/the-brainwash-chronicles-sponsored-by-gujarat-government /,%20https:/aamjanata.com/the-brainwash-chronicles-sponsored-by-gujarat-government/ ,%20https:/aamjanata.com/the-brainwash-chronicles-sponsored-by-gujarat-government /,%20https:/aamjanata.com/the-brainwash-chronicles-sponsored-by-gujarat-government /,%20https: /aamjanata.com/the-brainwash-chronicles-sponsored-by-gujarat-government/,%20https:/aamjanata.com/t 他-洗脑 - 编年史主办逐古吉拉特邦政府/,%20https:/aamjanata.com/the-brainwash-chronicles-sponsored-by-gujarat-government /,%20https:/aamjanata.com/the-brainwash-编年史赞助逐古吉拉特邦政府/,%20https:/aamjanata.com/the-brainwash-chronicles-sponsored-by-gujarat-government /,%20https:/aamjanata.com/the-brainwash-chronicles-sponsored-通过-古吉拉特邦政府/,%20https:/aamjanata.com/the-brainwash-chronicles-sponsored-by-gujarat-government/,%20https://aamjanata.com/the-brainwash-chronicles-sponsored-by-gujarat - 政府/,%20https:/aamjanata.com/the-brainwash-chronicles-sponsored-by-gujarat-government /,%20https:/aamjanata.com/the-brainwash-chronicles-sponsored-by-gujarat-government/, %20https:/aamjanata.com/the-brainwash-chronicles-sponsored-by-gujarat-government /,%20https:/aamjanata.com/the-brainwash-chronicles-sponsored-by-gujarat-government /,%20https:/ aamjanata.com/the-brainwash-chronicles-sponsored-by-gujarat-government/,%20https:/aamjanata.com/the-brainwash-ch ronicles赞助逐古吉拉特邦政府/,%20ht
总是一样的.一个url一遍又一遍地用逗号分隔重复.无法弄清楚造成这种情况的原因.有人有想法吗?
更新:另一个错误:
http request count is zero while sending response to client
Run Code Online (Sandbox Code Playgroud)
这是配置.还有其他不相关的东西,但这部分是添加/编辑的
fastcgi_cache_path /var/nginx-cache levels=1:2 keys_zone=WORDPRESS:100m inactive=60m;
fastcgi_cache_key "$scheme$request_method$host$request_uri";
fastcgi_cache_use_stale error timeout invalid_header http_500;
fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
# Upstream to abstract backend connection(s) for PHP.
upstream php {
#this should match value of "listen" directive in …
Run Code Online (Sandbox Code Playgroud) 我试图,return Response::json('data', $request);
但是我收到一个错误:
ProjectsController.php第74行中的FatalErrorException:调用未定义的方法Illuminate\Http\Response :: json()
它在哪里Response::json()
?我究竟做错了什么?
我试图将值发布到验证中并将响应作为json返回,而不是return view
在文档中给出.
$validator = Validator::make($request->all(), [
'about' => 'min:1'
]);
if ($validator->fails()) {
return response()->json(['errors' => ?, 'status' => 400], 200);
}
Run Code Online (Sandbox Code Playgroud)
帖子是由ajax制作的,所以我也需要在ajax中收到回复.
我发现为了防止在返回的响应中刷新页面,我必须在数组外给它一个200的状态代码.但我无法弄清楚要给这个'errors'
部分什么.我应该在那里写什么?
我创建了一个Slider(作为视频的控件,就像YouTube在底部一样)并设置最大值(持续时间)和最小值.然后用来SeekToTime
改变currentTime.现在,用户可以滑动滑块的拇指来更改值
我想要实现的是让用户点击滑块上的任意位置并设置视频的当前时间.
我从这个答案中得到了一个方法,我试着将它应用到我的案例中,但是无法使它成功
class ViewController: UIViewController, PlayerDelegate {
var slider: UISlider!
override func viewDidLoad() {
super.viewDidLoad()
// Setup the slider
}
func sliderTapped(gestureRecognizer: UIGestureRecognizer) {
// print("A")
let pointTapped: CGPoint = gestureRecognizer.locationInView(self.view)
let positionOfSlider: CGPoint = slider.frame.origin
let widthOfSlider: CGFloat = slider.frame.size.width
let newValue = ((pointTapped.x - positionOfSlider.x) * CGFloat(slider.maximumValue) / widthOfSlider)
slider.setValue(Float(newValue), animated: true)
}
}
Run Code Online (Sandbox Code Playgroud)
我认为这应该有用,但没有运气.然后我尝试在尝试将"A"打印到日志时进行调试,但事实并非显然不会进入该sliderTapped()
功能.
我究竟做错了什么?或者有更好的方法来实现我想要实现的目标吗?
uislider uigesturerecognizer ios uitapgesturerecognizer swift
我抬起头但是我找不到如何向UIView添加内部阴影,只为Swift添加顶部(从上到下).在Swift中添加内圈的最佳方法是什么?
编辑:我在SO上找到了一些问题和答案,但是他们要么是obj-c,要么看起来很复杂.如果有的话,我只是想找一个更加Swifty的方式
我想要实现的目标:
我设置了密码授权(它是应用程序的后端).现在,我可以发送一个帖子请求oauth/token
,它适用于邮递员.但是,如果我也想从api注册用户怎么办?
我知道我可以使用当前/register
路由,但是,我是否需要将用户重定向回登录页面并使用他的凭据再次登录?
或者在RegisterController中,在registered()
函数中,我应该重定向到oauth/token
路由吗?(为此,请注意我发送的所有5个数据都在'x-www-form-urlencoded'中,它似乎有效.但是,我是否需要在标题中分开一些?这对我来说很模糊,所以只是想要当我有机会时问.)
或者我应该oauth/token
像这个人一样在方法中添加一些东西?实际上,我试图捕获库中方法的发布$request
数据AccessTokenController@issueToken
,但是我无法弄清楚如何操作parsedBody
数组.如果我从实际库中触发我的寄存器功能,我怎么知道它是注册还是登录?
也许我错过了一些信息,但根据这个主题我找不到任何东西.在Passport中处理注册用户的正确方法是什么?
更新:接受的答案显示'注册'周期; 在它下面我添加了'login'和'refresh token'实现.希望能帮助到你 :)
我不知道你可以使用以下方法在Laravel上创建每小时任务:
$schedule->command('catalog:update')->hourly();
但有没有办法,例如每2小时或5小时?我无法在文档或此处找到它.
我已经创建了一个 S3 并且我成功地在存储桶上上传了文件。现在,我试图让它与 CloudFront 一起工作,但它给了我
非法位置约束异常
ap-east-1 位置约束与此请求发送到的区域特定端点不兼容。
我的 S3 网址是:http : //my-bucket-name.s3.ap-east-1.amazonaws.com/assets/local/css/app.css(这会返回文件)
CloudFront 链接到 S3,网址为:https : //id.cloudfront.net/assets/local/css/app.css(这会返回 IllegalLocationConstraintException)
在 S3 存储桶 > 权限 >
“阻止公共访问”已关闭
“存储桶策略”是自动生成的:
{
"Version": "2008-10-17",
"Id": "PolicyForCloudFrontPrivateContent",
"Statement": [
{
"Sid": "1",
"Effect": "Allow",
"Principal": {
"AWS": "######"
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::my-bucket-name/*"
}
]
}
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?
我想在JavaScript变量中传递/存储Laravel数组.我用过,->all()
所以我得到的结果是这样而不是对象:
array:83 [?
0 => 1
1 => 11
2 => 12
...
]
Run Code Online (Sandbox Code Playgroud)
我可以在视图中使用{{ $theArray }}
.
无论我尝试什么,我都无法将其转换为javascript数组.
我试过了
var array = {{ $theArray }};
var array = {{{ $theArray }}};
我觉得我很接近,但我无法理解
我正在尝试UIView
使用透明背景(另一个UIView
)制作一个popup().对于'弹出窗口UIView
' 一切都工作正常,但我无法弄清楚如何带来'透明背景UIView
'(在NavigationBar和TabBar之上).
首先,我在故事板中创建了UIView并连接了插座:
popupView.center = CGPointMake(CGRectGetMidX(self.view.bounds), tableView.center.y);
self.view.addSubview(popupView)
popupView.clipsToBounds = true
popupView.alpha = 0
Run Code Online (Sandbox Code Playgroud)
然后,在显示popupView
我正在创建透明背景UIView:
func clicked() {
self.popupView.alpha = 1
let screenSize: CGRect = UIScreen.mainScreen().bounds
let opaqueView = UIView()
opaqueView.frame.size = CGSize(width: screenSize.width, height: screenSize.height)
opaqueView.backgroundColor = UIColor.blackColor()
opaqueView.alpha = 0.5
self.view.addSubview(opaqueView)
}
Run Code Online (Sandbox Code Playgroud)
但是,后台视图不会覆盖NavigationBar或TabBar.我尝试了这个,但没有改变:
myTabBar.view.bringSubviewToFront(opaqueView)
Run Code Online (Sandbox Code Playgroud)
我想要实现的是,虽然popup UIView
在最前面,拥有opaque UIView
包括NavBar和TabBar在内的所有东西,但却落伍popup UIView
更新:
关于@Alex的回答,有了这个块,我实现opaqueView
了TabBar和NavBar的显示; 但现在它也超越了popupView.
func display() {
popupView.center = CGPointMake(CGRectGetMidX(self.view.bounds), tableView.center.y);
self.view.addSubview(popupView)
popupView.clipsToBounds = …
Run Code Online (Sandbox Code Playgroud)