First of all, the uploaded pictures must be marked with which user uploaded them. This can be stored in the database. In fact, you can write a middleware for accessing images. Before actually accessing the image, you can determine whether the image belongs to the current accessing user, and then provide different processing
First of all, you can only view the pictures you uploaded. What is the difference between it and the photo album? You create a table and save the user and attributes corresponding to the image Then use the middleware to determine whether the user this image belongs to is the current logged-in user
When you click on the picture, you will definitely get the picture ID or something, and then check the user ID and compare it with the currently logged-in user. If it is inconsistent, just return false!
First of all, the uploaded pictures must be marked with which user uploaded them. This can be stored in the database.
In fact, you can write a middleware for accessing images. Before actually accessing the image, you can determine whether the image belongs to the current accessing user, and then provide different processing
Record the user who the picture belongs to
Judge before accessing. Add middleware to the controller that accesses the image.
First of all, you can only view the pictures you uploaded. What is the difference between it and the photo album?
You create a table and save the user and attributes corresponding to the image
Then use the middleware to determine whether the user this image belongs to is the current logged-in user
When you click on the picture, you will definitely get the picture ID or something, and then check the user ID and compare it with the currently logged-in user. If it is inconsistent, just return false!