ソースを参照

Change 移除无用的配置

enilu 6 年 前
コミット
5a452d085f

+ 7 - 5
README.md

@@ -19,7 +19,7 @@
 - flash-waimai-generate 代码生成模块
 
 ## 快速开始
-- 数据存储采用了mysql和mongodb,其中基础管理配置功能使用mysql,业务数据使用mongodb存储。
+- 数据存储采用了mysql和mongodb,其中基础管理配置功能数据使用mysql,业务数据使用mongodb存储。
 - 创建mysql数据库
 ```sql
     CREATE DATABASE IF NOT EXISTS waimai DEFAULT CHARSET utf8 COLLATE utf8_general_ci; 
@@ -29,18 +29,20 @@
 ```
 - mysql数据库创建好了之后,启动flash-waimai-api服务,会自动初始化数据,无需开发人员自己手动初始化数据
 - 安装mongodb并创建数据库:flash-waimai
-使用mongorestore命令  导入mongodb数据,由于测试数据量较大,打包放在了百度云盘:链接:https://pan.baidu.com/s/1mfO7yckFL7lMb_O0BPsviw   提取码:apgd 下载后将文件姐要到d:\\elm
+使用mongorestore命令  导入mongodb数据,由于测试数据量较大,打包放在了百度云盘:链接:https://pan.baidu.com/s/1mfO7yckFL7lMb_O0BPsviw   提取码:apgd 下载后将文件解压到d:\\elm,如下命令导入数据:
                                               
 ```
 mongorestore.exe -d flash-waimai d:\\elm
 ```
-- 下载测试图片:链接:https://pan.baidu.com/s/1rvZDspoapWa6rEq2D_5kzw 提取码:urzw ,将图片存放到t_sys_cfg表中system.file.upload.path配置的目录的目录
+- 下载项目测试数据的图片(商家和食品图片):链接:https://pan.baidu.com/s/1rvZDspoapWa6rEq2D_5kzw 提取码:urzw ,将图片存放到t_sys_cfg表中system.file.upload.path配置的目录
 
-- 启动管理平台,进入flash-waimai-manage目录:
+- 启动管理平台:
+    - 进入flash-waimai-manage目录:
     - 运行 npm install --registry=https://registry.npm.taobao.org
     - 运行npm run dev
     - 启动成功后访问 http://localhost:9528 ,登录,用户名密码:admin/admin
-- 启动手机端,进入flash-waimai-mobile目录:    
+- 启动手机端:
+    - 进入flash-waimai-mobile目录:    
     - 运行 npm install --registry=https://registry.npm.taobao.org
     - 运行npm run local
     - 启动成功后访问 http://localhost:8000

+ 1 - 1
flash-waimai-api/src/main/resources/import.sql

