Files
smart-admin/smart-admin-h5/src/config/index.js
2020-11-29 23:35:57 +08:00

45 lines
1.3 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

console.log('project api url : ', process.env.VUE_APP_URL);
const isProductionEnv = ['production'].includes(process.env.NODE_ENV);
module.exports = {
// 配置显示在浏览器标签的title
title: 'Smart-Admin-H5',
// token在Cookie中存储的天数默认7天
cookieExpires: 7,
/**
* @description api请求基础路径
*/
baseUrl: {
apiUrl: process.env.VUE_APP_URL,
},
/**
* 打包后静态资源地址;如果是走cdn的话可以配置如下
* publicPath: isProd ? 'https://cdn.1024lab.net/static/smart-h5/' : '/'
*/
publicPath: isProductionEnv ? '/smart-admin-h5/' : '/',
// ==================== cdn 相关 begin ====================
cdn: {
cdnResource: {
css: [],
js: [
'https://cdn.bootcss.com/vue/2.6.11/vue.min.js',
'https://cdn.bootcss.com/vue-router/3.2.0/vue-router.min.js',
'https://cdn.bootcdn.net/ajax/libs/vuex/3.5.1/vuex.min.js',
'https://cdn.bootcss.com/axios/0.19.2/axios.min.js',
'https://cdn.bootcdn.net/ajax/libs/lodash.js/4.17.20/lodash.min.js'
]
},
// 指定资源加载cdn
externals: {
vue: 'Vue',
'vue-router': 'VueRouter',
vuex: 'Vuex',
axios: 'axios',
lodash: '_'
}
}
// ==================== cdn 相关 end ====================
};