How to use the @ams-team/ams.config function in @ams-team/ams

To help you get started, we’ve selected a few @ams-team/ams examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vipshop / ams / examples / router / src / ams-config / index.js View on Github external
import './cases-block/grid';
import './cases-block/carousel';
import './cases-block/backtop';
import './cases-block/tabs';
import './cases-block/component';
import './cases-block/popover';
import './cases-block/bct-progress';
import './cases-block/imagelist';
import './cases-block/imagelist2';
import './cases-block/title';

// chart-demo
import './cases-chart/demo1';
import './cases-chart/demo2';

ams.config({
    resource: {
        responseInterceptor(res) {
            // console.log('responseInterceptor', res)
            if (res.data.code === -33) {
                ams.callAction('@routerPush:/login');
                return false;
            }
            return res;
        },
        // requestInterceptor(options) {
        //     options.headers = {
        //         ...options.headers,
        //         'xsrf-token': 'token'
        //     }
        //     return options
        // },
github vipshop / ams / docs / zh-CN / .vuepress / components / entry.js View on Github external
// Vue.use(card);
Vue.use(chart);
Vue.use(amsConfig);

if(typeof window !== 'undefined'){
    window.Vue = Vue;
}

Vue.use(VueHighlightJS, {
    // Register only languages that you want
    languages: {
        javascript
    }
});

ams.config({
    resource: {
        api: {
            withCredentials: false
        }
    }
})