diff --git a/buyer/.npmrc b/buyer/.npmrc new file mode 100644 index 00000000..c1abc22c --- /dev/null +++ b/buyer/.npmrc @@ -0,0 +1,5 @@ +# 默认依赖包指定淘宝源 +registry=https://registry.npm.taobao.org/ +sass_binary_site=https://npm.taobao.org/mirrors/node-sass/ +phantomjs_cdnurl=https://npm.taobao.org/mirrors/phantomjs/ +electron_mirror=https://npm.taobao.org/mirrors/electron/ \ No newline at end of file diff --git a/buyer/.yarnrc b/buyer/.yarnrc new file mode 100644 index 00000000..bd59a285 --- /dev/null +++ b/buyer/.yarnrc @@ -0,0 +1,5 @@ +registry "https://registry.npmmirror.com" +sass_binary_site "https://npmmirror.com/mirrors/node-sass" +phantomjs_cdnurl "https://npmmirror.com/mirrors/phantomjs" +electron_mirror "https://npmmirror.com/mirrors/electron" + diff --git a/buyer/src/config/index.js b/buyer/src/config/index.js index 17a6b2f3..7569684e 100644 --- a/buyer/src/config/index.js +++ b/buyer/src/config/index.js @@ -1,30 +1,12 @@ module.exports = { - /** - * @description 配置显示在浏览器标签的title、底部信息、部分信息展示的值 - */ - title: "lili-shop", - /** - * @description icp证 - */ - icpCard: "", - - company:{ - href:"https://pickmall.cn", - name:"北京宏业汇成科技有限公司" - }, - /** - * @description icp备案号 - */ - icpMessage: "京ICP备20009696号-1", - /** - * @description 是否使用国际化,默认为false - * 如果不使用,则需要在路由中给需要在菜单中展示的路由设置meta: {title: 'xxx'} - * 用来在菜单中显示文字 - */ - useI18n: false, - /** - * @description 高德web端申请的api key - */ - aMapKey: "b440952723253aa9fe483e698057bf7d", - + title: "lili-shop", //配置显示在浏览器标签的title、底部信息、部分信息展示的值 + icpCard: "", // icp证 + company: { + href: "https://pickmall.cn", + name: "北京宏业汇成科技有限公司", + }, //公司信息 + icpMessage: "京ICP备20009696号-1", //icp备案 + aMapKey: "b440952723253aa9fe483e698057bf7d", //高德web端申请的api key + enableCDN: true, //生产环境 是否启用cdn加载 vue等js + port:10000, //端口 }; diff --git a/buyer/vue.config.js b/buyer/vue.config.js index 4e99d3f4..34650b64 100644 --- a/buyer/vue.config.js +++ b/buyer/vue.config.js @@ -11,8 +11,8 @@ const configs = require('./src/config') * 将开发环境中替换为本地的内容,方便处理bug以及开启vueDev * 我们可以根据环境变量进行相应的处理,只有在产品的时候,才让插件去自动注入相应的资源文件到html页面 */ -// const enableProduction = process.env.NODE_ENV === "production"; // 是否生产环境 -const enableProduction = false // 统一取消cdn加载 目前cdn链接的https请求挂了 +const enableProduction = process.env.NODE_ENV === "production"; // 是否生产环境 + let externals = { vue: "Vue", @@ -54,8 +54,8 @@ let jsPlugin = [ }) ]; // 判断是否需要加载CDN -cdn = enableProduction ? cdn : { css: [], js: [] }; -externals = enableProduction ? externals : {}; +cdn = enableProduction && configs.enableCDN ? cdn : { css: [], js: [] }; +externals = enableProduction && configs.enableCDN ? externals : {}; jsPlugin = enableProduction ? jsPlugin : []; module.exports = { @@ -81,7 +81,7 @@ module.exports = { } }, devServer: { - port: 10000 + port: configs.port }, // 打包时不生成.map文件 避免看到源码 diff --git a/manager/.npmrc b/manager/.npmrc new file mode 100644 index 00000000..c1abc22c --- /dev/null +++ b/manager/.npmrc @@ -0,0 +1,5 @@ +# 默认依赖包指定淘宝源 +registry=https://registry.npm.taobao.org/ +sass_binary_site=https://npm.taobao.org/mirrors/node-sass/ +phantomjs_cdnurl=https://npm.taobao.org/mirrors/phantomjs/ +electron_mirror=https://npm.taobao.org/mirrors/electron/ \ No newline at end of file diff --git a/manager/.yarnrc b/manager/.yarnrc new file mode 100644 index 00000000..bd59a285 --- /dev/null +++ b/manager/.yarnrc @@ -0,0 +1,5 @@ +registry "https://registry.npmmirror.com" +sass_binary_site "https://npmmirror.com/mirrors/node-sass" +phantomjs_cdnurl "https://npmmirror.com/mirrors/phantomjs" +electron_mirror "https://npmmirror.com/mirrors/electron" + diff --git a/manager/src/config/index.js b/manager/src/config/index.js index a4299efc..67f42f81 100644 --- a/manager/src/config/index.js +++ b/manager/src/config/index.js @@ -1,14 +1,7 @@ -export default { - /** - * @description 配置显示在浏览器标签的title - */ - title: "lilishop", - /** - * @description 高德web端申请的api key - */ - aMapKey: "b440952723253aa9fe483e698057bf7d", - /** - * @description 官网地址 - */ - website: "https://www.pickmall.cn", +module.exports = { + title: "lilishop", //配置显示在浏览器标签的title + aMapKey: "b440952723253aa9fe483e698057bf7d", //高德web端申请的api key + website: "https://www.pickmall.cn", //官网地址 + enableCDN: true, //生产环境 是否启用cdn加载 vue等js + port:10003, //端口 }; diff --git a/manager/src/locale/lang/en-US.js b/manager/src/locale/lang/en-US.js index 146297a8..394f60dc 100644 --- a/manager/src/locale/lang/en-US.js +++ b/manager/src/locale/lang/en-US.js @@ -1,7 +1,5 @@ -import config from '@/config/index' export default { - lili: config.title, usernameLogin: 'UsernameLogin', mobileLogin: 'MobileLogin', autoLogin: 'Auto Login', diff --git a/manager/src/locale/lang/zh-CN.js b/manager/src/locale/lang/zh-CN.js index 1abc9eb8..bc5c2fac 100644 --- a/manager/src/locale/lang/zh-CN.js +++ b/manager/src/locale/lang/zh-CN.js @@ -1,6 +1,5 @@ -import config from '@/config/index' + export default { - lili: config.title, usernameLogin: '账户密码登录', mobileLogin: '手机号登录', autoLogin: '自动登录', diff --git a/manager/src/router/router.js b/manager/src/router/router.js index 8a7fcdf9..bbd13e62 100644 --- a/manager/src/router/router.js +++ b/manager/src/router/router.js @@ -1,5 +1,6 @@ import Main from "@/views/Main.vue"; -import config from '@/config/index' + +const config = require('@/config/index') // 不作为Main组件的子页面展示的页面单独写,如下 export const loginRouter = { path: "/login", diff --git a/manager/src/views/main-components/footer.vue b/manager/src/views/main-components/footer.vue index bf6a6caa..a363ffb3 100644 --- a/manager/src/views/main-components/footer.vue +++ b/manager/src/views/main-components/footer.vue @@ -13,7 +13,8 @@