Skip to content

Commit

Permalink
change env config
Browse files Browse the repository at this point in the history
  • Loading branch information
bailicangdu committed May 21, 2017
1 parent eb98ad2 commit 8b75556
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 33 deletions.
22 changes: 1 addition & 21 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1 @@
MIT License

Copyright (c) 2017 cangdu

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
GPL License
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

另外,这个项目和慕课网视频的那个饿了么没有任何关系,慕课网的项目只有一个页面,我在看完vue的官方文档后直接写了这个项目,没有参照任何人的代码,请大家不要混为一谈。

__注:此项目纯属个人瞎搞,正常下单请选择饿了么官方客户端。__
__注:此项目只用做vue的学习,请不要用于商业用途,正常下单请选择饿了么官方客户端。__


## 后台系统地址:
Expand Down Expand Up @@ -56,11 +56,9 @@ npm run dev


# 关于 demo 与 数据 的说明🤔
# 关于 数据 的说明🤔

1、下载代码运行后,因为开启了反向代理,可以获取真实的官方数据,最终可以进行下单(真实的下单,而不是模拟,下单后可以在官方App中查看并付款,亲自试过,且成功付款点餐),但是为了安全起见,登录的帐号为固定的帐号,以免泄露个人信息,不过照样可以点餐。

2、demo的数据为模拟的固定数据,只做为效果演示,因为反向代理必须在PC端运行代码才行。
下载代码运行后,因为开启了反向代理,可以获取真实的官方数据,最终可以进行下单(真实的下单,而不是模拟,下单后可以在官方App中查看并付款,亲自试过,且成功付款点餐),但是为了安全起见,登录的帐号为固定的帐号,以免泄露个人信息,不过照样可以点餐。


## 效果演示
Expand Down
4 changes: 2 additions & 2 deletions build/dev-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ compiler.plugin('compilation', function(compilation) {
var context = config.dev.context

switch(process.env.NODE_ENV){
case 'localapi': var proxypath = 'http://localhost:8001'; break;
case 'cangdu': var proxypath = 'http://cangdu.org:8001'; break;
case 'local': var proxypath = 'http://localhost:8001'; break;
case 'online': var proxypath = 'http://cangdu.org:8001'; break;
default: var proxypath = config.dev.proxypath; break;
}
var options = {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"license": "MIT",
"scripts": {
"dev": "node build/dev-server.js",
"local": "cross-env NODE_ENV=localapi node build/dev-server.js",
"cangdu": "cross-env NODE_ENV=cangdu node build/dev-server.js",
"local": "cross-env NODE_ENV=local node build/dev-server.js",
"online": "cross-env NODE_ENV=online node build/dev-server.js",
"build": "node build/build.js"
},
"dependencies": {
Expand Down
8 changes: 5 additions & 3 deletions src/config/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
* imgBaseUrl: 图片所在域名地址
*
*/
const localapi = false;
const proapi = false;
let localapi = false;
let proapi = false;
let baseUrl = '';
let routerMode = 'hash';
let imgBaseUrl = 'https://fuss10.elemecdn.com';
Expand All @@ -25,7 +25,9 @@ if (localapi) {
if (process.env.NODE_ENV == 'development') {

}else if(process.env.NODE_ENV == 'production'){
baseUrl = 'https://mainsite-restapi.ele.me';
proapi = true;
ApiUrl = 'http://localhost:8001';
imgBaseUrl = 'http://localhost:8001';
}

export {
Expand Down

0 comments on commit 8b75556

Please sign in to comment.