123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- import { config } from '@/common/config.js';
- const install = (Vue, vm) => {
- Vue.prototype.$u.http.setConfig({
- baseUrl: config.baseUrl,
-
-
-
-
-
-
-
- });
-
- Vue.prototype.$u.http.interceptor.request = (config) => {
-
- console.log();
-
- config.header.Authorization = vm.vuex_token;
-
-
-
-
-
-
-
-
-
-
-
-
- let noTokenList = ['/wechat/h5/user'];
- if(noTokenList.includes(config.url)) config.header.noToken = true;
-
-
-
- return config;
- }
-
- Vue.prototype.$u.http.interceptor.response = (res) => {
-
-
- console.log('interceptor res',res);
- if(res.retHead.errCode == 0) {
-
- return res;
- } else return false;
- }
- }
- export default {
- install
- }
|