Commit b5d0e140 authored by duanjinfei's avatar duanjinfei

update document

parent 9eae5efd
...@@ -6,7 +6,7 @@ createdAt: Thu Jul 18 2024 05:56:40 GMT+0000 (Coordinated Universal Time) ...@@ -6,7 +6,7 @@ createdAt: Thu Jul 18 2024 05:56:40 GMT+0000 (Coordinated Universal Time)
updatedAt: Fri Jul 19 2024 03:50:33 GMT+0000 (Coordinated Universal Time) updatedAt: Fri Jul 19 2024 03:50:33 GMT+0000 (Coordinated Universal Time)
--- ---
# AON Developer Documentation: Get User Account Function # Get User Account Function
This documentation provides a detailed explanation of the `getAccount` function, which handles user account retrieval, login authentication, and interaction with the Ethereum provider. It includes asynchronous operations to ensure smooth and non-blocking user experience. This documentation provides a detailed explanation of the `getAccount` function, which handles user account retrieval, login authentication, and interaction with the Ethereum provider. It includes asynchronous operations to ensure smooth and non-blocking user experience.
...@@ -50,10 +50,11 @@ async function getAccount() { ...@@ -50,10 +50,11 @@ async function getAccount() {
}); });
} else { } else {
// If user is already logged in, interact with Ethereum provider to get account // If user is already logged in, interact with Ethereum provider to get account
let ethereum = await detectEthereumProvider(); let account = await user.getAccount();
let get_account = await ethereum.request({ method: 'eth_requestAccounts' }); console.log("getWeb3 account", account);
get_account = get_account[0]; let userId = await user.getUserId();
account.value = get_account; console.log("getWeb3 userId", userId);
account.value = account;
// Emit event after retrieving the account // Emit event after retrieving the account
bus.emit('get_balance', "login"); bus.emit('get_balance', "login");
......
...@@ -6,7 +6,7 @@ createdAt: Fri Jul 19 2024 03:45:40 GMT+0000 (Coordinated Universal Time) ...@@ -6,7 +6,7 @@ createdAt: Fri Jul 19 2024 03:45:40 GMT+0000 (Coordinated Universal Time)
updatedAt: Fri Jul 19 2024 03:56:00 GMT+0000 (Coordinated Universal Time) updatedAt: Fri Jul 19 2024 03:56:00 GMT+0000 (Coordinated Universal Time)
--- ---
# AON Developer Documentation: User Login Function # User Login Function
This documentation provides a detailed explanation of the `login` function, which handles user login in an asynchronous manner, including checks for user authentication, showing loading indicators, and emitting events upon successful login. This documentation provides a detailed explanation of the `login` function, which handles user login in an asynchronous manner, including checks for user authentication, showing loading indicators, and emitting events upon successful login.
......
...@@ -69,7 +69,7 @@ const config = { ...@@ -69,7 +69,7 @@ const config = {
}, },
items: [ items: [
{ {
href: "https://aigic.ai/playground", href: "https://aonet.ai/playground",
label: "Built with AON", label: "Built with AON",
position: "right", position: "right",
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment