task#11020,token获取

This commit is contained in:
2024-02-20 14:45:50 +08:00
parent ced01e18f4
commit bc226a0e2a
2 changed files with 12 additions and 7 deletions

View File

@ -19,7 +19,7 @@ service.interceptors.request.use(
config.data = config.contentType ? config.data : qs.stringify(config.data) config.data = config.contentType ? config.data : qs.stringify(config.data)
config.headers['Content-Type'] = config.contentType || 'application/x-www-form-urlencoded' config.headers['Content-Type'] = config.contentType || 'application/x-www-form-urlencoded'
let token = localStorage.getItem('token'); let token = localStorage.getItem('token');
this.$toast(token); // alert(token);
// let token='4099761587129c46b03c9316c9e866c9' // let token='4099761587129c46b03c9316c9e866c9'
// let token='eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJTSENTR1lTIiwiYXVkIjpbInN1cHBsaWVyLWFwcCJdLCJuYmYiOjE3MDgzMjY3NTAsInVzZXJfaW5mbyI6eyJ1c2VySWQiOjUwMTk3LCJuYW1lIjoi5LiK5rW35rWL6K-V5L6b5bqU5ZWGIiwic3VwcGxpZXJOYW1lIjoi5LiK5rW35rWL6K-V5pyN5Yqh5ZWGIiwic3VwcGxpZXJJZCI6MzMwNDEsInN1cHBsaWVyVHlwZSI6MSwiaXNaZCI6MCwidXNlcm5hbWUiOiJTSENTR1lTIiwidXNlclR5cGUiOiJyZXNjdWVBcHAiLCJkZXZpY2VJZCI6IjJjMGU0N2JiMWQxNGYzYTY3YjhkOGRjMTUyM2VhMmQ3MCIsImF1dGhvcml0aWVzIjpbXX0sInNjb3BlIjpbImFsbCJdLCJpc3MiOiJodHRwczovL3Npbm9hc3Npc3QuY29tIiwiZXhwIjoxNzA4NDEzMTUwLCJpYXQiOjE3MDgzMjY3NTB9.hJ4TkZpsDW0c_-o4qopSxNyLyCtCRuuLzKAvH1xQgOw' // let token='eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJTSENTR1lTIiwiYXVkIjpbInN1cHBsaWVyLWFwcCJdLCJuYmYiOjE3MDgzMjY3NTAsInVzZXJfaW5mbyI6eyJ1c2VySWQiOjUwMTk3LCJuYW1lIjoi5LiK5rW35rWL6K-V5L6b5bqU5ZWGIiwic3VwcGxpZXJOYW1lIjoi5LiK5rW35rWL6K-V5pyN5Yqh5ZWGIiwic3VwcGxpZXJJZCI6MzMwNDEsInN1cHBsaWVyVHlwZSI6MSwiaXNaZCI6MCwidXNlcm5hbWUiOiJTSENTR1lTIiwidXNlclR5cGUiOiJyZXNjdWVBcHAiLCJkZXZpY2VJZCI6IjJjMGU0N2JiMWQxNGYzYTY3YjhkOGRjMTUyM2VhMmQ3MCIsImF1dGhvcml0aWVzIjpbXX0sInNjb3BlIjpbImFsbCJdLCJpc3MiOiJodHRwczovL3Npbm9hc3Npc3QuY29tIiwiZXhwIjoxNzA4NDEzMTUwLCJpYXQiOjE3MDgzMjY3NTB9.hJ4TkZpsDW0c_-o4qopSxNyLyCtCRuuLzKAvH1xQgOw'
// console.log("tokentokentoken",token) // console.log("tokentokentoken",token)

View File

@ -2,7 +2,7 @@
<div class="wrap"> <div class="wrap">
<div class="navBar"> <div class="navBar">
<van-nav-bar <van-nav-bar
title="司机app报销" title="路桥费报销"
left-arrow left-arrow
left-arrow-color="#FFFFFF" left-arrow-color="#FFFFFF"
:border="false" :border="false"
@ -62,6 +62,7 @@ import { waitReimburseList ,submitReimburseBatch,reimbursedList,waitReimburseMon
export default { export default {
name: "driverCaseList", name: "driverCaseList",
mixins: [myMixins], mixins: [myMixins],
data(){ data(){
return{ return{
tabArr: [{name: '待报销', status: 1}, {name: '已报销', status: 2},{name: '报销失败', status: 3},], tabArr: [{name: '待报销', status: 1}, {name: '已报销', status: 2},{name: '报销失败', status: 3},],
@ -87,9 +88,11 @@ export default {
}, },
}, },
async mounted() { async mounted() {
const urlParams = new URLSearchParams(window.location.search); let token = localStorage.getItem('token');
this.driverId = urlParams.get('driverId'); this.$notify(token);
// this.driverId = 78948; /* const urlParams = new URLSearchParams(window.location.search);
this.driverId = urlParams.get('driverId');*/
this.driverId = 78948;
await this.getMonth(); await this.getMonth();
await this.getList() await this.getList()
}, },
@ -121,6 +124,8 @@ export default {
}) })
if(res.code === 200){ if(res.code === 200){
this.$toast(res.msg) this.$toast(res.msg)
}else{
this.$toast("请勾选要报销的订单")
} }
await this.getList() await this.getList()
}, },
@ -250,13 +255,13 @@ export default {
align-items: center; align-items: center;
span{ span{
display: inline-block; display: inline-block;
@include wh(82px,25px); @include wh(102px,25px);
box-shadow: 0px 1px 2px 0px rgba(236,236,236,0.5); box-shadow: 0px 1px 2px 0px rgba(236,236,236,0.5);
border-radius: 14px; border-radius: 14px;
margin-right: 8px; margin-right: 8px;
line-height: 25px; line-height: 25px;
text-align: center; text-align: center;
@include fontWeightSize(14px,600); @include fontWeightSize(600,14px);
background: #FFFFFF; background: #FFFFFF;
} }
.active{ .active{