From 12ddd031ab469e5cd964a18df8a81aecaa773dbd Mon Sep 17 00:00:00 2001 From: unknown <331404948@qq.com> Date: Thu, 11 Jan 2024 19:16:12 +0800 Subject: [PATCH] =?UTF-8?q?token=E5=88=B7=E6=96=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/api.js | 4 +++ config/request.js | 4 +-- config/site.config.js | 2 +- config/utils.js | 28 +++++++++++++++++++++ manifest.json | 4 +-- pages/indexEntry/enroll/enroll.vue | 1 - .../enroll/signContract/signContract.vue | 10 +++++++- .../examines/warningEducation/warningEducation.vue | 2 +- pages/indexEntry/findShcool/findShcool.vue | 1 + pages/mineEntry/carLearnHours/carLearnHours.vue | 26 +++++++++++++++---- pages/tabbar/index/index.vue | 3 ++- pages/userCenter/login/login.vue | 3 ++- static/images/ic_dingdan.zip | Bin 2289 -> 0 bytes static/images/logo.png | Bin 10347 -> 0 bytes static/images/tabbar/sy.png | Bin 1057 -> 0 bytes static/images/tabbar/syActive.png | Bin 861 -> 0 bytes static/images/tabbar/tk.png | Bin 929 -> 0 bytes static/images/tabbar/tkActive.png | Bin 826 -> 0 bytes static/images/tabbar/wd.png | Bin 1628 -> 0 bytes static/images/tabbar/wdActive.png | Bin 1330 -> 0 bytes static/images/tabbar/zx.png | Bin 587 -> 0 bytes static/images/tabbar/zxActive.png | Bin 547 -> 0 bytes static/images/userCenter/ic_dingdan@2x.png.zip | Bin 11340 -> 0 bytes .../ic_dingdan@2x.png/__MACOSX/._ic_dingdan@2x.png | Bin 233 -> 0 bytes store/modules/user.js | 1 + 25 files changed, 74 insertions(+), 15 deletions(-) delete mode 100644 static/images/ic_dingdan.zip delete mode 100644 static/images/logo.png delete mode 100644 static/images/tabbar/sy.png delete mode 100644 static/images/tabbar/syActive.png delete mode 100644 static/images/tabbar/tk.png delete mode 100644 static/images/tabbar/tkActive.png delete mode 100644 static/images/tabbar/wd.png delete mode 100644 static/images/tabbar/wdActive.png delete mode 100644 static/images/tabbar/zx.png delete mode 100644 static/images/tabbar/zxActive.png delete mode 100644 static/images/userCenter/ic_dingdan@2x.png.zip delete mode 100644 static/images/userCenter/ic_dingdan@2x.png/__MACOSX/._ic_dingdan@2x.png diff --git a/config/api.js b/config/api.js index 4aff43f..ba2b909 100644 --- a/config/api.js +++ b/config/api.js @@ -164,6 +164,10 @@ export const deleteTest = (params) => http.get('app/student-record/deleteTest', export const getAgreement = (params={}) => http.get('app/student-record/getAgreement', {params}) // 学车流程 export const getDriveProcessDetails = (params={}) => http.get('app/student-record/getDriveProcessDetails', {params}) +// 学时查询 +export const getStudentProcess = (params={}) => http.get('app/student-process/getStudentProcess', {params}) + + diff --git a/config/request.js b/config/request.js index dab7f40..a952e1d 100644 --- a/config/request.js +++ b/config/request.js @@ -1,7 +1,7 @@ import { H5_API, WX_API,httpPrefix } from '@/config/site.config.js'; -import { checkToken } from './utils' +import { refreshToken } from './utils' @@ -47,7 +47,7 @@ module.exports = (vm) => { // console.log('请求结果') // console.log(data) if(data.code==406&&response.config.url!='member/auth/refresh-token'&&response.config.url!=='member/auth/logout') { - await vm.$store.dispatch('refreshToken') + await refreshToken() let obj = response.config let method = obj.method.toLowerCase() if(method=='get') { diff --git a/config/site.config.js b/config/site.config.js index 8e4bba3..e71d4f2 100644 --- a/config/site.config.js +++ b/config/site.config.js @@ -3,7 +3,7 @@ const VUE_APP_PLATFORM = process.env.VUE_APP_PLATFORM; module.exports = { H5_API: VUE_APP_PLATFORM === 'h5' ? '/api' : '',//h5代理 WX_API: VUE_APP_PLATFORM === 'h5' ? '' : 'http://192.168.1.36:48080/',//非代理地址 - // website: 'http://192.168.1.37:90/h5/#', + // website: 'http://192.168.1.37:90/h5/#', 192.168.1.15:48080/ website: 'http://192.168.1.37', httpPrefix: 'app-api/', imgUrl: 'https://jiangxijiakao-1.oss-cn-hangzhou.aliyuncs.com/defaultImages/app/bigImg/' diff --git a/config/utils.js b/config/utils.js index c8d1bc4..d41fe29 100644 --- a/config/utils.js +++ b/config/utils.js @@ -135,5 +135,33 @@ export function uploadImgApi(filePath, imgName) { }) }) } + let apiOk =true + let refreshTokenFn = null + export function refreshToken() { + return new Promise(async(resolve, reject)=>{ + if(!apiOk) { + return refreshTokenFn + } + apiOk = false + refreshTokenFn = null + const http = uni.$u.http + let config = { header: {'content-type': 'application/x-www-form-urlencoded; charset=UTF-8'}, custom: { noToken: true } } + let refreshToken = store.state.user.vuex_loginInfo.refreshToken + refreshTokenFn = await http.post('member/auth/refresh-token',{refreshToken}, config) + if( refreshTokenFn.data|| refreshTokenFn.data.accessToken) { + apiOk = true + store.commit('update_vuex_loginInfo', refreshTokenFn.data) + uni.$u.http.setConfig((config) => { + config.header.Authorization = 'Bearer ' + refreshTokenFn.data.accessToken + return config + }) + resolve(refreshTokenFn) + }else { + apiOk = true + store.commit('goLogin') + reject('刷新token失败了') + } + }) + } \ No newline at end of file diff --git a/manifest.json b/manifest.json index 90262d0..bdc33c0 100644 --- a/manifest.json +++ b/manifest.json @@ -96,8 +96,8 @@ "disableHostCheck" : true, "proxy" : { "/api" : { - // "target" : "http://192.168.1.26:48080/", - "target" : "http://192.168.1.36:48080/", + "target" : "http://192.168.1.15:48080/", + // "target" : "http://192.168.1.36:48080/", "changeOrigin" : true, "secure" : true, "pathRewrite" : { diff --git a/pages/indexEntry/enroll/enroll.vue b/pages/indexEntry/enroll/enroll.vue index 462037d..f6bf3cf 100644 --- a/pages/indexEntry/enroll/enroll.vue +++ b/pages/indexEntry/enroll/enroll.vue @@ -196,7 +196,6 @@ // this.$goPage('/pages/indexEntry/enroll/signContract/signContract?schoolId='+this.vuex_userInfo.schoolId) // return // 去签约 - if(this.vuex_userInfo.applyStep==3) { return this.$goPage('/pages/indexEntry/enroll/signContract/signContract') } diff --git a/pages/indexEntry/enroll/signContract/signContract.vue b/pages/indexEntry/enroll/signContract/signContract.vue index b870cf6..3ee82e9 100644 --- a/pages/indexEntry/enroll/signContract/signContract.vue +++ b/pages/indexEntry/enroll/signContract/signContract.vue @@ -7,7 +7,7 @@ 同意并签字确认 --> - + @@ -52,6 +52,14 @@ uni.hideLoading() this.webViewUrl = res.url }, + handleGetMessage(e){ + console.log('handleGetMessage',e) + if(e.detail.data[0].result=='success'){ + uni.navigateTo({ + url: '/pages/indexEntry/enroll/payment/payment' + }) + } + }, // 查询签约状态 async getContractStatusFn() { const { diff --git a/pages/indexEntry/examines/warningEducation/warningEducation.vue b/pages/indexEntry/examines/warningEducation/warningEducation.vue index 6fd8686..601207c 100644 --- a/pages/indexEntry/examines/warningEducation/warningEducation.vue +++ b/pages/indexEntry/examines/warningEducation/warningEducation.vue @@ -15,7 +15,7 @@ - + diff --git a/pages/indexEntry/findShcool/findShcool.vue b/pages/indexEntry/findShcool/findShcool.vue index 3518db4..97d1404 100644 --- a/pages/indexEntry/findShcool/findShcool.vue +++ b/pages/indexEntry/findShcool/findShcool.vue @@ -130,6 +130,7 @@ .pageBgImg { width: 100%; min-height: 100vh; + background-size: 100% 392rpx; .searchCon { padding: 0 0 24rpx 0; } diff --git a/pages/mineEntry/carLearnHours/carLearnHours.vue b/pages/mineEntry/carLearnHours/carLearnHours.vue index 13187fb..5a2f6c8 100644 --- a/pages/mineEntry/carLearnHours/carLearnHours.vue +++ b/pages/mineEntry/carLearnHours/carLearnHours.vue @@ -29,16 +29,32 @@