-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from punky-lab/yhy-ui
Yhy UI
- Loading branch information
Showing
3 changed files
with
51 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,17 +71,17 @@ export default function Init({ | |
}; | ||
|
||
const autoLogin = async () => { | ||
try { | ||
const response = await authApis.login({ | ||
username: "[email protected]", | ||
password: "password" | ||
}); | ||
const { access_token, refresh_token } = response.data.data; | ||
localStorage.setItem('token', access_token); | ||
localStorage.setItem('refresh_token', refresh_token); | ||
} catch (error) { | ||
console.error('自动登录失败:', error); | ||
} | ||
// try { | ||
// const response = await authApis.login({ | ||
// username: "[email protected]", | ||
// password: "password" | ||
// }); | ||
// const { access_token, refresh_token } = response.data.data; | ||
// localStorage.setItem('token', access_token); | ||
// localStorage.setItem('refresh_token', refresh_token); | ||
// } catch (error) { | ||
// console.error('自动登录失败:', error); | ||
// } | ||
}; | ||
|
||
const fetchUserData = async () => { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters