Rewriting error handling in the format request of the Laravel framework

The default validate validation in the laravel framework returns to the previous page by default when handling errors, and only returns to Json when it is ajax. If we want to return Json all the time, we need to override error handling As follows: only create a new BaseRequest class in the Requests directory The code is as follows <?php /* ...

Posted on Sun, 01 Dec 2019 12:19:40 -0500 by Kevmaster

Example code for wechat applet to achieve the effect of small on both sides and large in the middle

No verbosity, just go to the code `imgUrls: [` `{` `url:` `'[http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg](http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg)'``,` `isChange:1,` `},` `{` `url:` `'[http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg](http://img06.tooopen.com/image ...

Posted on Sun, 01 Dec 2019 10:06:10 -0500 by MarineX69

The interface technology of decrypting the domain name of wechat

At this stage, wechat promotion is the fastest way to spread information. What we see most is to put wechat QR code on the poster, so that the people we see can immediately understand their products. However, since wechat officials want to maintain a green environment, they have a very strict review on the code scanning promotion. Although the ...

Posted on Sun, 01 Dec 2019 05:13:54 -0500 by r2ks

Summary of extended functions in Kotlin

In java, we will define some tool classes to extend the methods of some classes, as follows: public class Utils { public static boolean isEmpty(String[] args){ return args == null || args.length == 0; } public static boolean isNotEmpty(String[] args){ return args.length > 0; } } public clas ...

Posted on Sat, 30 Nov 2019 23:06:49 -0500 by d0rr

springboot+aop + custom annotation to create general global exception handling and parameter verification

I. introduce corresponding maven dependency <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <optiona ...

Posted on Sat, 30 Nov 2019 10:15:40 -0500 by Bourgeois

Generation of QR code by qrcode

After QR code.js was used to generate QR code recently, it was found that the wechat pages of Xiaomi and Huawei mobile phones could not be identified by long press. Apple and other mobile browsers are normal. qrcode will generate a canvas tag and an img tag in the page generation. When debugging on the computer browser, it is found that the can ...

Posted on Sat, 30 Nov 2019 04:22:50 -0500 by copernic67

Vue developing WeChat H5 public address

I. set up wechat payment Open H5 webpage in wechat browser to perform JS call up payment. The built-in object of WeixinJSBridge is invalid in other browsers. Refer to official documents for details: https://pay.weixin.qq.com/wik... (1) general process: (2) call code example: mounted(){ if (typeof WeixinJSBridge == "undefined") { ...

Posted on Fri, 29 Nov 2019 13:12:57 -0500 by kachurak

A way to export pdf freemark+itext

A way to export pdf freemark+itext Because pdf is not editable, it cannot be directly filled in the template like excel when exporting, so it needs to fill in the data before the template is generated. The following way is to use html to pdf,freemark can be used as html template, itext can generate pdf, which can solve the bas ...

Posted on Fri, 29 Nov 2019 12:22:29 -0500 by angelcool

Gaode train number sequence

Gaode train number sequence Recently, I met an interview question about train number processing. The original question is as follows: Please write the code in your familiar editor or IDE and use the screenshot tool to capture the wechat and send it to me (Note: do not take photos of mobile phones) /* Implement the function pa ...

Posted on Fri, 29 Nov 2019 09:54:58 -0500 by ppgpilot

The complete code of checking whether the mobile device is in php

When making a web page, you need to get whether the current device to open the web page is the browser of PC or the browser of mobile device, and then make the page display appropriate content for different devices; For this demand scenario, I think there are three ways to achieve it: Method 1: through css; Method 2, through js; Method 3: t ...

Posted on Fri, 29 Nov 2019 09:23:59 -0500 by rline101