Commit 47d5ab12 by kyle

token校验有效性

parent 8d8144bb
...@@ -318,6 +318,17 @@ ...@@ -318,6 +318,17 @@
this.provCityQry(); this.provCityQry();
}, },
methods:{ methods:{
checkToken(){
api.checkToken().then(res=>{
if(res['success']){}else{
api.obtainToken().then(res=>{
if(res.success){
uni.setStorageSync('uni-token',res.data['token']);
}
})
}
})
},
radioChange: function(evt) { radioChange: function(evt) {
for (let i = 0; i < this.chartsLegends.length; i++) { for (let i = 0; i < this.chartsLegends.length; i++) {
if (this.chartsLegends[i].value === evt.detail.value) { if (this.chartsLegends[i].value === evt.detail.value) {
...@@ -629,6 +640,9 @@ ...@@ -629,6 +640,9 @@
this.planningParams = {}; this.planningParams = {};
this.resultFlag = false; this.resultFlag = false;
} }
},
mounted() {
this.checkToken();
} }
} }
</script> </script>
......
...@@ -257,6 +257,17 @@ ...@@ -257,6 +257,17 @@
} }
}, },
methods: { methods: {
checkToken(){
api.checkToken().then(res=>{
if(res['success']){}else{
api.obtainToken().then(res=>{
if(res.success){
uni.setStorageSync('uni-token',res.data['token']);
}
})
}
})
},
getFollowData(e){ getFollowData(e){
this.isNeedOfficialAccountQrcode= ref(e); this.isNeedOfficialAccountQrcode= ref(e);
console.log('父组件拿到值了',e); console.log('父组件拿到值了',e);
...@@ -613,6 +624,9 @@ ...@@ -613,6 +624,9 @@
this.calcuteMethod = '2'; this.calcuteMethod = '2';
this.resultShowFlag = true; this.resultShowFlag = true;
} }
},
mounted() {
this.checkToken();
} }
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<ul> <ul>
<li v-for="item in moduleLists" :key="item.no"> <li v-for="item in moduleLists" :key="item.no">
<navigator :url="item.path" hover-class="other-navigator-hover"> <navigator :url="item.path" hover-class="other-navigator-hover">
<view class="imgContainer"><img :src="`../../static/images/${item.background}`" alt="" srcset=""></view> <view class="imgContainer"><img :src="`/sfp/static/images/${item.background}`" alt="" srcset=""></view>
<text :style="{color:item.color}">{{item.name}}</text> <text :style="{color:item.color}">{{item.name}}</text>
</navigator> </navigator>
</li> </li>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment