-
laravel 时间不对
Laravel 少了8小时,需要把 timezone 设置成上海 找到app/config/app.php 'timezone'='UTC', 改成 'timezone'='Asia/Shanghai', 参考: https://blog.csdn.net/qq_34827048/article/details/79813251
学习 2020-03-26 2446
-
laravel 定时
创建任务 使用artisan命令创建一个测试任务 php artisan make:command Test 创建成功 app/Console/Commands/Test.php所在位置 app/Console/Commands/Test.php内容 class Test extends Command { /** * The name and signature of the console c…
学习 2020-03-25 3124
-
laravel Error Class ‘App\Http\Controllers\Exception’ not found
问题 throw new Exception('ok'); 解决 用这个php自带的\Exception throw new \Exception("ok"); try { throw new \Exception('ok'); } catch (\Exception $e) { echo $e->getMessage(); } 或者 先在类前面引入use Exception use Except…
学习 2020-03-25 3656
-
webpack全局安装
npm install webpack -g npm install webpack-cli -g
学习 2020-03-04 2814
-
wordpress 5.3+版本 上传图片自动裁剪最大2560px
今天,上传图片发现,怎么名称自动加了个-scaled, 例如这样 000000005243e4ed89cae7dc3ed889dcc7db6eb198ff21a800000000-scaled.jpg 于是陷入了疑惑,于是把图片压缩小一点上传,则没有问题, 难道新版本问题,于是谷歌了一下, 找到了解决办法, 在函数文件functions.php,中加入以下代码,即可解决, add_filter( …
WordPress 2020-02-07 3054
-
WordPress 取当前页面URL地址
如果为一级目录,用这个 home_url(add_query_arg(array())); 如果不是一级目录,二级目录这样,则使用此方法 home_url(add_query_arg(array(),$wp->request));
学习 2019-10-18 2705
-
element-ui vue router 导航菜单刷新高亮
举例 我的资料 登录记录 js js里添加一个计算函数, computed:{ onRoutes(){ let path = this.$route.path.replace('/',''); return path ? path : '/'; } }
学习 2019-08-02 6159
-
v-on handler: “TypeError: dateObject.getTime is not a function”
elementUI时间组件从后台取回数据传入页面报错?? 因为,后台存进去的时候,是按照字符串存的,取回来也是按照字符串回来的,所以穿进去页面会报错,(这个原因我是猜的) 可以这样转换一下,this.data.birth为从后台取回的时间值 this.data.birth = new Date( this.data.birth).getTime() 前端界面显示 后端数据库显示,就是一个字符串
学习 2019-08-02 4448
-
wordpress 取当前分类ID最准确的一种
这是最准确的一种,不管分类下有没有文章都能显示出来 global $wp_query; $cat_ID = get_query_var('cat'); print_r( $cat_ID); 如果用get_the_category()命令取,如果分类下没有文章,则为空 如果用WordPress自带的$cat取,如果分类下没有文章,也是返回空
WordPress 2019-07-24 2850
-
error: src refspec develop does not match any. error: failed to push some refs
$ git push origin develop error: src refspec develop does not match any. error: failed to push some refs to 'https://******' 根据网上的方法,试了就是不行 以下之类命令 Git init Git add . Git commit -m 'xxxx' 突然注意到,我看到了,我本…
学习 2019-07-15 6657
-
WordPress 根据文章阅读量排序
使用WordPress query_posts 自带的 orderby 功能进行文章排序 例子 一般orderby是这么用的 常用参数一般常用的有: 我一般用rand多一点 ID 根据id排序 title 根据标题 date 发布日期 modified 修改日期 rand 随机 comment_count 评论数量 author 作者 name 按邮件名称排序 posts_per_page为显示的…
WordPress 2019-07-03 3668
-
React路由页面刷新404
nginx配置 跟vue的配置差不多, Vue路由页面刷新404问题:https://www.blyoo.com/2934.html server { ... location / { try_files $uri /index.html; } }
学习 2019-06-06 3856
-
lnmp1.5+配置thinkphp5.0+
如果已经添加过的站点,当时并没有选择Thinkphp伪静态 那么需要这么做 零 如果你来到这个页面,首先恭喜你,顺利掉进坑中,那么下面将带你如何爬出去 一 首先先站点conf配置里 原本默认是 include rewrite/none.conf; 改成下面 include rewrite/thinkphp.conf; 二 还是在站点conf里 默认是 include enable-php.conf…
学习 2019-06-06 3276
-
React-Native ERROR: JAVA_HOME is not set and no ‘java’ command could be found in your PATH.
ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation. error Could not in…
学习 2019-06-01 9720
-
antd 时间组件DatePicker获取时间
antd 选择日期的控件DatePicker是输出的时间对象 可以通过moment获取 首先安装moment npm install moment 引入moment 引入moment import moment from 'moment'; 使用moment time为取得表单里时间值 时间戳 moment(time).unix() //123456789 输出大众格式 moment(time).…
学习 2019-05-18 1w