the URL of the question you asked is:
https://codeshelper.com/q/10.
this number should be used to indicate the ID of the problem. Can you learn to do it, too?
create a database table by yourself, store the shared ID, ID, and don't write it into URL. Uninstall hash
from=1010000015009732">https://codeshelper.com/q/?u.
then when the page loads, parsing URL, that does not have this value is deemed to have been shared, and if there is a value, request the server to check
so there is a unique identity ID? I don't know about this problem, mark.
if you just do this function in Wechat, you can use Wechat's jssdk, to get the currently logged-in user id, to judge according to id, but if you still need to share to other places, you may not be able to do so
Let the user enter the mobile phone number and get the verification code
can the user be a tourist or must he or she log in?
try assigning UUID to the user.
this problem has not been encountered, because when I do similar requirements, I have the authority to authenticate the service number. So I suggest you:
- confirm whether Subscription account has silent authorization permission? (this may require logging in to the background to check the list of existing permissions)
- if one of the above doesn't work, consider whether you can save the country through the unionID of the open platform. Because anyway, as long as you can get the unique ID of the same system, you can take either one.
- if neither of the above works, you have to check to see if there is a third-party service to obtain user information / OpenID.
I think it's a good way to input the mobile number verification code upstairs. After all, the mobile number is unique.
the authenticated number should be able to obtain the user's openid.
A lot of times you don't need to be so rigorous.
then, generate a unique identity for each user, then save it in the browser and save it through cookie or localStorage.
if you want to use Wechat's browser, you can get the openid of the user who currently enters the web page even if you don't pay attention to it. This is Wechat's web page authorization function:
Web authorization initiated with snsapi_base as scope is used to obtain the openid of the user entering the page, and is silently authorized and automatically redirected to the callback page. What the user perceives is to go directly to the callback page (often the business page)
if you share, call Wechat's jssdk, and add the current user's openid, to the shared link so that the user who clicks on the link later knows who shared it, so as to write the subsequent business code
.
of course you need a database or something to store the openid and other data