Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When the environment is switched, the problem of Token failure often occurs #4

Open
CodeXiaoMai opened this issue Sep 4, 2018 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@CodeXiaoMai
Copy link
Owner

When the environment is switched, the problem of Token failure often occurs, and it is troublesome to login again each time. Therefore, by adding the function of saving the username and password during Debug, you can automatically login again in the onEnvironmentChange callback.

@CodeXiaoMai CodeXiaoMai added the help wanted Extra attention is needed label Sep 4, 2018
@CodeXiaoMai
Copy link
Owner Author

If the re-requested interface needs token after the environment switch, you can request it after delaying the postDelay.

@Override
public void onEnvironmentChanged(ModuleBean module, EnvironmentBean oldEnvironment, EnvironmentBean newEnvironment) {
    long delayTime = 1500;
    handler.postDelayed(new Runnable() {
        @Override
        public void run() {
            // Send a request that requires a token parameter
        }
    }, delayTime);
}

@CodeXiaoMai CodeXiaoMai changed the title Save username and password when debugging When the environment is switched, the problem of Token failure often occurs Sep 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant