lihongxiao 3 лет назад
Родитель
Сommit
c0e1bbf3d6
3 измененных файлов с 5 добавлено и 7 удалено
  1. 1 2
      src/http/axios.js
  2. 1 1
      src/utils/request.js
  3. 3 4
      src/views/Letter/Letter.vue

+ 1 - 2
src/http/axios.js

@@ -10,8 +10,7 @@ export default function $axios(options) {
   return new Promise((resolve, reject) => {
     const instance = axios.create({
       baseURL: config.baseUrl,
-      headers: config.headers,
-      timeout: config.timeout,
+       timeout: config.timeout,
       // withCredentials: config.withCredentials
 
     })

+ 1 - 1
src/utils/request.js

@@ -19,7 +19,7 @@ service.interceptors.request.use(
       // let each request carry token
       // ['X-Token'] is a custom headers key
       // please modify it according to the actual situation
-      config.headers['token'] = getToken()
+      config.headers['token'] = Authorization = 'Bearer '+getToken()
     }
     return config
   },

+ 3 - 4
src/views/Letter/Letter.vue

@@ -3011,7 +3011,7 @@ export default {
     async ywxxxchange(index) {
       this.accidentForm = Object.assign(
         this.accidentForm,
-        this.accidentDataList.filter(val => val.id == index)[0]
+        this.accidentDataList.find(val => val.id == index)
       );
       this.accidentForm.fen = "1";
       this.accidentPremium = this.accidentForm.premium;
@@ -3112,7 +3112,6 @@ export default {
       this.carcode(id);
     },
     initchange(e, code, name, index) {
-      console.log(this.zmDrivingForm,1111111111)
       this.totalCompanyList[index].checked = e;
       if (e) {
         let params = {
@@ -3792,9 +3791,9 @@ export default {
     yongcheng(num, id) {
       let accidentalDrivingVo = {};
       if (this.accidentForm.id) {
-        let data = this.accidentDataList.filter(
+        let data = this.accidentDataList.find(
           val => val.id == this.accidentForm.accidentType
-        )[0];
+        );
         accidentalDrivingVo = {
           rideRiskCode: data.code ? data.code : "",
           rideRiskName: data.name ? data.name : "",