Browse Source

token刷新备份

master
unknown 11 months ago
parent
commit
f3b8d74e30
  1. 2
      config/api.js
  2. 3
      config/site.config.js
  3. 53
      pages/indexEntry/enroll/enroll.vue
  4. 17
      pages/indexEntry/parse/parse.vue
  5. 7
      pages/indexEntry/theory/theory.vue
  6. BIN
      static/images/ic_dingdan.zip
  7. BIN
      static/images/userCenter/ic_dingdan@2x.png.zip
  8. BIN
      static/images/userCenter/ic_dingdan@2x.png/__MACOSX/._ic_dingdan@2x.png
  9. BIN
      static/images/userCenter/yubaoming.png
  10. 2
      store/modules/user.js

2
config/api.js

@ -163,7 +163,7 @@ 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/inform/manage/getDriveProcessDetails.do', {params})
export const getDriveProcessDetails = (params={}) => http.get('app/student-record/getDriveProcessDetails', {params})

3
config/site.config.js

@ -3,7 +3,8 @@ 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/#',
website: 'http://192.168.1.37',
httpPrefix: 'app-api/',
imgUrl: 'https://jiangxijiakao-1.oss-cn-hangzhou.aliyuncs.com/defaultImages/app/bigImg/'
};

53
pages/indexEntry/enroll/enroll.vue

@ -83,6 +83,7 @@
<script>
import { getpersonface, GetDetectInfoEnhanced, getCardType } from '@/config/api.js'
import { website } from '@/config/site.config.js'
import { startEid } from '@/mp_ecard_sdk/main';
export default {
data() {
return {
@ -138,10 +139,12 @@
this.showType = false
},
async getpersonfaceFn() {
const {data: res} = await getpersonface({ ruleId: 2, RedirectUrl: website + '/pages/indexEntry/enroll/realName/realName?userId='+this.userId+'&test=123' ,userId: this.userId})
const {data: res} = await getpersonface({MerchantId: '0NSJ2312271333064407'})
let obj = JSON.parse(res)
this.link = obj.Url
this.$store.commit('updateBizToken', obj.BizToken)
// this.link = obj.Url
// this.$store.commit('updateBizToken', obj.BizToken)
this.EidToken = obj.EidToken
return obj.EidToken
// #ifdef H5
window.open(this.link, '_blank')
@ -159,21 +162,20 @@
console.log(obj)
},
async GetDetectInfoEnhancedFn(bizToken) {
let obj = {
ruleId: 2,
redirectUrl: website + '/pages/indexEntry/enroll/registInfo/registInfo',
bizToken: 'C9C2BC8E-8336-4071-84B3-8170E283E6CA',
userId: this.userId
}
const {data: res} = await GetDetectInfoEnhanced(obj)
async GetDetectInfoEnhancedFn(EidToken) {
// let obj = {
// ruleId: 2,
// redirectUrl: website + '/pages/indexEntry/enroll/registInfo/registInfo',
// bizToken: 'C9C2BC8E-8336-4071-84B3-8170E283E6CA',
// userId: this.userId
// }
const {data: res} = await GetDetectInfoEnhanced({EidToken, userId: this.userId, InfoType: 1})
let obj2 = JSON.parse(res)
console.log(obj2)
console.log('请求结果来了')
console.log(obj2.Text.ErrMsg=='成功')
console.log(obj2)
// uni.setStorageSync(obj2)
},
goNext() {
async goNext() {
// return this.$goPage('/pages/indexEntry/enroll/registInfo/registInfo')
// if(!this.form.value) return this.$u.toast('')
// this.$goPage('/pages/indexEntry/enroll/signContract/signContract?schoolId='+this.vuex_userInfo.schoolId)
@ -213,12 +215,31 @@
}
//
if(!this.vuex_userInfo.applyStep||this.vuex_userInfo.applyStep<2) {
this.getpersonfaceFn()
const EidToken = await this.getpersonfaceFn()
console.log(EidToken)
this.goSDK(EidToken)
}
// this.$goPage('/pages/indexEntry/enroll/signContract/signContract')
// this.$goPage('/pages/indexEntry/enroll/uploadAvatar/uploadAvatar')
}
},
//
goSDK(token) {
let _this = this
startEid({
data: {
token,
},
verifyDoneCallback(res) {
const { token, verifyDone } = res;
console.log('收到核身完成的res:', res);
console.log('核身的token是:', token);
_this.GetDetectInfoEnhancedFn(token)
console.log('是否完成核身:', verifyDone);
},
});
},
}
}
</script>

