分类 成长之路 中的文章

golang http panic: runtime error: invalid memory address or nil pointer dereference

下面代码将报错,提示panic: runtime error: invalid memory address or nil pointer dereference resp, _ := http.Get(link.ImgUrl) defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) 正确的应是, defer resp.Body.Close() 应在 ioutil.ReadAll之后 resp, _ := http.Get(link.ImgUrl) body, _ := ioutil.ReadAll(resp.Body) defer resp.Body.Close() 菜鸟总结 0.0……

阅读全文

安卓手机在linux下刷入twrp第三方recovery

1 自行下载需要刷入的twrp.img文件 下载地址:https://twrp.me/Devices/ 2 安装adb fastboot sudo apt install adb sudo apt install fastboot 3 手机开启开发者模式,并连接电脑 4 依次运行下面命令即可 // 进入fastboot adb reboot bootloader // 刷入 twrp镜像,twrp-xxxx.img 替换为你自己的twrp镜……

阅读全文

golang 生态中不错的组件

觉得不错的Golang优秀组件。算是个人笔记吧,只有介绍,没有使用说明。 web 框架 Go的框架有很多很多,但至今还没有一款能和Spring媲美的神级框架出现。所以大神都是自己直接写,不用框架。这里介绍我用过的2个框架gin和beego,前者路由速度快,后者功能全。但还是我前面讲的那句话……

阅读全文

解决ueditor跨域上传文件失败的问题,

修改 ueditor.all.js第24507行的domUtils方法 https://gitee.com/cnbattle/codes/qlka2rozmutdf413n9c6j74 domUtils.on(input, 'change', function () { if (!input.value) return; var loadingId = 'loading_' + (+new Date()).toString(36); var params = utils.serializeParam(me.queryCommandValue('serverparam')) || ''; var imageActionUrl = me.getActionUrl(me.getOpt('imageActionName')); var allowFiles = me.getOpt('imageAllowFiles'); me.focus(); me.execCommand('inserthtml', '<img class="loadingclass" id="' + loadingId + '" src="' + me.options.themePath + me.options.theme + '/images/spacer.gif" title="' + (me.getLang('simpleupload.loading') || '') + '" >'); function callback(responseData) { try { if (responseData.state == 'SUCCESS' && responseData.url) { loader = me.document.getElementById(loadingId); loader.setAttribute('src', responseData.url); loader.setAttribute('_src', responseData.url); loader.setAttribute('title', responseData.title || ''); loader.setAttribute('alt', responseData.original || ''); loader.removeAttribute('id'); domUtils.removeClasses(loader, 'loadingclass'); } else { showErrorLoader && showErrorLoader(responseData.state); } } catch (er) { showErrorLoader && showErrorLoader(me.getLang('simpleupload.loadError')); } form.reset(); domUtils.un(iframe, 'load', callback); } function showErrorLoader(title)……

阅读全文

laravel5 join updated_at 冲突 列错误

使用->toBase()方法可解决,这个问题将在5.8版本中修复 Comment::where([ 'author_id' => $customer_id, 'scenes' => 'article' ]) ->join('xb_article', function ($join) { $join->on('xb_comment.scenes_id', '=', 'xb_article.id') ->whereNotNull('xb_article.deleted_at'); }) ->toBase() ->delete(); 参考链接:https://github.com/laravel/framework/issues/13909……

阅读全文

Git回滚代码到某个commit

回退命令: $ git reset --hard HEAD^ 回退到上个版本 $ git reset --hard HEAD~3 回退到前3次提交之前,以此类推,回退到n次提交之前 $ git reset --hard commit_id 退到/进到 指定commit的sha码 强推到远程: $ git push origin HEAD --force……

阅读全文

laravel lumen with 软删除的数据

重点:$query->withTrashed(); $info = self::with('userInfo', 'express.company') ->with(['product' => function ($query) { $query->withTrashed(); }]) ->where($where) ->select(['id', 'type', 'user_id', 'order_sn', 'membership_card_type', 'membership_card_id', 'membership_card_info', 'membership_card_offer_fee', 'coupon_id', 'coupon_info', 'coupon_offer_fee', 'original_price', 'delivery_fee', 'pay_type', 'price', 'remarks', 'status', 'extend_info', 'created_at']) ->orderBy('id', 'desc') ->first();……

阅读全文

最近文章

分类

标签

友情链接

其它