From 662620e3ead7ed00d3d1bbb3579e7a14f0b19b20 Mon Sep 17 00:00:00 2001 From: wt Date: Thu, 25 Sep 2025 14:38:11 +0800 Subject: [PATCH] init --- pages/login/index.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pages/login/index.js b/pages/login/index.js index 040b13a..68f128d 100644 --- a/pages/login/index.js +++ b/pages/login/index.js @@ -1,4 +1,7 @@ // pages/login/index.js +import { + api +} from '../../utils/api.js' Page({ /** @@ -29,6 +32,21 @@ Page({ return } console.log(e); + const data = {code:e.detail.code} + + api("/auth/getPhone", 'GET', data).then(res => { + wx.hideLoading() + if (res.code === 200) { + wx.setStorageSync('user', res.data) + wx.setStorageSync('token', res.data.token) + wx.navigateBack() + } else { + wx.showToast({ + icon: 'error', + title: res.msg + }) + } + }) }, change(e){ const tmp = this.data.checked === false