安全性问题处理:axios 个性化处理调整-统一拦截 --提交人:阳华祥

This commit is contained in:
yang.huaxiang
2020-10-27 11:55:40 +08:00
parent a74f9f0c10
commit a01055a287
3 changed files with 24 additions and 47 deletions

View File

@@ -53,7 +53,7 @@ import OccupationPicker from '@/components/ebiz/occipation/OccupationPicker'
import CustomerPicker from '@/components/ebiz/customer/CustomerPicker'
import DataDictionary from '@/assets/js/utils/data-dictionary'
import areaList from '@/assets/js/utils/area'
import { getTokenForAgent, agentInfowxSubmit } from '@/api/ebiz/agentEenter/agentEenter'
import { getTokenForAgent, agentInfowxSubmit, getTokenForUserModel } from '@/api/ebiz/agentEenter/agentEenter'
import utilsAge from '@/assets/js/utils/age'
import getAreaName from '@/assets/js/utils/get-area-name'
import IdentityCardScan from '@/components/ebiz/sale/IdentityCardScan'
@@ -65,6 +65,7 @@ import axios from 'axios'
import index from '@/config/index'
import { getAuthCode } from '@/api/ebiz/sale/sale'
export default {
name: 'insuredInfo',
components: {
@@ -152,32 +153,20 @@ export default {
loadingType: 'spinner',
message: '加载中……'
})
axios
.get(index.apiDomain + `/agent/enter/getTokenForAgent`, {
params: {
token: localStorage.token
},
headers: {
token: localStorage.token
}
})
.then(function(response) {
self.$toast.clear()
console.log('response', response)
if (response.data.code == '0') {
console.log('response.data.content', response.data.content)
if (response.data.content.result == '0') {
self.recommender = response.data.content
} else {
this.$toast.fail(response.data.content.resultMessage)
}
} else {
this.$toast.fail(response.data.message)
}
})
.catch(function(error) {
// this.$toast.fail(error)
})
getTokenForUserModel({
token: this.$CacheUtils.getLocItem('token')
}).then(function(response) {
self.$toast.clear()
console.log('response', response)
if (response.result == '0') {
self.recommender = response
} else {
this.$toast.fail(response.resultMessage)
}
})
.catch(function(error) {
// this.$toast.fail(error)
})
// var self = this
// //获取推荐人信息
// let data = {

View File

@@ -117,7 +117,7 @@
<script>
import { List, Tab, Tabs, Tag, Row, Col, Dialog, Sticky } from 'vant'
import { progress } from '@/api/ebiz/claims/claims'
import { progress, deleteClaim } from '@/api/ebiz/claims/claims'
import axios from 'axios'
import index from '@/config/index'
@@ -209,15 +209,9 @@ export default {
cancelButtonColor: '#4FC6B3',
confirmButtonColor: '#FFFFFF'
}).then(() => {
axios
.get(index.apiDomain + `/claim/claimApply/delete`, {
params: {
businessNo: businessNo
},
headers: {
token: localStorage.token
}
})
deleteClaim({
businessNo: businessNo
})
.then(res => {
let data = {
progressStatus: 'applying'

View File

@@ -65,7 +65,7 @@
<script>
import { Search, List, Tag, Row, Col } from 'vant'
import { history } from '@/api/ebiz/claims/claims'
import { history, historyDetail } from '@/api/ebiz/claims/claims'
// import { getPolicyList } from '@/api/ebiz/serve/serve'
import axios from 'axios'
import index from '@/config/index'
@@ -140,15 +140,9 @@ export default {
},
// 点击选择去被保人信息
goToDetail(data) {
axios
.get(index.apiDomain + `/claim/claimReport/historyDetail`, {
params: {
insuredNo: this.insuredNo
},
headers: {
token: localStorage.token
}
})
historyDetail({
insuredNo: that.insuredNo
})
.then(res => {
console.log(res)
})