Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fetch(`${keys.api}/login`,
- {
- method: 'POST',
- body: JSON.stringify({
- username: this.state.username,
- password: this.state.password,
- }),
- headers: {
- 'Accept': 'application/json',
- 'Content-Type': 'application/json',
- },
- }
- ).then((response) => {
- if(response._bodyText == 'success') {
- this.props.resetToRoute({
- name: '主页',
- component: Main,
- hideNavigationBar: true,
- });
- } else {
- this.cancelLogin();
- }
- }).catch((error) => {
- console.warn(error);
- this.cancelLogin();
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement