Considering that the platform has talked so much about how to upload files, it’s not going to work.

This feature is actually important because we will continue to improve the interface request, and many POST requests can carry files because of the principle and difficulty of this aspect. So let’s start with a user profile picture setting.

So where’s a good place to put this head? Of course, with the login user’s name is good, so where does this set go? The public menu in welcome.html is definitely better. This way we can see every page when we open the menu.

Ok, let’s go to welcome.html and pick a good place:

The search box at the top of the third party menu is not useful, so you can turn it off and change it to false.

And then it’s gone

Then we create a div at the top to hold the username and avatar

Pay attention to the position, must be within the nav, to display oh ~

Now here’s the problem. We’re going to show this username, but we don’t seem to have it in the background yet, so we’re going to go to the home function in the background and add:

That’s fine, but what about a different page? For example, the list of projects, we notice that the name is missing again,

So we have to add this username to the end of almost any function that returns welcome.html, and then the user’s avatar. This is too much trouble.

So we can make a common dictionary, and then we add that dictionary after every function by default. It’s all copy and paste anyway. After that, any public parameters can be put in the public dictionary

This function that gets the public parameters, passes in request, returns this dictionary of user names, and then we can add a bunch of other things to this complicated function.

So how do we install it into any other function that returns the front page?

All you have to do is write it like this, and notice, a really sexy way to write it is:

** Glodict (request) just pop this into our original dictionary.

Then add to all functions:

Then let’s test it:

Okay, now you should have all the pages. This public parameter function is done.

This time continuously updates the next section, personal profile picture Settings.

As for various design and writing, in fact, many students all say I am pretty good solutions and ideas, these are not born with, only you need to brush the algorithm problems more, brush, you will find that our thinking is very flexible, open various functions can be implemented, as long as want and can use the method of all kinds of waves can’t fix.

Welcome to continue to pay attention and share ~ also welcome to talk about cooperation with other partners to promote each other oh ~