Compare commits

..

No commits in common. "51478432666020c6d62897208d0aaf5bd8d8e34c" and "6e85904598d152ac81ee8d19cb452d0a31564343" have entirely different histories.

7 changed files with 88 additions and 29 deletions

View File

@ -16,7 +16,9 @@
"pages/qrCode/index",
"pages/recharge/index",
"pages/questions/index",
"pages/editInvoice/index",
"pages/rechargeDetail/index",
"pages/updateInvoice/index",
"pages/rechargeWay/index"
],

View File

@ -0,0 +1,66 @@
// pages/editInvoice/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,2 @@
<!--pages/editInvoice/index.wxml-->
<text>pages/editInvoice/index.wxml</text>

View File

@ -41,9 +41,10 @@ Page({
// })
// return
// }
wx.redirectTo({
url: '/pages/login/index',
})
// wx.switchTab({
// url: '/pages/home/index',
// })
},
async getPrivacy() {
const { code, message, data } = await getPrivaciList()
@ -89,7 +90,6 @@ Page({
},
getPhoneNumber(e) {
const { errno, code: phoneCode } = e.detail;
console.log('e', e)
switch(errno) {
case 103:
alertInfo("已拒绝");

View File

@ -6,10 +6,11 @@
"enhance": true,
"postcss": true,
"preloadBackgroundData": false,
"ignoreDevUnusedFiles": false,
"minified": true,
"newFeature": false,
"coverView": true,
"nodeModules": true,
"nodeModules": false,
"autoAudits": false,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
@ -18,19 +19,14 @@
"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": [
@ -39,8 +35,14 @@
"miniprogramNpmDistDir": "./"
}
],
"minifyWXSS": true
"minifyWXSS": true,
"showES6CompileOption": false,
"condition": false,
"compileWorklet": false,
"ignoreUploadUnusedFiles": false,
"useIsolateContext": true
},
"condition": {},
"editorSetting": {
"tabIndent": "insertSpaces",
"tabSize": 2
@ -49,7 +51,5 @@
"ignore": [],
"include": []
},
"appid": "wxb34b4e70f8a5c6f1",
"projectname": "elec",
"condition": {}
"appid": "wxb34b4e70f8a5c6f1"
}

View File

@ -238,12 +238,4 @@ 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
}

View File

@ -86,12 +86,9 @@ const parseResponse = function (response, url) {
const { code } = response?.data || {};
console.log('url', url,'code', code, 'response.data', response.data)
if (code === 401) {
const currentUrl = getPageUrl()
if (!['pages/home/index', 'pages/login/index'].includes(currentUrl)) {
wx.redirectTo({
url: '/pages/login/index',
})
}
wx.redirectTo({
url: '/pages/login/index',
})
wx.clearStorageSync()
return { code: 401, message: '未登录状态' }
}