Member login may look like just “placing a login button,” but it actually has three paths: WeChat QR code login, Official Account authorization within WeChat, and phone number binding after authorization. The AppID, callback URL, and toggle differ for each of the three paths, and misconfiguration produces very similar symptoms—the button does not appear, or the user is continually asked to bind after authorization.

KingCMS X1 AI 助手示例
The /member/login page and member center are available on the front end only after the member module is enabled.

1. Enablement and Entry Points

After the member module is enabled, a “Members” menu appears on the left, and the login and member center pages become available on the front end. Login methods are under “Settings → Members & Login → Login Methods” (/admin/settings/member/login-methods); click “Show Advanced Settings” first for this section to appear.

2. WeChat QR Code Login (Open Platform Website App)

QR code login uses the “Website App” of the WeChat Open Platform and requires the app’s AppID and AppSecret—this is not the same as the WeChat Pay AppID. The callback URL is automatically generated from the site URL under “Site Basics,” in the form https://<域名>/member/callback/wechat; the admin callback is /admin/wechat/callback. Before use, register the callback domain on the Open Platform; the site must use HTTPS.

Once configuration is complete, “WeChat QR Code Login” appears on the admin login page, and “WeChat Binding” appears on the change-password page; the member login page also requires the “WeChat Login” toggle to be turned on before the member QR code button appears. If either parameter is cleared, the QR code entry points for both members and admins are hidden; if only the toggle is turned off, the member button is hidden while admin QR code login remains available; saved bindings are not lost.

3. Official Account Web Authorization (Inside the WeChat Browser)

This path uses the Official Account’s AppID and AppSecret, which must match the WeChat Pay AppID. When both fields are non-empty, opening /member/login in the WeChat browser automatically initiates web authorization instead of showing the QR code page. You must first set the site domain as a “Web Authorization Domain” on the Official Account Platform; the callback URL is https://<域名>/member/wechat/oa/callback. It is not shown in the admin panel, so you need to register it yourself.

KingCMS X1 商品详情页示例
After logging in, members can enjoy member pricing, the address book, and order claiming.

4. Phone Number Binding

After Official Account authorization, the first login attempts to save the WeChat nickname and avatar, with the phone number left empty. The “Bind Phone Number” page appears in the following cases: the WeChat account has no corresponding member, and the unionid also does not match any member. Enter an 11-digit mainland China mobile number and confirm to log in. The rules are:

  • The number already belongs to a member: bind the current WeChat account to that member; if multiple members share the number, use the earliest-created one;
  • The number is not registered: create a new member, take the nickname and avatar from the WeChat profile, and write the entered number into the phone number field;
  • If the format is incorrect, show “Please enter a valid 11-digit mobile number”; if the WeChat account is already bound to another member, reject it;
  • Phone number binding does not send an SMS verification code and does not verify number ownership; it only matches by the number text.

5. Sessions and Account Profile

Member sessions are valid for 12 hours, with the cookie name kc_member, and do not affect admin sessions; scanning again in the same browser invalidates the old session. All account profile fields are optional; the phone number must be 11 digits starting with 1[3-9], and email is only format-validated. A maximum of 50 shipping addresses is allowed; orders save a snapshot at checkout, so later address changes do not affect historical orders.

6. Order Claiming

Orders can be placed without logging in. The payment page shows “Add to My Account” when all of the following conditions are met: the order is still pending payment, it is not yet associated with a member, the current member has a phone number, and the member’s phone number exactly matches the order contact phone number. An order cannot be claimed after payment is completed or the order is canceled.

7. Common Pitfalls

  1. The QR code button does not appear: check whether the Open Platform AppID/Secret is complete and whether the WeChat toggle on the member login page is enabled;
  2. WeChat keeps asking to bind: Official Account web authorization is not configured properly, or the WeChat account truly has no corresponding member;
  3. Callback error: confirm that the site URL uses HTTPS and that the callback domain registered on the Open Platform/Official Account Platform matches the site;
  4. Login status expired prompt: the authorization state has expired or does not match; just initiate authorization again;
  5. Member disabled: show “This member has been disabled” and do not create a session.

Summary

QR code login uses the Open Platform, while in-WeChat login uses Official Account authorization; the two have different AppIDs and callbacks. Phone number binding is required only when authorization does not match a corresponding member. Troubleshooting these three parts separately is more effective than staring at the login button.