In the process of developing small programs using the "apifm-wxapi" module, many users may encounter many problems;
_Unable to get openid_
_The current login token is invalid, please log in again_
# Solution
## View system logs to troubleshoot errors

If there is an error message here, give priority to troubleshooting based on the information here, for example:
```latex
Unable to obtain openid, code(043GXZZv3nuMqZ2RX34w3LVL4r2GXZZy), the interface returns ({"errcode":40164,"errmsg":"invalid ip 139.196.253.167 ipv6::ffff:139.196.253.167, not in whitelist, rid: 635115cc-49d9f49b-2d1df27a"})
```
That means you have set up an IP whitelist, but you have not added the server IP of the "apifm" to it.
So you either need to cancel the whitelist setting; or add the server IP of “apifm”:
```latex
106.14.43.122; 106.15.66.205; 139.196.253.167; 121.36.243.129; 47.103.1.124; 139.196.174.85 ;103.88.32.13;103.88.32.128;110.42.39.111
```
## Set up IP whitelist

## When initializing "apifm-wxapi", did you configure your exclusive domain name correctly?
+
```javascript
WXAPI.init('gooking')
```
**This code must be written in the onLoad method of the mini program js file! Don't put it on your head! **
The “gooking” here must be your own exclusive domain name
["Register for free to open the backend and obtain an exclusive domain name"](https://www.yuque.com/apifm/doc/qr6l4m)
## Is the api secure domain name set?
> You can set the API security domain name not to be verified on the development tool
>
You can refer to the domain name setting chapter of this article:
["Use "apifm-wxapi" to quickly develop small programs"](https://www.yuque.com/apifm/doc/mdldsd)
> If it is officially launched, please refer to the following article to set it up.
>
["How to set the legal server domain name of WeChat Mini Program? 》](https://www.yuque.com/apifm/doc/tvpou9)
## Make sure that the appids in the following three places must be consistent
- Log in to your mini program merchant backend ([https://mp.weixin.qq.com](https://mp.weixin.qq.com/)) and select the appid in the left menu "Development" --> "Development Settings"
- Click "Details" in the upper right corner of your mini program development tool --> appid in "Basic Information"
- Log in to your apifm backend ([https://admin.it120.cc](https://admin.it120.cc/)), and select the appid in the WeChat settings on the left menu
## code reuse
Code can only be used once. Do not use the same code in login and registration logic. The code will become invalid after being used once. If the same code is used multiple times, problems will occur:
["Temporary login credential code can only be used once"](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/login.html)
## Recompile the applet
