From 52d463e03c1f074099ed8e8a6b7c3ddde52d2708 Mon Sep 17 00:00:00 2001 From: quanyawei <401863037@qq.com> Date: Fri, 27 Oct 2023 14:50:28 +0800 Subject: [PATCH] fix:小程序初版 --- utils/request.js | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/utils/request.js b/utils/request.js index 8496956..d863cdf 100644 --- a/utils/request.js +++ b/utils/request.js @@ -1,4 +1,5 @@ import storage from './storage' // ������������ +import store from '../store/index.js' export default { console(options) { if (config.debug) { @@ -20,13 +21,14 @@ // loading������ uni.showLoading({ title: '���������', }) // ��������������������������������������������� + // uni.showLoading({ title: baseUrl, }) options.url = baseUrl + '' + options.url // ������������ options.method = options.method || 'GET' // ������������������ if (isLogin) { - let token = storage.get('token') - console.log('tokentoken', token) + let token = uni.getStorageSync('tonken') + console.log('token', token) if (token !== null) { // options.header["token"] = token; options.header = { @@ -40,7 +42,7 @@ return new Promise((resolve, reject) => { uni.request(options).then(data => { var [error, res] = data - if (error != null) { + if (error !== null) { reject(error) } else { // ��������������������������������������������������������������������������� -- Gitblit v1.8.0