我正在尝试运行该命令,npm run build
但它无法正常工作.我收到以下错误:
> typescript@1.0.0 build /Users/Prashant/Code/typescript
> webpack
Hash: c6dbd1eb3357da70ca81
Version: webpack 3.2.0
Time: 477ms
Asset Size Chunks Chunk Names
bundle.js 2.89 kB 0 [emitted] main
[0] ./src/index.js 51 bytes {0} [built]
[1] ./src/index.css 290 bytes {0} [built] [failed] [1 error]
ERROR in ./src/index.css
Module build failed: Unknown word (5:1)
3 | // load the styles
4 | var content = require("!!./index.css");
> 5 | if(typeof content === 'string') content = [[module.id, content, '']];
| ^
6 …
Run Code Online (Sandbox Code Playgroud) 我正在保存通过geo redis npm软件包从移动设备发送到redis数据库的坐标点,但是它们无法获取保存路径的位置,因为我需要它们来获取用户行进的总距离。我也想移动所有坐标点MySql数据库中的点。
我可以在命令的帮助下将所有点保存为地理设置
```127.0.0.1:6379> ZRANGE rideLocations:345 0 -1```
Run Code Online (Sandbox Code Playgroud)
但是我发现的所有值都以这种地理格式编码
```
1) "1"
2) "3484047800163752"
3) "10"
4) "3484047800163752"
5) "2"
6) "3484047800163752"
7) "3"
8) "3484047800163752"
9) "4"
10) "3484047800163752"
11) "5"
12) "3484047800163752"
13) "6"
14) "3484047800163752"
15) "7"
16) "3484047800163752"
17) "8"
18) "3484047800163752"
19) "9"
20) "3484047800163752"
```
Run Code Online (Sandbox Code Playgroud)
如何获得它们的真实格式{lat:23.234,lng:45.5435}或如何将其转换为真实格式。
或者如果我存储的类型有误,我有什么建议吗?在保存到MySql之前如何转换它们。nodejs中的任何命令。
我/var/www/html/
使用命令在localhost()上进行了一个新的laravel设置composer create-project laravel/laravel moduleTesting --prefer-dist
.
然后我将文件夹中的所有文件移动到(/var/www/moduleTesting/setup
),然后将所有文件从public folder(/var/www/moduleTesting/setup/public
)移动到moduleTesting文件夹(/var/www/html/moduleTesting
).
我更改了放在moduleexample.dev文件夹(/var/www/html/moduleTesting/
)中的index.php文件中的bootstrap文件路径.
需要DIR.'/ setup/bootstrap/autoload.php'; $ app = require_once DIR.'/ ../../laravel_setup/bootstrap/app.php';
我还设置了文件夹/var/www/moduleTesting/setup/bootstrap/cache
和权限/var/www/moduleTesting/setup/storage
然后我composer dump-autoload
在(/var/www/moduleTesting/
)的终端运行命令.
然后我尝试在浏览器中运行URL,然后我看到laravel app的欢迎页面.
然后我安装模块包含caffeinated/modules首先通过Composer安装包.
composer require caffeinated/modules
Run Code Online (Sandbox Code Playgroud)
完成此操作后,只需将服务提供者和外观类添加到项目/var/www/html/moduleTesting/setup/config/app.php
文件中:
Caffeinated\Modules\ModulesServiceProvider::class,
Run Code Online (Sandbox Code Playgroud)
'Module' => Caffeinated\Modules\Facades\Module::class,
Run Code Online (Sandbox Code Playgroud)成功安装后,我按命令创建一个新模块,
make:module Admin
并按照简单的步骤创建,并通过点击URL http:// localhost/moduleTesting/admin '运行.
现在问题是当我运行URL时.http:// localhost/moduleTesting/admin '它运行成功,但是当我运行' http:// localhost/moduleTesting/admin '(仅在同一个网址的末尾添加'/')时,它现在可以正常工作并将我重定向到url'http :// localhost/admin '
有谁知道,请帮助我如何解决这个问题,在同一节点上如果在内部文件夹中上传服务器上的设置并运行相同的URL它也重定向我.
我想展示API和网站的不同响应.在api响应中,我想用404和500显示json响应,主要用于路由的异常类型.
如果用户尝试请求未找到的路由和路由,我想在json响应中显示API的响应和网站的网页.
我知道并尝试编码 app/Exceptions/Handler.php
public function render($request, Exception $exception)
{
if ($exception instanceof NotFoundHttpException) {
if ($request->expectsJson()) {
return response()->json(['error' => 'Not Found'], 404);
}
return response()->view('404', [], 404);
}
return parent::render($request, $exception);
}
Run Code Online (Sandbox Code Playgroud)
https://laravel.com/docs/5.4/errors#http-exceptions
但是失败的任何人都可以帮助我如何为错误页面设置不同的响应.
我使用的是作曲家包'rackspace/php-opencloud'
composer require rackspace/php-opencloud
Run Code Online (Sandbox Code Playgroud)
并尝试上传并获取文件夹中的文件列表
包括自动加载文件并添加
require 'vendor/autoload.php';
Run Code Online (Sandbox Code Playgroud)
使用文档http://docs.php-opencloud.com/en/latest/services/object-store/index.html上给出的过程,但我没有获得访问容器内的文件夹的解决方案(在我的案例中的食谱) ).如何将文件上传到容器"食谱"中的"images"和"uploads"目录中.
$client = new OpenCloud\OpenStack('{keystoneUrl}', array(
'username' => '{username}',
'password' => '{apiKey}',
'tenantId' => '{tenantId}',
));
$service = $client->objectStoreService('{catalogName}', '{region}', '{urlType}');
Run Code Online (Sandbox Code Playgroud)
$ containers = $ service-> listContainers();
foreach ($containers as $container) {
/** @param $container OpenCloud\ObjectStore\Resource\Container */
printf("Container name: %s\n", $container->name);
printf("Number of objects within container: %d\n", $container->getObjectCount());
}
Run Code Online (Sandbox Code Playgroud)
通过上面的代码,我可以访问容器列表,我可以设置容器,并可以获取列表
$containers = $service->listContainers();
** @param $container OpenCloud\ObjectStore\Resource\Container */
$container = $service->getContainer('{containerName}');
Run Code Online (Sandbox Code Playgroud) 我试着得到这样的东西
select * from `users`
inner join `settings`
on `users`.`id` = `settings`.`user_id`
and NOW() NOT BETWEEN quit_hour_start AND quit_hour_end
where `notification_key` != ''
and `device_type` = 'Android'
Run Code Online (Sandbox Code Playgroud)
雄辩的.有人试图在eloquent中成功构建此查询.我知道我可以使用\DB::select(DB::raw());
并得到我的结果.但我想使用与Laravel雄辩的方法.
======更新已尝试查询的评论========
$androidUser = User::join('settings', function ($join) {
$join->on('users.id', '=', 'settings.user_id')
->where(DB::raw("'$currentTime' NOT BETWEEN quit_hour_start AND quit_hour_end"));
})
->where('notification_key', '!=', '')
->where('device_type' ,'=', 'Android')
->get();
Run Code Online (Sandbox Code Playgroud) laravel ×3
php ×3
css ×1
css-loader ×1
eloquent ×1
geolocation ×1
laravel-5.3 ×1
laravel-5.4 ×1
laravel-5.5 ×1
node.js ×1
rackspace ×1
redis ×1
url ×1
webpack ×1