From 6a38b7e1fe22bcebd69d97a1671f3d5e89b41f5f Mon Sep 17 00:00:00 2001 From: xuechunyuan <17853500702@163.com> Date: Tue, 22 Aug 2023 13:47:11 +0800 Subject: [PATCH] =?UTF-8?q?token=E8=8E=B7=E5=8F=96=EF=BC=8C=E4=B8=8B?= =?UTF-8?q?=E5=8D=95=E6=8E=A5=E5=8F=A3=EF=BC=8C=E5=95=86=E5=93=81=E5=B0=81?= =?UTF-8?q?=E9=9D=A2=E6=8B=89=E5=8F=96=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 33 +++++++ pages.json | 16 ++++ pages/pages_zhentou/contact/contact.vue | 84 +++++++++++++++++ pages/pages_zhentou/homePage/homePage.vue | 105 +++++++++++++++++++--- pages/pages_zhentou/myPage/myPage.vue | 2 +- static/image/logo.png | Bin 0 -> 22154 bytes 6 files changed, 225 insertions(+), 15 deletions(-) create mode 100644 pages/pages_zhentou/contact/contact.vue create mode 100644 static/image/logo.png diff --git a/App.vue b/App.vue index a412bfb..a1e7a22 100644 --- a/App.vue +++ b/App.vue @@ -74,6 +74,7 @@ if (res.data.code == 200) { uni.setStorageSync('userInfo', JSON.stringify(res.data.data)); uni.setStorageSync('phone', res.data.data.phone); + this.doLogin(res.data.data.username, res.data.data.phone); } else { uni.showToast({ title: res.data.msg, @@ -83,6 +84,38 @@ } }) }, + //登录 + doLogin(username, phone) { + uni.showLoading({ + title: '登录中', + mask: true + }); + uni.request({ + url: this.globalData.baseUrl + '/blade-auth/getToken', + method: 'POST', + data: { + openId: this.globalData.openId, + username: username, + phone: phone + }, + header: { + 'Authorization': 'Basic c2FiZXI6c2FiZXJfc2VjcmV0' + }, + success: (res) => { + if (res.data.code == 200) { + uni.setStorageSync('token', res.data.data.access_token); + } else { + uni.showToast({ + title: res.data.msg, + icon: 'none' + }) + } + }, + complete: () => { + uni.hideLoading(); + } + }) + }, //微信登陆 wxLogin() { uni.login({ diff --git a/pages.json b/pages.json index 094db33..e7e1a72 100644 --- a/pages.json +++ b/pages.json @@ -126,6 +126,22 @@ } } } + }, + { + "path": "pages/pages_zhentou/contact/contact", + "style": { + "navigationBarTitleText": "售后服务", + "app-plus": { + "titleNView": { + // "buttons": [{ + // "text": "\ue534", + // "fontSrc": "/static/uni.ttf", + // "fontSize": "22px", + // "color": "#FFFFFF" + // }] + } + } + } } ], // "subPackages": [{ diff --git a/pages/pages_zhentou/contact/contact.vue b/pages/pages_zhentou/contact/contact.vue new file mode 100644 index 0000000..8573096 --- /dev/null +++ b/pages/pages_zhentou/contact/contact.vue @@ -0,0 +1,84 @@ + + + + + \ No newline at end of file diff --git a/pages/pages_zhentou/homePage/homePage.vue b/pages/pages_zhentou/homePage/homePage.vue index d5fa7b8..e357d60 100644 --- a/pages/pages_zhentou/homePage/homePage.vue +++ b/pages/pages_zhentou/homePage/homePage.vue @@ -1,7 +1,7 @@