vue upload image to base64, binary array, save encoded data to file

functional requirement 1. Picture to base64 2.base 64 to binary array 3. Save binary data to file and download to local resolvent Question 1: reference material vue element upload picture to base64 Specific code getBase64(file) { return new Promise(function (resolve, reject) { let reader = new FileReader(); let imgResu ...

Added by error_22 on Fri, 29 May 2020 17:49:11 +0300

Hegel: aspire to be the best JavaScript static type checker

Yunqi information:[ Click to see more industry information]Here you can find the first-hand cloud information of different industries. What are you waiting for? Come on! As a rookie in JavaScript type checker, Hegel aspires to be the best JavaScript static type checker. It claims to provide a reliable type system with strong type inference. At ...

Added by drakal30 on Fri, 29 May 2020 09:31:34 +0300

PHP and Thinkphp simulated message board to deal with XSS attack (super complete!)

XSS attack principle and protection brief introduction XSS(Cross Site Scripting) is a common way in Web attacks. Through this attack, users can be controlled to do a series of malicious operations, such as stealing, tampering, adding users' data or inducing to phishing sites. Attack principle A common way is to use unfiltered parameters to pass ...

Added by Nothsa on Thu, 28 May 2020 07:50:18 +0300

JS Array Method Complete

  1. Before using the methods of arrays, you need to create arrays, which can be created in the following ways: Literal Quantity (json) var arr1 = []; //Create an empty array var arr2 = [5]; //Create an array with a single element var arr3 = [5,6,7]; //Create an array with multiple element ...

Added by gprobst on Tue, 26 May 2020 20:21:46 +0300

ReactHook Quick Boarding

React16.8 started with 10 Hook s built in, with two cores: State Management: useState Side effects management: useEffect Stateful functions useState Stateful Component Writing: class Example extends React.Component { constructor(props) { super(props); this.state = { count: 0 }; } render() { return ( ...

Added by silverphpd on Mon, 25 May 2020 19:53:17 +0300

Random random number function in stylus

Write in front Like Sass, Stylus is an excellent CSS precompiled voice: expressive, dynamic and powerful CSS; When using Stylus to write the following effect, I need to use random numbers. However, when I read Stylus's documents, I did not find any available functions. After reading the new year's day of Stylus, I found that it supp ...

Added by Adam W on Mon, 25 May 2020 17:45:04 +0300

One minute to solve the problem of 32-bit floating-point precision loss of WebGL shader in map development

The following content is reproduced from the article "WebGL shader 32-bit floating-point precision loss" of wood tree Author: tree of wood Link: https://www.cnblogs.com/dojo-lzz/p/11250327.html Source: blog Park The copyright belongs to the author. For commercial reprint, please contact the author for authorization. For non-commercia ...

Added by LMarie on Fri, 22 May 2020 08:46:32 +0300

eggjs Learning Notes Day 35: Simple Logic for Background Login Authentication

1. After getting the user name, password and authentication code in the background: (1) Get the data submitted by the form (2) Determine whether the verification code is correct or not If the verification code is correct: 1. Encrypt the password in the form by MD5 MD5 moduleHttps://www.npmjs.com/package/md5 1,install cnpm install md5 --sav ...

Added by jjoves on Wed, 20 May 2020 20:28:13 +0300

VUE Array Update

1. Classification of data methods: (1) Changes in the original array push pop unshift shift reverse sort splice (2) The original array remains unchanged, resulting in a new array slice concat filter For methods that change the original array, you can ...

Added by mwilson on Wed, 20 May 2020 19:32:21 +0300

Eggjs learning notes day 34: eggjs post management login and background permission judgment

1, Login verification. You can't access other pages without login. Judge whether the user has logged in, and use the middleware in the egg. New middleware folder under app, new adminauth.js File, type: var url = require("url"); module.exports = options => { return async function adminauth(ctx, next) { // 1. The user does not log ...

Added by Far Cry on Wed, 20 May 2020 18:13:33 +0300