diff --git a/app.json b/app.json index 8958dc7..57ccd30 100644 --- a/app.json +++ b/app.json @@ -1,7 +1,7 @@ { "pages": [ - "pages/login/index", "pages/home/index", + "pages/login/index", "pages/billList/index", "pages/rechargeRecord/index", "pages/invoiceList/index", @@ -16,9 +16,7 @@ "pages/qrCode/index", "pages/recharge/index", "pages/questions/index", - "pages/editInvoice/index", "pages/rechargeDetail/index", - "pages/updateInvoice/index", "pages/rechargeWay/index" ], diff --git a/pages/editInvoice/index.js b/pages/editInvoice/index.js deleted file mode 100644 index 5d2f97a..0000000 --- a/pages/editInvoice/index.js +++ /dev/null @@ -1,66 +0,0 @@ -// pages/editInvoice/index.js -Page({ - - /** - * 页面的初始数据 - */ - data: { - - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad(options) { - - }, - - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady() { - - }, - - /** - * 生命周期函数--监听页面显示 - */ - onShow() { - - }, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide() { - - }, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload() { - - }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh() { - - }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom() { - - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage() { - - } -}) \ No newline at end of file diff --git a/pages/editInvoice/index.wxml b/pages/editInvoice/index.wxml deleted file mode 100644 index 385878f..0000000 --- a/pages/editInvoice/index.wxml +++ /dev/null @@ -1,2 +0,0 @@ - -pages/editInvoice/index.wxml \ No newline at end of file diff --git a/pages/login/index.js b/pages/login/index.js index 5b9bd06..e737016 100644 --- a/pages/login/index.js +++ b/pages/login/index.js @@ -32,10 +32,9 @@ Page({ // }) // return // } - wx.switchTab({ - url: '/pages/home/index', + wx.redirectTo({ + url: '/pages/login/index', }) - }, async getPrivacy() { const { code, message, data } = await getPrivaciList() @@ -81,6 +80,7 @@ Page({ }, getPhoneNumber(e) { const { errno, code: phoneCode } = e.detail; + console.log('e', e) switch(errno) { case 103: alertInfo("已拒绝"); diff --git a/project.config.json b/project.config.json index d2430d2..b5ce243 100644 --- a/project.config.json +++ b/project.config.json @@ -6,11 +6,10 @@ "enhance": true, "postcss": true, "preloadBackgroundData": false, - "ignoreDevUnusedFiles": false, "minified": true, "newFeature": false, "coverView": true, - "nodeModules": false, + "nodeModules": true, "autoAudits": false, "showShadowRootInWxmlPanel": true, "scopeDataCheck": false, @@ -19,14 +18,19 @@ "checkSiteMap": true, "uploadWithSourceMap": true, "compileHotReLoad": false, - "lazyloadPlaceholderEnable": false, "useMultiFrameRuntime": true, + "useApiHook": true, + "useApiHostProcess": true, "babelSetting": { "ignore": [], "disablePlugins": [], "outputPath": "" }, "enableEngineNative": false, + "bundle": false, + "useIsolateContext": true, + "useCompilerModule": true, + "userConfirmedUseCompilerModuleSwitch": false, "userConfirmedBundleSwitch": false, "packNpmManually": true, "packNpmRelationList": [ @@ -35,14 +39,8 @@ "miniprogramNpmDistDir": "./" } ], - "minifyWXSS": true, - "showES6CompileOption": false, - "condition": false, - "compileWorklet": false, - "ignoreUploadUnusedFiles": false, - "useIsolateContext": true + "minifyWXSS": true }, - "condition": {}, "editorSetting": { "tabIndent": "insertSpaces", "tabSize": 2 @@ -51,5 +49,7 @@ "ignore": [], "include": [] }, - "appid": "wxb34b4e70f8a5c6f1" + "appid": "wxb34b4e70f8a5c6f1", + "projectname": "elec", + "condition": {} } \ No newline at end of file diff --git a/utils/index.js b/utils/index.js index 2aee9bb..0b6f691 100644 --- a/utils/index.js +++ b/utils/index.js @@ -238,4 +238,12 @@ export const getPixelRatio = () => { export function isValidPhoneNumber(phoneNumber) { return /^1\d{10}$/.test(phoneNumber); +} + +/** 获取当前页面url */ +export function getPageUrl() { + const pages = getCurrentPages() //获取加载的页面 + const currentPage = pages[pages.length-1] //获取当前页面的对象 + const url = currentPage.route //当前页面url + return url } \ No newline at end of file diff --git a/utils/request.js b/utils/request.js index 13ce795..4ed5316 100644 --- a/utils/request.js +++ b/utils/request.js @@ -82,12 +82,16 @@ const parseResponse = function (response, url) { alertError("服务异常") return } + const { statusCode } = response; console.log('url', url, 'response.status', statusCode, 'response.data', response.data) if (statusCode === 401) { - wx.redirectTo({ - url: '/pages/login/index', - }) + const currentUrl = getPageUrl() + if (!['pages/home/index', 'pages/login/index'].includes(currentUrl)) { + wx.redirectTo({ + url: '/pages/login/index', + }) + } wx.clearStorageSync() return { code: 401, message: '未登录状态' } }