1.0.13 • Published 4 years ago

vue-cli-plugin-apmapi v1.0.13

Weekly downloads
54
License
ISC
Repository
-
Last release
4 years ago

vue-cli-plugin-apmapi

A Vue CLI Plugin for apmApi config vue-cli version > 3

install & usage

vue add apmapi

config axios

import axios from 'axios'
import { InitApm } from '@/plugins/apmApi'

function serves(serve: string) {
    const apm = new InitApm('app name'); // apm
    apm.apmInit(); // apm

    const service = axios.create({
        // config ...
    });

    // axios
    service.interceptors.request.use(
        (config) => {
            apm.ampHanleRequest(config); // apm
            return config;
        },
        (error) => {
            return Promise.reject(error)
        }
    );

    service.interceptors.response.use(
        (response) => {
            apm.apmHandleResponse(response); // apm
            return response;
        },
        (error) => {
            apm.apmHandleResponseError(error); // apm
            // handle error ...
        }
    )
    return service
}
export default serves
1.0.13

4 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.2

5 years ago

1.0.3

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago