Eggjs Learning Notes Day 33: eggjs creates a base class base.js controller, configures session, and creates a tool.js service (svg-captcha verification code)

1. Create base classes. The role of base classes: for example, login success and failure, administrator new edit success and failure, role new edit success and failure, there are success callbacks and failure callbacks, such as showing a successful information failure, these things are common.So encapsulated with base classes, other classes ca ...

Posted on Mon, 18 May 2020 09:53:22 -0700 by wkerplunk

Encapsulating the Promise version of readFile

Write in front We all know that there are two types of file reading fs.readFileSync(); / / read synchronously fs.readFile(); / / asynchronous read Copy code Promise is a solution of asynchronous programming. Can we encapsulate a promise version of readFile? Intron Let's take a look at teacher Ruan Yifeng's explanation that javascript is ...

Posted on Sun, 17 May 2020 17:41:03 -0700 by wes007

jquery seamless rotation

Idea: first, static layout, setting a variable as the subscript, using jquery's selector to get all the li clicked, get the width, Then write the encapsulation function on the next page (subscript + +, judge whether it is the last one according to the current subscript, (do some animation effects, stop the animation onc ...

Posted on Sat, 16 May 2020 08:43:44 -0700 by SoireeExtreme

Simple implementation of jQuery tool method $.Callbacks()

Simple implementation of the jQuery tool method $.Callbacks(): (function () { //Create a jQuery Constructor function jQuery(selector) { return new jQuery.prototype.init(selector); } //by jQuery Prototype addition init Property that all instances can use jQuery.prototype.init = function (selector) { this.len ...

Posted on Fri, 15 May 2020 10:10:10 -0700 by zerogreen

Package component El upload: upload a single picture through v-model

The El upload image in the element UI has been encapsulated twice. (by default, everyone has a certain vue foundation, and there are only a few details.) In the project, we mainly get pictures or other parameters. Here is the Guid returned after uploading So I have concentrated on the upload actions, such as the input v-model to get the param ...

Posted on Fri, 15 May 2020 07:12:18 -0700 by Phoenix~Fire

[Front End Development Example] HTML CSS - WeChat Suspended Guided Concern - (6)

Question.Question The first page of WeChat Shop produces a two-dimensional code to guide the attention of public numbers, which can play a very important role in the drainage of public numbers.In general, two-dimensional codes in stores are pushed passively according to some logic, such as those who have not paid attention to the public numbe ...

Posted on Thu, 14 May 2020 10:08:14 -0700 by Canadiengland

babel version reason run error, solution

Problem encountered while learning babel, run error after installing with old version of Babel naming rule. Preliminary find reason is because there are compatibility problems between different versions of Babel preset and plugin, prompting that npx babel-upgrade can be upgraded automatically, but my upgrade failed, prompting parsing error, lat ...

Posted on Mon, 11 May 2020 11:17:00 -0700 by duckduckgoose

[outsourcing]! Use asp.net core to quickly build the background management system of small start-up companies (IV. quartz simple configuration and use)

The previous chapter introduces the simple configuration of log4net, this chapter introduces the simple use of quartz, the next chapter introduces my permission use, and then it ends This chapter mainly introduces: The use of quartz in asp.net core Although this project is small, it is easy to expand, and the business behind it can be dire ...

Posted on Sun, 10 May 2020 20:53:57 -0700 by 3r0ss

Java compress / obfuscate JavaScript code

Basically, they are all tools written by themselves to build front-end projects, and tools to compress / obfuscate JavaScript code are essential. We are Java platform, that is to say, using java to compress JS is more convenient. Although we can call special front-end building tools such as node externally, it's not easy. It can be done in the ...

Posted on Sun, 10 May 2020 04:54:43 -0700 by daijames

Handwritten new, call, apply, bind, reduce, currying, anti shake and throttle source code, with detailed analysis

These are mainly written for review and precipitation. In the process of re writing, I will also put forward my own understanding, and I hope to point out some inappropriate points. I recommend an online IDE here. I will use it when I type some code demo StackBlitz , which is easier to use, but it is recommended to update when saving instead o ...

Posted on Fri, 08 May 2020 23:00:55 -0700 by jponte