@@ -1977,7 +1977,7 @@ INSERT INTO `t_sys_file_info` VALUES ('1888', '-1', '2019-09-05 17:36:33', '-1',
 INSERT INTO `t_sys_file_info` VALUES ('1889', '-1', '2019-09-05 17:36:33', '-1', '2019-09-05 17:36:33', '食品图片', '16ab45884b939742.jpg');
 INSERT INTO `t_sys_file_info` VALUES ('1890', '-1', '2019-09-05 17:36:33', '-1', '2019-09-05 17:36:33', '食品图片', '16ab513cda439776.jpg');
 INSERT INTO `t_sys_file_info` VALUES ('1891', '-1', '2019-09-05 17:36:33', '-1', '2019-09-05 17:36:33', '食品图片', '16ab5163c0f39778.jpg');
-INSERT INTO `t_sys_file_info` VALUES ('1892', '-1', '2019-09-05 17:36:33', '-1', '2019-09-05 17:36:33', '食品图片', 'elm.cangdu.org');
+INSERT INTO `t_sys_file_info` VALUES ('1892', '-1', '2019-09-05 17:36:33', '-1', '2019-09-05 17:36:33', '食品图片', 'test');
 
 -- ----------------------------
 -- Records of t_sys_login_log

+ 6 - 25
flash-waimai-core/src/main/java/cn/enilu/flash/bean/vo/business/CityInfo.java

@@ -1,36 +1,17 @@
 package cn.enilu.flash.bean.vo.business;
 
+import lombok.Data;
+
+import java.io.Serializable;
+
 /**
  * Created  on 2017/12/29 0029.
  *
  * @author zt
  */
-public class CityInfo {
+@Data
+public class CityInfo implements Serializable {
     private String lat;
     private String lng;
     private String city;
-
-    public String getLat() {
-        return lat;
-    }
-
-    public void setLat(String lat) {
-        this.lat = lat;
-    }
-
-    public String getLng() {
-        return lng;
-    }
-
-    public void setLng(String lng) {
-        this.lng = lng;
-    }
-
-    public String getCity() {
-        return city;
-    }
-
-    public void setCity(String city) {
-        this.city = city;
-    }
 }

+ 2 - 1
flash-waimai-core/src/main/java/cn/enilu/flash/service/front/PositionService.java

@@ -31,8 +31,9 @@ public class PositionService {
     private AppConfiguration appConfiguration;
     @Autowired
     private MongoRepository mongoRepository;
-
+    @Cacheable(value = Cache.APPLICATION ,key = "#root.targetClass.simpleName+':'+#ip")
     public CityInfo getPostion(String ip) {
+        logger.info("根据ip:{}获取城市信息",ip);
         Map<String, String> map = Maps.newHashMap();
         map.put("ip", ip);
         map.put("key", appConfiguration.getTencentKey());

+ 0 - 12
flash-waimai-core/src/main/java/cn/enilu/flash/utils/HttpClients.java

@@ -14,7 +14,6 @@ import org.apache.http.client.utils.URLEncodedUtils;
 import org.apache.http.entity.StringEntity;
 import org.apache.http.impl.client.DefaultHttpClient;
 import org.apache.http.message.BasicNameValuePair;
-import org.nutz.lang.Files;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -243,15 +242,4 @@ public class HttpClients {
 
 	}
 
-	public static void main(String[] args) {
-		List<String> list = Files.readLines(new File("e:\\flash-waimai\\food_img.json"));
-
-		for(int i=0;i<list.size();i++){
-		String img = list.get(i);
-			downloadImg("http://elm.cangdu.org/img/"+img,"e:\\flash-waimai\\img\\foods\\"+img);
-		}
-		System.out.println(list.size());
-
-	}
-
 }

+ 5 - 5
flash-waimai-generate/src/main/resources/code/code.json

@@ -3,11 +3,11 @@
   "codeConfig": {
     "type": "cn.enilu.flash.code.CodeConfig",
     "fields": {
-      entityModel: "flash-core",
-      daoModel: "flash-core",
-      serviceModel: "flash-core",
-      controllerModel: "flash-api",
-      viewModel: "flash-vue-admin"
+      entityModel: "flash-waimai-core",
+      daoModel: "flash-waimai-core",
+      serviceModel: "flash-waimai-core",
+      controllerModel: "flash-waimai-api",
+      viewModel: "flash-waimai-manage"
     }
   }
 }

+ 0 - 4
flash-waimai-manage/src/api/business/food.js

@@ -4,7 +4,6 @@ import request from '@/utils/request'
  * 添加食品
  */
 
-// export const addFood = data => fetch('/shopping/addfood', data, 'POST');
 export function addFood(params) {
   return request({
     url: '/shopping/addfood',
@@ -16,7 +15,6 @@ export function addFood(params) {
  * 获取食品列表
  */
 
-// export const getFoods = data => fetch('/shopping/v2/foods', data)
 export function getFoods(params) {
   return request({
     url: '/shopping/v2/foods',
@@ -29,7 +27,6 @@ export function getFoods(params) {
  * 更新食品信息
  */
 
-// export const updateFood = data => fetch('/shopping/v2/updatefood', data, 'POST');
 export function updateFood(params) {
   return request({
     url: '/shopping/v2/updatefood',
@@ -42,7 +39,6 @@ export function updateFood(params) {
  * 删除食品
  */
 
-// export const deleteFood = food_id => fetch('/shopping/v2/food/' + food_id, {}, 'DELETE');
 export function deleteFood(id) {
   return request({
     url: '/shopping/v2/food/' + id,

+ 0 - 25
flash-waimai-manage/src/config/env.js

@@ -1,25 +0,0 @@
-/**
- * 配置编译环境和线上环境之间的切换
- * 
- * baseUrl: 域名地址
- * routerMode: 路由模式
- * baseImgPath: 图片存放地址
- * 
- */
-let baseUrl = ''; 
-let routerMode = 'hash';
-let baseImgPath;
-
-if (process.env.NODE_ENV == 'development') {
-	baseUrl = '';
-    baseImgPath = '/img/';
-}else{
-	baseUrl = '//elm.cangdu.org';
-    baseImgPath = '//elm.cangdu.org/img/';
-}
-
-export {
-	baseUrl,
-	routerMode,
-	baseImgPath
-}

+ 0 - 3
flash-waimai-manage/src/views/business/food/food.js

@@ -1,5 +1,4 @@
 import { getApiUrl } from '@/utils/utils'
-import { baseUrl, baseImgPath } from '@/config/env'
 import { getToken } from '@/utils/auth'
 
 import { getFoods, updateFood, deleteFood } from '@/api/business/food'
@@ -9,8 +8,6 @@ import { Loading } from 'element-ui'
 export default {
   data() {
     return {
-      baseUrl,
-      baseImgPath,
       fileMgrUrl: '',
       uploadHeaders: {
         'Authorization': ''

+ 1 - 1
flash-waimai-mobile/build/dev-server.js

@@ -38,7 +38,7 @@ var context = config.dev.context
 
 switch(process.env.NODE_ENV){
     case 'local': var proxypath = 'http://localhost:8082'; break;
-    case 'online': var proxypath = 'http://elm.cangdu.org'; break;
+    case 'online': var proxypath = 'http://waimai-api.microapp.store'; break;
     default:  var proxypath = config.dev.proxypath;
 }
 var options = {

+ 1 - 1
flash-waimai-mobile/config/index.js

@@ -40,7 +40,7 @@ module.exports = {
             '/file',
             '/position'
         ],
-        proxypath: 'http://localhost:8082',//http://cangdu.org:8001
+        proxypath: 'http://localhost:8082',
         // CSS Sourcemaps off by default because relative paths are "buggy"
         // with this option, according to the CSS-Loader README
         // (https://github.com/webpack/css-loader#sourcemaps)

+ 0 - 2
flash-waimai-mobile/index.html

@@ -8,8 +8,6 @@
     <meta name="format-detection" content="telephone=no">
     <meta name="full-screen" content="yes">
     <meta name="x5-fullscreen" content="true">
-    <link rel="dns-prefetch" href="//cangdu.org">
-    <link rel="dns-prefetch" href="//elm.cangdu.org">
     <title>elm</title>
   </head>
   <body>

+ 3 - 2
flash-waimai-mobile/src/components/common/mixin.js

@@ -72,7 +72,8 @@ export const getImgPath = {
 		getImgPath(path) {
 			let suffix;
 			if (!path) {
-				return '//elm.cangdu.org/img/default.jpg'
+			  //这里设置一个默认图片
+				return '//waimai-api.microapp.store/file/getImgStream?fileName=16a6d42c05334033.png'
 			}
 			if (path.indexOf('jpeg') !== -1) {
 				suffix = '.jpeg'
@@ -84,4 +85,4 @@ export const getImgPath = {
 		},
 	}
 
-}
+}

+ 10 - 11
flash-waimai-mobile/src/config/env.js

@@ -1,27 +1,26 @@
 /**
  * 配置编译环境和线上环境之间的切换
- * 
+ *
  * baseUrl: 域名地址
  * routerMode: 路由模式
  * imgBaseUrl: 图片所在域名地址
- * 
+ *
  */
 
-let baseUrl = ''; 
+let baseUrl = '';
 let routerMode = 'hash';
 let imgBaseUrl = '';
 
 
 if (process.env.NODE_ENV == 'development') {
-    // imgBaseUrl = '/img/';
-        imgBaseUrl = '/file/getImgStream?fileName='  
-}else if(process.env.NODE_ENV == 'production'){
-	baseUrl = '//waimai-api.microapp.store';
-    imgBaseUrl = '//waimai-api.microapp.store/file/getImgStream?fileName=';
+  imgBaseUrl = '/file/getImgStream?fileName='
+} else if (process.env.NODE_ENV == 'production') {
+  baseUrl = '//waimai-api.microapp.store';
+  imgBaseUrl = '//waimai-api.microapp.store/file/getImgStream?fileName=';
 }
 
 export {
-	baseUrl,
-	routerMode,
-	imgBaseUrl,
+  baseUrl,
+  routerMode,
+  imgBaseUrl,
 }

+ 16 - 13
flash-waimai-mobile/src/page/download/download.vue

@@ -43,20 +43,23 @@
         props:[],
         methods: {
             download(){
+              this.showAlert = true;
+              this.alertText = '咱无提供'
+
                 //如果是ios用户则提示,否则直接下载
-                if( this.system == 'IOS'){
-                    this.showAlert = true;
-                    this.alertText = 'IOS用户请前往AppStore下载'
-                }else{
-                    try {
-                        let elemIF = document.createElement("iframe");
-                        elemIF.src = 'http://cangdu.org/files/elm.apk';
-                        elemIF.style.display = "none";
-                        document.body.appendChild(elemIF);
-                    } catch (e) {
-                        alert('下载失败')
-                    }
-                }
+                // if( this.system == 'IOS'){
+                //     this.showAlert = true;
+                //     this.alertText = 'IOS用户请前往AppStore下载'
+                // }else{
+                //     try {
+                //         let elemIF = document.createElement("iframe");
+                //         elemIF.src = 'http://microapp.store/files/elm.apk';
+                //         elemIF.style.display = "none";
+                //         document.body.appendChild(elemIF);
+                //     } catch (e) {
+                //         alert('下载失败')
+                //     }
+                // }
             }
         }
     }