17
pages/indexEntry/parse/parse.vue

@ -3,11 +3,11 @@
<view class="tit">
{{step}} {{title}}
</view>
<view class="address" @click="$goPage('/pages/indexInner/experienceCenter/experienceCenter')" v-if="step==2">查看体检地点</view>
<!-- <view class="address" @click="$goPage('/pages/indexInner/experienceCenter/experienceCenter')" v-if="step==2">查看体检地点</view> -->
<u-tabs :list="list" :is-scroll="false" :current="currentTab" @change="change" inactive-color="#999" :bold="false" style="margin-bottom: 20rpx;" v-if="step==6"></u-tabs>
<u-parse :html="content"></u-parse>
<u-parse :content="content"></u-parse>
<view class="footerBtn">
<view class="" v-for="(item,index) in curTtnText" :key="index" class="btn" @click="changeStep(item.step)">
<view v-for="(item,index) in curTtnText" :key="index" class="btn" @click="changeStep(item.step)">
{{item.text}}
</view>
</view>
@ -57,14 +57,15 @@
this.CarLearningTraining()
},
methods: {
change(index) {
this.currentTab = index
change(curItem) {
this.currentTab = curItem.index
console.log(this.currentTab)
let arr = [this.contentTemp,this.content1,this.content2]
this.content = arr[index]
this.content = arr[this.currentTab]
},
//
async CarLearningTraining() {
const res = await getDriveProcessDetails({driveProcessId: this.step})
const res = await getDriveProcessDetails({id: this.step})
if(this.step==6) {
this.content1 = res.data.content1
this.content2 = res.data.content2
@ -74,7 +75,7 @@
this.content = res.data.content
this.title = res.data.title
}
console.log(res)
console.log(this.content)
},
changeStep(step) {
this.step = step

7
pages/indexEntry/theory/theory.vue

@ -18,6 +18,7 @@
</template>
<script>
import { website } from '@/config/site.config.js'
export default {
data() {
return {
@ -39,7 +40,7 @@
goPage() {
if(this.currentId==1) {
// let url = 'https://www.hzsjspx.com/theory/scienceStudy?token=amlhcGVpMTY5NTc3NzUzODg5ODA5NjU1&lat=30.343055&lng=120.183711&isUni=1'
let questionUrl = 'http://192.168.1.44:92/question/'
let questionUrl = website+':93/question/'
let phone = this.vuex_userInfo.phone
let obj = {
phone,
@ -54,11 +55,11 @@
this.$store.commit('updateWebVeiwUrl', url)
this.$goPage('/pages/indexEntry/webView/webView')
}else if(this.currentId==2) {
let theory = 'http://192.168.1.44:91/theory/'
let theory = website+':91/theory/'
let token = this.$store.state.user.vuex_loginInfo.accessToken
let lat = this.vuex_cityInfo.lat|| 30.27419537786047
let lng = this.vuex_cityInfo.lng|| 120.20633397715788
let url = `${theory}?token=${token}&lat=${lat}&lng=${lng}&isUni=1`
let url = `${theory}?token=${token}&lat=${lat}&lng=${lng}&isWx=1`
this.$store.commit('updateWebVeiwUrl', url)
this.$goPage('/pages/indexEntry/webView/webView')
}

BIN
static/images/ic_dingdan.zip

BIN
static/images/userCenter/ic_dingdan@2x.png.zip

BIN
static/images/userCenter/ic_dingdan@2x.png/__MACOSX/._ic_dingdan@2x.png

BIN
static/images/userCenter/yubaoming.png

Before

Width: 128  |  Height: 128  |  Size: 7.9 KiB

After

Width: 136  |  Height: 136  |  Size: 10 KiB

2
store/modules/user.js

@ -100,7 +100,7 @@ const user = {
// 刷新token
async refreshToken({state, commit}) {
return new Promise(async(resolve, reject)=>{
if(!state.apiOk) {
if(!state.apiOk&&state.refreshTokenFn) {
return state.refreshTokenFn
}
commit('update_apiOk',false)

Loading…
Cancel
Save