1.0.13 • Published 3 years ago

vue-cli-plugin-apmapi v1.0.13

Weekly downloads
54
License
ISC
Repository
-
Last release
3 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

3 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.2

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago