|
@@ -15,9 +15,19 @@
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<script setup>
|
|
<script setup>
|
|
|
|
|
+ import { l_setItem, l_removeItem } from "@/utils/storage";
|
|
|
|
|
+ import { useRouter } from "vue-router";
|
|
|
|
|
+
|
|
|
|
|
+ const router = useRouter();
|
|
|
|
|
+
|
|
|
const sure = async () => {
|
|
const sure = async () => {
|
|
|
const accounts = await ethereum.request({ method: "eth_requestAccounts" });
|
|
const accounts = await ethereum.request({ method: "eth_requestAccounts" });
|
|
|
- console.log(1, accounts);
|
|
|
|
|
|
|
+ const address = accounts[0];
|
|
|
|
|
+
|
|
|
|
|
+ if (address) {
|
|
|
|
|
+ l_setItem("address", address);
|
|
|
|
|
+ router.push("/");
|
|
|
|
|
+ }
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|
|
|
<style lang="less" scoped>
|
|
<style lang="less" scoped>
|