1. Vue parameter passing methods and differences

1. Query can be imported with name or path. Params can only be imported with name. When passing parameters using the params method, you need to add the parameter name after the route, otherwise the parameters will be lost when refreshing the page. The reason is that when passing parameters with Params, the parameters are passed as part of the URL path; Query passes parameters that are spliced after the URL and are not lost when refreshed.Copy the code

Query the participation

Params mass participation

What is symmetric encryption

The use of the same key in both encryption and decryption is called symmetric encryption

The encryption process is as follows:

Plaintext + encryption algorithm + private key => CiphertextCopy the code

The decryption process is as follows:

Ciphertext + decryption algorithm + private key => plaintextCopy the code

3. How to implement encryption parameters in VUE

1. Install the crypto – js

NPM I crypto-js-save-dev crypto-js is a pure javascript written encryption algorithm library, we can use AES, DES, RC4 encryption methods or MD5,SHA hash hash.Copy the code

2. Define the default key and the current key

3. Define the encryption algorithm

4. Define the decryption algorithm

5. Query uses an encryption algorithm

6. Call the decryption algorithm to obtain parameters

Verify that the parameter is encrypted, the decryption is successful, and the data is obtained