From a441fbd0f63ef8bb14205e9008b56a2b7d7dbbd6 Mon Sep 17 00:00:00 2001 From: PQZ Date: Wed, 28 Aug 2024 16:22:49 +0800 Subject: [PATCH] 1 --- config.js | 2 +- pages/login/loginSms.vue | 4 ++-- utils/request.js | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/config.js b/config.js index 53e10f7..60711e6 100644 --- a/config.js +++ b/config.js @@ -4,7 +4,7 @@ module.exports = { //baseUrl: 'https://www.nuoyunr.com/jx', imagesUrl: 'https://www.nuoyunr.com/jx', - baseUrl: 'http://192.168.31.54:8016/jx', + baseUrl: 'http://localhost:48080', // imagesUrl: 'http://192.168.31.54:8016/jx', // 应用信息 appInfo: { diff --git a/pages/login/loginSms.vue b/pages/login/loginSms.vue index 2350138..3fa0bc6 100644 --- a/pages/login/loginSms.vue +++ b/pages/login/loginSms.vue @@ -148,8 +148,8 @@ method: 'post', data: this.appuser }).then((res) => { - if (res.code == 200) { - uni.setStorageSync("App-Token", res.token) + if (res.code == 0) { + uni.setStorageSync("App-Token", res.data.token) uni.setStorageSync("loginType", this.tabindex) if (this.tabindex == 0) { diff --git a/utils/request.js b/utils/request.js index a6176ec..0154bd7 100644 --- a/utils/request.js +++ b/utils/request.js @@ -17,6 +17,7 @@ const request = config => { // 是否需要设置 token const isToken = (config.headers || {}).isToken === false config.header = config.header || {} + config.header['Tenant-Id'] = '1' if (getToken() && !isToken) { config.header['Authorization'] = 'Bearer ' + getToken() }