Food Ordering Mini Program Practical Tutorial 02 User Registration

According to our needs analysis, this article begins with us entering the specific development part. The basis of low-code development is to first create a data source. In this article, we introduce the user registration function. First, we need to create a data source to store user information.

1 User classification

Beginners who have never used low-code tools may not know much about low-code user classification. In low-code, users are generally divided into two categories, internal users and external users. For details, please refer to the user menu of the console.
Insert image description here
Internal users here generally refer to users within the enterprise, such as employees of the enterprise. External users refer to users who need to access enterprise applications from outside, such as the enterprise's suppliers, customers, upstream and downstream partners, etc.

Usually the registration of internal users requires super administrators to maintain it. So who is the super administrator of WeChat? Generally, if you scan the QR code to log in to the console, the user will be the super administrator by default.

For external users, users can register independently. During registration, we can build a custom user table to manage external user information.

2 User login

After sorting out the user categories, the next concept that needs to be clarified is user login. There are two different types: internal user login and external user login.

Because internal users need to supervise registration and password management, they need to use a dedicated enterprise workbench to log in. The enterprise workbench is similar to the enterprise OA system we often use. After logging in, various business processes can be initiated.

Insert image description here
When external users log in, beginners who don't understand low-code development usually create a login page as soon as they come up, and then enter their username and password to log in. There is nothing wrong with this approach in terms of inertial thinking, but it is usually not advisable.

The reason is that if you create a login interface by yourself, the password will be transmitted in clear text first, and the clear text password will also be stored in the database, which itself has security problems.

WeChat provides a login method for external users, which can be selected in the identity source section.
Insert image description here
Why don't we use a username and password to create our own login method? Because WeChat logs in anonymously by default, as long as you access the mini program without inputting anything, you are actually logged in. If you do not want users to access the Mini Program interface as soon as it is opened, you can enable login in the application

Insert image description here

3 Create user information data source

After understanding how to implement user login in WeChat, we create a data source to save user information. Open the console, click on the data source, click on the + sign to create a data source.
Insert image description here
Enter the name of the data source, user management, and click on the Create button to complete the creation of the
Insert image description here
data source. After the data source is created, we need to add fields to the data source. Click Edit to enter field addition. View
Insert image description here
Click to add a field and add the first field first. We add the user name and select text as the type. For the
Insert image description here
second field we add gender and select enumeration as the type.
Insert image description here
Click Create Now. We want to create a new enumeration item. We have two values ​​to choose from. They are male and female.
Insert image description here
In the third field, add a phone number, and select phone number as the type.
Insert image description here
In the fourth field, we need to obtain the user’s identity information. We have several roles, including cashier, kitchen, delivery person, customer, and administrator. For information, we also use enumeration types and enter specific enumeration values.
Insert image description here
Insert image description here
We also need to know the registration information of WeChat. Everyone in WeChat has an identity called openid, and then register an openid field. The type selects the text. Finally,
Insert image description here
we need a status. To manage user information, the type is enumeration, and the values ​​are pending review, review passed, and review failed.
Insert image description here
Insert image description here

Summarize

In this article, we introduce the types of users in low-code, user login and the data source for creating users. The basis of function development is to first create the data source, and then select the specifically required fields and field types based on the actual business.

Guess you like

Origin blog.csdn.net/u012877217/article/details/133457632