|  | @@ -37,6 +37,12 @@
 | 
	
		
			
				|  |  |      </div>
 | 
	
		
			
				|  |  |  </template>
 | 
	
		
			
				|  |  |  <script >
 | 
	
		
			
				|  |  | +import axios from 'axios';
 | 
	
		
			
				|  |  | +const CancelToken = axios.CancelToken;
 | 
	
		
			
				|  |  | +const source = CancelToken.source();
 | 
	
		
			
				|  |  | +var http = axios.create({
 | 
	
		
			
				|  |  | +    timout: 30000
 | 
	
		
			
				|  |  | +});
 | 
	
		
			
				|  |  |  export default {
 | 
	
		
			
				|  |  |      props: ['params'],
 | 
	
		
			
				|  |  |      data() {
 | 
	
	
		
			
				|  | @@ -120,19 +126,39 @@ export default {
 | 
	
		
			
				|  |  |          },
 | 
	
		
			
				|  |  |          //读卡
 | 
	
		
			
				|  |  |          getReadCard() {
 | 
	
		
			
				|  |  | +            // axios request 拦截器
 | 
	
		
			
				|  |  | +            http.interceptors.request.use(
 | 
	
		
			
				|  |  | +                (config) => {
 | 
	
		
			
				|  |  | +                    config.headers[localStorage.getItem('SC_token') && 'Authorization'] = 'Bearer ' + localStorage.getItem('SC_token');
 | 
	
		
			
				|  |  | +                    // 全局添加cancelToken
 | 
	
		
			
				|  |  | +                    config.cancelToken = source.token;
 | 
	
		
			
				|  |  | +                    return config;
 | 
	
		
			
				|  |  | +                },
 | 
	
		
			
				|  |  | +                (err) => {
 | 
	
		
			
				|  |  | +                    return Promise.reject(err);
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            );
 | 
	
		
			
				|  |  |              new Promise((resolve) => {
 | 
	
		
			
				|  |  | -                this.$http.get('/card/load').then(({ data, status, msg }) => {
 | 
	
		
			
				|  |  | -                    if (status == 0) {
 | 
	
		
			
				|  |  | -                        if (!!data) {
 | 
	
		
			
				|  |  | -                            // this.$message.success(msg);
 | 
	
		
			
				|  |  | -                            resolve && resolve(data);
 | 
	
		
			
				|  |  | -                        } else {
 | 
	
		
			
				|  |  | -                            this.$message.warning('没有读取到卡号');
 | 
	
		
			
				|  |  | -                        }
 | 
	
		
			
				|  |  | -                    } else {
 | 
	
		
			
				|  |  | -                        this.$message.error('读取失败');
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | -                });
 | 
	
		
			
				|  |  | +                http.get('http://127.0.0.1:8099/card/load')
 | 
	
		
			
				|  |  | +                    .then((res) => {
 | 
	
		
			
				|  |  | +                        debugger;
 | 
	
		
			
				|  |  | +                        // this.callback(resolve, res);
 | 
	
		
			
				|  |  | +                    })
 | 
	
		
			
				|  |  | +                    .catch((err) => {
 | 
	
		
			
				|  |  | +                        this.reject(reject, err);
 | 
	
		
			
				|  |  | +                    });
 | 
	
		
			
				|  |  | +                // this.$http.get('/card/load').then(({ data, status, msg }) => {
 | 
	
		
			
				|  |  | +                //     if (status == 0) {
 | 
	
		
			
				|  |  | +                //         if (!!data) {
 | 
	
		
			
				|  |  | +                //             // this.$message.success(msg);
 | 
	
		
			
				|  |  | +                //             resolve && resolve(data);
 | 
	
		
			
				|  |  | +                //         } else {
 | 
	
		
			
				|  |  | +                //             this.$message.warning('没有读取到卡号');
 | 
	
		
			
				|  |  | +                //         }
 | 
	
		
			
				|  |  | +                //     } else {
 | 
	
		
			
				|  |  | +                //         this.$message.error('读取失败');
 | 
	
		
			
				|  |  | +                //     }
 | 
	
		
			
				|  |  | +                // });
 | 
	
		
			
				|  |  |              }).then((res) => {
 | 
	
		
			
				|  |  |                  this.queryBinding(res);
 | 
	
		
			
				|  |  |              });
 |