From d8ad0c1805b0701afadd069c79950edde490d5c9 Mon Sep 17 00:00:00 2001
From: xuxueyang <xuxy@fengyuntec.com>
Date: 星期一, 08 七月 2024 17:17:16 +0800
Subject: [PATCH] update 花店小程序
---
store/index.js | 38 +++++++++++++++++++++++++++++++++++++-
1 files changed, 37 insertions(+), 1 deletions(-)
diff --git a/store/index.js b/store/index.js
index e2d564a..edf7a1b 100644
--- a/store/index.js
+++ b/store/index.js
@@ -392,7 +392,43 @@
return resp
}
- }
+ },
+
+ loginCustomer:async function({
+ commit,
+ dispatch,
+ state
+ }, data) {
+ {
+ const resp = await http.request('post', '/api/login/customer' + (data
+ .phoneNumber ? '/phone' : ''), {
+ data: {
+ username: data.username,
+ password: data.password,
+ tel: data.phoneNumber || data.tel,
+ smsCode: data.smsCode || ''
+ },
+ params: {
+ clientType: data.clientType || 'app'
+ }
+ })
+ console.log('resp', resp)
+ if (resp && resp.code == 0) {
+ storage.setItem('token', resp.data.access_token)
+ commit("updateLogin", true)
+ await dispatch('getCurrentInfo')
+ uni.reLaunch({
+ url: '/pages/home/home'
+ })
+ } else {
+
+
+ }
+ return resp
+ }
+
+ },
+
}
})
--
Gitblit v1.9.3