Browse Source

Change merge code

enilu 6 years ago
parent
commit
79c66de071
38 changed files with 217 additions and 277 deletions
  1. 1 1
      .gitignore
  2. 21 9
      README.md
  3. BIN
      doc/admin.gif
  4. BIN
      doc/mobile.gif
  5. 2 1
      flash-waimai-api/pom.xml
  6. 1 1
      flash-waimai-api/src/main/java/cn/enilu/flash/api/controller/FileController.java
  7. 19 8
      flash-waimai-api/src/main/java/cn/enilu/flash/api/controller/business/CaptchaController.java
  8. 0 62
      flash-waimai-api/src/main/java/cn/enilu/flash/api/controller/business/File2Controller.java
  9. 14 2
      flash-waimai-api/src/main/java/cn/enilu/flash/api/controller/business/FoodController.java
  10. 5 4
      flash-waimai-api/src/main/java/cn/enilu/flash/api/controller/business/RatingController.java
  11. 1 2
      flash-waimai-api/src/main/java/cn/enilu/flash/api/controller/business/ShopController.java
  12. 55 53
      flash-waimai-api/src/main/java/cn/enilu/flash/api/controller/business/User2Controller.java
  13. 7 13
      flash-waimai-api/src/main/resources/application-dev.properties
  14. 0 28
      flash-waimai-api/src/main/resources/application-local.properties
  15. 20 7
      flash-waimai-api/src/main/resources/application-prod.properties
  16. 1 1
      flash-waimai-api/src/main/resources/logback.xml
  17. 1 5
      flash-waimai-core/src/main/java/cn/enilu/flash/bean/AppConfiguration.java
  18. 1 0
      flash-waimai-core/src/main/java/cn/enilu/flash/bean/vo/business/LoginVo.java
  19. 7 2
      flash-waimai-core/src/main/java/cn/enilu/flash/cache/TokenCache.java
  20. 0 3
      flash-waimai-core/src/main/java/cn/enilu/flash/service/system/FileService.java
  21. 6 6
      flash-waimai-core/src/main/java/cn/enilu/flash/service/task/TaskService.java
  22. 1 1
      flash-waimai-manage/config/prod.env.js
  23. 0 2
      flash-waimai-manage/src/permission.js
  24. 0 3
      flash-waimai-manage/src/views/business/shop/add.js
  25. 2 1
      flash-waimai-manage/src/views/business/shop/index.vue
  26. 11 15
      flash-waimai-manage/src/views/business/shop/shop.js
  27. 4 1
      flash-waimai-mobile/build/webpack.base.conf.js
  28. 1 1
      flash-waimai-mobile/config/index.js
  29. BIN
      flash-waimai-mobile/favicon.ico
  30. 1 1
      flash-waimai-mobile/package.json
  31. 3 5
      flash-waimai-mobile/src/config/env.js
  32. 0 7
      flash-waimai-mobile/src/main.js
  33. 6 3
      flash-waimai-mobile/src/page/login/login.vue
  34. 2 1
      flash-waimai-mobile/src/page/order/order.vue
  35. 2 4
      flash-waimai-mobile/src/page/shop/children/foodDetail.vue
  36. 1 2
      flash-waimai-mobile/src/page/shop/children/shopDetail.vue
  37. 20 21
      flash-waimai-mobile/src/page/shop/shop.vue
  38. 1 1
      flash-waimai-mobile/src/service/getData.js

+ 1 - 1
.gitignore

@@ -12,4 +12,4 @@ target
 .project
 launch.json
 .vscode
-dist
+dist

+ 21 - 9
README.md

@@ -11,6 +11,13 @@
 - 前端:Vue.js
 - 数据库:mysql5.5以上,Mongodb4.0(不要使用最新版4.2)
 
+## 模块
+- flash-waimai-mobile 手机端站点
+- flash-waimai-manage后台管理系统
+- flash-waimai-api java接口服务
+- flash-waimai-core 底层核心模块
+- flash-waimai-generate 代码生成模块
+
 ## 快速开始
 - 数据存储采用了mysql和mongodb,其中基础管理配置功能使用mysql,业务数据使用mongodb存储。
 - 创建mysql数据库
@@ -27,6 +34,8 @@
 ```
 mongorestore.exe -d flash-waimai d:\\elm
 ```
+- 下载测试图片:链接:https://pan.baidu.com/s/1rvZDspoapWa6rEq2D_5kzw 提取码:urzw ,将图片存放到t_sys_cfg表中system.file.upload.path配置的目录的目录
+
 - 启动管理平台,进入flash-waimai-manage目录:
     - 运行 npm install --registry=https://registry.npm.taobao.org
     - 运行npm run dev
@@ -36,15 +45,18 @@ mongorestore.exe -d flash-waimai d:\\elm
     - 运行npm run local
     - 启动成功后访问 http://localhost:8000
 
-## 模块
+## 运行效果图
+- 后台管理
+![admin](doc/admin.gif)
+- 手机端    
+![mobile](doc/mobile.gif)
 
-- flash-waimai-mobile 手机端站点
-- flash-waimai-manage后台管理系统
-- flash-waimai-api java接口服务
-- flash-waimai-core 底层核心模块
-- flash-waimai-generate 代码生成模块
-    
-## 目前还在开发中
+## 在线演示
+- 查看演示系统请不要随意删除数据
+- 后台管理:[http://waimai-admin.microapp.store](http://waimai-admin.microapp.store)
+- 手机端:[http://waimai-mobile.microapp.store](http://waimai-mobile.microapp.store)
+- 
+## 开发进度
 - flash-waimai-manage [初步完成]
 - flash-waimai-mobile[完善中]
 
@@ -52,7 +64,7 @@ mongorestore.exe -d flash-waimai d:\\elm
 - 感谢[bailicangdu](https://github.com/bailicangdu),[enilu](https://github.com/enilu),本项目参考参考借鉴了[vue2-elm](https://github.com/bailicangdu/vue2-elm),[web-flash](https://github.com/enilu/web-flash),[vue2-manage](https://github.com/bailicangdu/vue2-manage)
 
 ## 交流
-- QQ:936439613
+- QQ:936439613 微信:myenilu
 # License
 
 [GPL](https://github.com/microapp-store/flash-waimai/blob/master/COPYING)

BIN
doc/admin.gif


BIN
doc/mobile.gif


+ 2 - 1
flash-waimai-api/pom.xml

@@ -7,6 +7,7 @@
         <groupId>cn.enilu</groupId>
         <version>1.0</version>
     </parent>
+    <packaging>war</packaging>
     <modelVersion>4.0.0</modelVersion>
 
     <artifactId>flash-waimai-api</artifactId>
@@ -32,7 +33,7 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-war-plugin</artifactId>
                 <configuration>
-                    <warName>api</warName>
+                    <warName>waimai-api</warName>
                     <failOnMissingWebXml>false</failOnMissingWebXml>
                 </configuration>
             </plugin>

+ 1 - 1
flash-waimai-api/src/main/java/cn/enilu/flash/api/controller/FileController.java

@@ -150,7 +150,7 @@ public class FileController extends BaseController {
             out.write(b);
             out.flush();
         } catch (Exception e) {
-            logger.error("getImgStream error",e);
+            logger.error("文件不存在",e.getMessage());
         } finally {
             if (fis != null) {
                 try {

+ 19 - 8
flash-waimai-api/src/main/java/cn/enilu/flash/api/controller/business/CaptchaController.java

@@ -2,7 +2,12 @@ package cn.enilu.flash.api.controller.business;
 
 import cn.enilu.flash.api.controller.BaseController;
 import cn.enilu.flash.bean.vo.front.Rets;
+import cn.enilu.flash.cache.TokenCache;
 import cn.enilu.flash.utils.CaptchaCode;
+import cn.enilu.flash.utils.Maps;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
@@ -13,6 +18,7 @@ import java.awt.image.BufferedImage;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.util.Map;
+import java.util.UUID;
 
 /**
  * Created  on 2018/1/5 0005.
@@ -21,21 +27,26 @@ import java.util.Map;
  */
 @RestController
 public class CaptchaController extends BaseController {
-    @RequestMapping(value = "/v1/captchas",method = RequestMethod.POST)
-    public Object get() throws IOException {
-        ByteArrayOutputStream outputStream =  new ByteArrayOutputStream();
-        Map<String,Object> map = CaptchaCode.getImageCode(60, 20, outputStream);
 
-        setSession(CaptchaCode.CAPTCH_KEY, map.get("strEnsure").toString().toLowerCase());
-        setSession("codeTime",System.currentTimeMillis());
+    private static Logger logger = LoggerFactory.getLogger(CaptchaController.class);
+    @Autowired
+    private TokenCache tokenCache;
+
+    @RequestMapping(value = "/v1/captchas", method = RequestMethod.POST)
+    public Object get() throws IOException {
+        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+        Map<String, Object> map = CaptchaCode.getImageCode(60, 20, outputStream);
+        String captchCodeId = UUID.randomUUID().toString();
+        tokenCache.put(captchCodeId, map.get("strEnsure").toString().toLowerCase());
+        logger.info("captchCode:{}", map.get("strEnsure").toString().toLowerCase());
         try {
             ImageIO.write((BufferedImage) map.get("image"), "png", outputStream);
             BASE64Encoder encoder = new BASE64Encoder();
             String base64 = encoder.encode(outputStream.toByteArray());
             String captchaBase64 = "data:image/png;base64," + base64.replaceAll("\r\n", "");
-           return Rets.success("code",captchaBase64);
+            return Rets.success(Maps.newHashMap("captchCodeId",captchCodeId,"code",captchaBase64));
         } catch (IOException e) {
-           return Rets.failure(e.getMessage());
+            return Rets.failure(e.getMessage());
         }
 
     }

+ 0 - 62
flash-waimai-api/src/main/java/cn/enilu/flash/api/controller/business/File2Controller.java

@@ -1,62 +0,0 @@
-package cn.enilu.flash.api.controller.business;
-
-import cn.enilu.flash.api.controller.BaseController;
-import cn.enilu.flash.bean.AppConfiguration;
-import cn.enilu.flash.bean.vo.front.Rets;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.core.io.ResourceLoader;
-import org.springframework.http.ResponseEntity;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-
-/**
- * Created  on 2018/1/2 0002.
- *
- * @author zt
- */
-@Controller
-public class File2Controller extends BaseController {
-    private static final Logger log = LoggerFactory.getLogger(File2Controller.class);
-
-    @Autowired
-    private AppConfiguration appConfiguration;
-    @Autowired
-    private  ResourceLoader resourceLoader;
-    @RequestMapping(method = RequestMethod.POST, value = "/v1/addimg/{type}")
-    @ResponseBody
-    public Object add(@PathVariable("type") String type, @RequestParam("file") MultipartFile file) {
-        if (!file.isEmpty()) {
-            try {
-                String fileName= type+"_"+System.currentTimeMillis()+"."+file.getOriginalFilename().split("\\.")[1];
-                Files.copy(file.getInputStream(), Paths.get(appConfiguration.getImgDir(), fileName));
-                return Rets.success("image_path",fileName);
-            } catch (IOException | RuntimeException e) {
-                e.printStackTrace();
-
-            }
-        }
-        return Rets.failure();
-
-
-    }
-
-    @RequestMapping(method = RequestMethod.GET, value = "/img/{filename:.+}")
-    @ResponseBody
-    public ResponseEntity<?> get(@PathVariable String filename) {
-
-        try {
-            return ResponseEntity.ok(resourceLoader.getResource("file:" + Paths.get(appConfiguration.getImgDir(), filename).toString()));
-        } catch (Exception e) {
-            return ResponseEntity.notFound().build();
-        }
-    }
-
-
-}

+ 14 - 2
flash-waimai-api/src/main/java/cn/enilu/flash/api/controller/business/FoodController.java

@@ -5,6 +5,7 @@ import cn.enilu.flash.bean.constant.factory.PageFactory;
 import cn.enilu.flash.bean.entity.front.Food;
 import cn.enilu.flash.bean.entity.front.Ids;
 import cn.enilu.flash.bean.entity.front.KeyValue;
+import cn.enilu.flash.bean.entity.front.Menu;
 import cn.enilu.flash.bean.entity.front.SpecFood;
 import cn.enilu.flash.bean.vo.business.FoodVo;
 import cn.enilu.flash.bean.vo.business.SpecVo;
@@ -86,9 +87,11 @@ public class FoodController extends BaseController {
         food.setPinyin_name(StringUtils.getPingYin(food.getName()));
         food.setSatisfy_rate(new BigDecimal(Math.ceil(Math.random() * 100)).setScale(1,BigDecimal.ROUND_HALF_UP).doubleValue());
         food.setSatisfy_count(new BigDecimal(Math.ceil(Math.random() * 1000)).setScale(1,BigDecimal.ROUND_HALF_UP).doubleValue());
-        food.setRating(new BigDecimal(Math.random() * 5).setScale(1,BigDecimal.ROUND_HALF_UP).doubleValue());
-        System.out.println(Json.toJson(food));
+        food.setRating(new BigDecimal(Math.random() * 5).setScale(1,BigDecimal.ROUND_HALF_UP).doubleValue());        
         mongoRepository.save(food);
+        Menu menu = mongoRepository.findOne(Menu.class,food.getCategory_id());
+        menu.getFoods().add(food);
+        mongoRepository.update(menu);
         return Rets.success();
     }
     @RequestMapping(value="/v2/foods",method = RequestMethod.GET)
@@ -134,6 +137,15 @@ public class FoodController extends BaseController {
         old.setImage_path(food.getImagePath());
         old.setSpecfoods(specList);
         mongoRepository.update(old);
+        Menu menu = mongoRepository.findOne(Menu.class,old.getCategory_id());
+        for(Food item:menu.getFoods()){
+            if(item.getItem_id().intValue() == old.getItem_id().intValue()){
+                menu.getFoods().remove(item);
+                menu.getFoods().add(old);
+                break;
+            }
+        }
+        mongoRepository.update(menu);
         return Rets.success();
     }
 

+ 5 - 4
flash-waimai-api/src/main/java/cn/enilu/flash/api/controller/business/RatingController.java

@@ -1,6 +1,7 @@
 package cn.enilu.flash.api.controller.business;
 
 import cn.enilu.flash.api.controller.BaseController;
+import cn.enilu.flash.bean.vo.front.Rets;
 import cn.enilu.flash.dao.MongoRepository;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PathVariable;
@@ -19,17 +20,17 @@ import java.util.Map;
 public class RatingController extends BaseController {
     @Autowired
     private MongoRepository mongoRepository;
-    @RequestMapping(value = "/ugc/v2/restaurants/${restaurant_id}/ratings",method = RequestMethod.GET)
+    @RequestMapping(value = "/ugc/v2/restaurants/{restaurant_id}/ratings",method = RequestMethod.GET)
     public Object ratings(@PathVariable("restaurant_id")Long restaurantId){
         Map map = mongoRepository.findOne("ratings","restaurant_id",restaurantId);
-        return map.get("ratings");
+        return Rets.success(map.get("ratings"));
     }
-    @RequestMapping(value = "ugc/v2/restaurants/${restaurant_id}/ratings/scores",method = RequestMethod.GET)
+    @RequestMapping(value = "ugc/v2/restaurants/{restaurant_id}/ratings/scores",method = RequestMethod.GET)
     public Object score(@PathVariable("restaurant_id")Long restaurantId){
         Map map = mongoRepository.findOne("ratings","restaurant_id",restaurantId);
         return map.get("scores");
     }
-    @RequestMapping(value = "ugc/v2/restaurants/${restaurant_id}/ratings/tags",method = RequestMethod.GET)
+    @RequestMapping(value = "ugc/v2/restaurants/{restaurant_id}/ratings/tags",method = RequestMethod.GET)
     public Object tags(@PathVariable("restaurant_id")Long restaurantId){
         Map map = mongoRepository.findOne("ratings","restaurant_id",restaurantId);
         return map.get("tags");

+ 1 - 2
flash-waimai-api/src/main/java/cn/enilu/flash/api/controller/business/ShopController.java

@@ -248,8 +248,7 @@ public class ShopController extends BaseController {
     }
 
     @RequestMapping(value = "/v2/menu", method = RequestMethod.GET)
-
-    public Object getMenu(@RequestParam("restaurant_id") Long restaurantId, @RequestParam("allMenu") boolean allMEnu) {
+    public Object getMenu(@RequestParam("restaurant_id") Long restaurantId, @RequestParam(name="allMenu",required=false) boolean allMEnu) {
         return Rets.success(mongoRepository.findAll("menus", "restaurant_id", restaurantId));
     }
 

+ 55 - 53
flash-waimai-api/src/main/java/cn/enilu/flash/api/controller/business/User2Controller.java

@@ -7,6 +7,7 @@ import cn.enilu.flash.bean.entity.front.Ids;
 import cn.enilu.flash.bean.vo.business.CityInfo;
 import cn.enilu.flash.bean.vo.business.LoginVo;
 import cn.enilu.flash.bean.vo.front.Rets;
+import cn.enilu.flash.cache.TokenCache;
 import cn.enilu.flash.dao.MongoRepository;
 import cn.enilu.flash.service.front.IdsService;
 import cn.enilu.flash.service.front.PositionService;
@@ -19,11 +20,7 @@ import org.nutz.mapl.Mapl;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import java.util.Date;
 import java.util.List;
@@ -42,99 +39,104 @@ public class User2Controller extends BaseController {
     private IdsService idsService;
     @Autowired
     private PositionService positionService;
+    @Autowired
+    private TokenCache tokenCache;
 
-    @RequestMapping(value = "/v1/user",method = RequestMethod.GET)
-    public Object getUser(){
+    @RequestMapping(value = "/v1/user", method = RequestMethod.GET)
+    public Object getUser() {
         return getSession("currentUser");
     }
+
     @RequestMapping(method = RequestMethod.GET)
-    public Object getUser(@RequestParam("user_id") Long userId){
+    public Object getUser(@RequestParam("user_id") Long userId) {
         return getSession("currentUser");
     }
-    @RequestMapping(value = "/list",method = RequestMethod.GET)
-    public Object list(@RequestParam("offset") Integer offset,@RequestParam("limit") Integer limit){
+
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    public Object list(@RequestParam("offset") Integer offset, @RequestParam("limit") Integer limit) {
         List list = mongoRepository.findAll("userinfos");
         return list;
     }
-    @RequestMapping(value = "/count",method = RequestMethod.GET)
-    public Object count(){
-        return Rets.success("count",2);
+
+    @RequestMapping(value = "/count", method = RequestMethod.GET)
+    public Object count() {
+        return Rets.success("count", 2);
     }
 
-    @RequestMapping(value = "/v2/login",method = RequestMethod.POST)
-    public Object login(@RequestBody LoginVo loginVo){
-        String captch = (String) getSession(CaptchaCode.CAPTCH_KEY);
-        if(!Strings.equals(loginVo.getCaptchaCode(),captch)){
-            return Rets.failure(Maps.newHashMap("type","ERROR_CAPTCHA","message","验证码不正确"));
+    @RequestMapping(value = "/v2/login", method = RequestMethod.POST)
+    public Object login(@RequestBody LoginVo loginVo) {
+        String captchCode =   tokenCache.get(loginVo.getCaptchCodeId(),String.class);
+        if (!Strings.equals(loginVo.getCaptchaCode(), captchCode)) {
+            return Rets.failure(Maps.newHashMap("type", "ERROR_CAPTCHA", "message", "验证码不正确"));
         }
-        Map user = mongoRepository.findOne("users","username",loginVo.getUsername());
-        String newPassword = MD5.getMD5String(MD5.getMD5String(loginVo.getPassword()).substring(2,7)+MD5.getMD5String(loginVo.getPassword()));
-        if(user==null){
+        Map user = mongoRepository.findOne("users", "username", loginVo.getUsername());
+        String newPassword = MD5.getMD5String(MD5.getMD5String(loginVo.getPassword()).substring(2, 7) + MD5.getMD5String(loginVo.getPassword()));
+        if (user == null) {
             FrontUser frontUser = new FrontUser();
             frontUser.setUser_id(idsService.getId(Ids.USER_ID));
-            frontUser.setUsername(loginVo.getUsername());                         
+            frontUser.setUsername(loginVo.getUsername());
             frontUser.setPassword(newPassword);
-            mongoRepository.save(frontUser); 
+            mongoRepository.save(frontUser);
             FrontUserInfo userInfo = new FrontUserInfo();
             userInfo.setId(frontUser.getUser_id());
             userInfo.setUser_id(frontUser.getUser_id());
-            userInfo.setRegiste_time(DateUtil.format(new Date(),"yyyy-MM-dd HH:mm"));
+            userInfo.setRegiste_time(DateUtil.format(new Date(), "yyyy-MM-dd HH:mm"));
             String ip = getIp();
             CityInfo cityInfo = positionService.getPostion(ip);
             userInfo.setCity(cityInfo.getCity());
             userInfo.setUsername(frontUser.getUsername());
             mongoRepository.save(userInfo);
             Object result = Mapl.merge(frontUser, userInfo);
-            setSession("currentUser",result);
+            setSession("currentUser", result);
             return frontUser;
-        }else{            
-            if(newPassword.equals(user.get("password"))){
+        } else {
+            if (newPassword.equals(user.get("password"))) {
                 Map userInfo = mongoRepository.findOne("userinfos", "user_id", Long.valueOf(user.get("user_id").toString()));
                 Object result = Mapl.merge(user, userInfo);
-                setSession("currentUser",result);
+                setSession("currentUser", result);
                 return result;
-            }else{
-                return Rets.failure(Maps.newHashMap("type","ERROR_PASSWORD","message","密码错误"));
+            } else {
+                return Rets.failure(Maps.newHashMap("type", "ERROR_PASSWORD", "message", "密码错误"));
             }
-            
+
         }
-        
+
 
     }
-    @RequestMapping(value = "/v2/signout",method = RequestMethod.GET)
-    public Object signOut(){
+
+    @RequestMapping(value = "/v2/signout", method = RequestMethod.GET)
+    public Object signOut() {
         getRequest().getSession().removeAttribute("currentUser");
         return Rets.success();
     }
-    @RequestMapping(value = "/v2/changepassword",method = RequestMethod.POST)
-    public Object changePassword(@RequestParam("username")String userName,
-                                 @RequestParam("oldpassWord")String oldPassword,
-                                 @RequestParam("newpassword")String newPassword,
-                                 @RequestParam("confirmpassword")String confirmPassword,
-                                 @RequestParam("captcha_code")String captchaCode){
+
+    @RequestMapping(value = "/v2/changepassword", method = RequestMethod.POST)
+    public Object changePassword(@RequestParam("username") String userName,
+                                 @RequestParam("oldpassWord") String oldPassword,
+                                 @RequestParam("newpassword") String newPassword,
+                                 @RequestParam("confirmpassword") String confirmPassword,
+                                 @RequestParam("captcha_code") String captchaCode) {
 
         String captch = (String) getSession(CaptchaCode.CAPTCH_KEY);
-        if(!Strings.equals(captchaCode,captch)){
-            return Rets.failure(Maps.newHashMap("type","ERROR_CAPTCHA","message","验证码不正确"));
+        if (!Strings.equals(captchaCode, captch)) {
+            return Rets.failure(Maps.newHashMap("type", "ERROR_CAPTCHA", "message", "验证码不正确"));
         }
-        Map user = mongoRepository.findOne("users","username",userName);
-        if(user==null){
-            return Rets.failure(Maps.newHashMap("type","ERROR_QUERY","message","用户不存在"));
+        Map user = mongoRepository.findOne("users", "username", userName);
+        if (user == null) {
+            return Rets.failure(Maps.newHashMap("type", "ERROR_QUERY", "message", "用户不存在"));
         }
-        if(!Strings.equals(oldPassword,Strings.sNull(user.get("password")))){
-            return Rets.failure(Maps.newHashMap("type","ERROR_QUERY","message","原密码错误"));
+        if (!Strings.equals(oldPassword, Strings.sNull(user.get("password")))) {
+            return Rets.failure(Maps.newHashMap("type", "ERROR_QUERY", "message", "原密码错误"));
         }
-        if(Strings.equals(newPassword,confirmPassword)){
-            return Rets.failure(Maps.newHashMap("type","ERROR_QUERY","message","新密码不一致"));
+        if (Strings.equals(newPassword, confirmPassword)) {
+            return Rets.failure(Maps.newHashMap("type", "ERROR_QUERY", "message", "新密码不一致"));
         }
 
-        user.put("password",newPassword);
-        mongoRepository.update(Long.valueOf(user.get("id").toString()),"users",user);
+        user.put("password", newPassword);
+        mongoRepository.update(Long.valueOf(user.get("id").toString()), "users", user);
 
         return Rets.success();
     }
 
 
-
-
 }

+ 7 - 13
flash-waimai-api/src/main/resources/application-dev.properties

@@ -1,29 +1,23 @@
 ## 开发环境配置
 debug=true
-spring.datasource.url=jdbc:mysql://my-db:3306/waimai?useUnicode=true&characterEncoding=UTF8
-spring.datasource.username=waimai
-spring.datasource.password=waimai123
-
-#spring.jpa.hibernate.ddl-auto=create
+spring.datasource.url=jdbc:mysql://localhost:3306/flash-waimai?useUnicode=true&characterEncoding=UTF8
+spring.datasource.username=root
+spring.datasource.password=root
+# 开启该配置自动创建数据库
+spring.jpa.hibernate.ddl-auto=create
 #默认使用InnoDB引擎
 spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
 spring.datasource.sql-script-encoding=utf-8
 spring.jpa.show-sql=true
 #server.servlet.context-path=/api
 
-spring.data.mongodb.uri=mongodb://my-db:27017/flash-waimai
-spring.data.mongodb.username=enilu
-spring.data.mongodb.password=enilu123456
+spring.data.mongodb.uri=mongodb://localhost:27017/flash-waimai
+
 
 ##全局参数
 cfg.tencentkey=RLHBZ-WMPRP-Q3JDS-V2IQA-JNRFH-EJBHL
 cfg.tencentkey2=RRXBZ-WC6KF-ZQSJT-N2QU7-T5QIT-6KF5X
 cfg.tencentkey3=OHTBZ-7IFRG-JG2QF-IHFUK-XTTK6-VXFBN
-cfg.baidukey=fjke3YUipM9N64GdOIh1DNeK2APO2WcT
-cfg.baidukey2=fjke3YUipM9N64GdOIh1DNeK2APO2WcT
 
 ## api
 api.qq.map.url=https://apis.map.qq.com/ws/
-
-## 图片地址
-img.dir=/data/springboot-elm/img/

+ 0 - 28
flash-waimai-api/src/main/resources/application-local.properties

@@ -1,28 +0,0 @@
-## 开发环境配置
-debug=true
-spring.datasource.url=jdbc:mysql://localhost:3306/flash-waimai?useUnicode=true&characterEncoding=UTF8
-spring.datasource.username=root
-spring.datasource.password=root
-
-#spring.jpa.hibernate.ddl-auto=create
-#默认使用InnoDB引擎
-spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
-spring.datasource.sql-script-encoding=utf-8
-spring.jpa.show-sql=true
-#server.servlet.context-path=/api
-
-spring.data.mongodb.uri=mongodb://localhost:27017/flash-waimai
-
-
-##全局参数
-cfg.tencentkey=RLHBZ-WMPRP-Q3JDS-V2IQA-JNRFH-EJBHL
-cfg.tencentkey2=RRXBZ-WC6KF-ZQSJT-N2QU7-T5QIT-6KF5X
-cfg.tencentkey3=OHTBZ-7IFRG-JG2QF-IHFUK-XTTK6-VXFBN
-cfg.baidukey=fjke3YUipM9N64GdOIh1DNeK2APO2WcT
-cfg.baidukey2=fjke3YUipM9N64GdOIh1DNeK2APO2WcT
-
-## api
-api.qq.map.url=https://apis.map.qq.com/ws/
-
-## 图片地址
-img.dir=/data/springboot-elm/img/

+ 20 - 7
flash-waimai-api/src/main/resources/application-prod.properties

@@ -1,11 +1,24 @@
-## 生产环境配置
-debug=false
-spring.datasource.url=jdbc:mysql://localhost:3306/webflash?useUnicode=true&characterEncoding=UTF8
-spring.datasource.username=webflash
-spring.datasource.password=webflash190602
+## 开发环境配置
+debug=true
+spring.datasource.url=jdbc:mysql://my-db:3306/waimai?useUnicode=true&characterEncoding=UTF8
+spring.datasource.username=waimai
+spring.datasource.password=waimai123
 
-spring.jpa.hibernate.ddl-auto=create
+#spring.jpa.hibernate.ddl-auto=create
 #默认使用InnoDB引擎
 spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
 spring.datasource.sql-script-encoding=utf-8
-spring.jpa.show-sql=true
+spring.jpa.show-sql=false
+#server.servlet.context-path=/api
+
+spring.data.mongodb.uri=mongodb://my-db:27017/flash-waimai
+spring.data.mongodb.username=enilu
+spring.data.mongodb.password=enilu123456
+
+##全局参数
+cfg.tencentkey=RLHBZ-WMPRP-Q3JDS-V2IQA-JNRFH-EJBHL
+cfg.tencentkey2=RRXBZ-WC6KF-ZQSJT-N2QU7-T5QIT-6KF5X
+cfg.tencentkey3=OHTBZ-7IFRG-JG2QF-IHFUK-XTTK6-VXFBN
+
+## api
+api.qq.map.url=https://apis.map.qq.com/ws/

+ 1 - 1
flash-waimai-api/src/main/resources/logback.xml

@@ -15,7 +15,7 @@
 	<!-- 向文件输出日志 -->
 	<appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
 		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-			<fileNamePattern>/Users/maggie/app/waimai/runtime/log/api_%d{yyyy-MM-dd}.log</fileNamePattern>
+			<fileNamePattern>/data/flash-waimai/runtime/log/api_%d{yyyy-MM-dd}.log</fileNamePattern>
 			<maxHistory>1000</maxHistory>
 		</rollingPolicy>
 		<encoder>

+ 1 - 5
flash-waimai-core/src/main/java/cn/enilu/flash/bean/AppConfiguration.java

@@ -19,11 +19,7 @@ public class AppConfiguration {
     @Value("${cfg.tencentkey2}")
     private String tencentKey2;
     @Value("${cfg.tencentkey3}")
-    private String tencentKey3;
-    @Value("${cfg.baidukey}")
-    private String baiduKey;
-    @Value("${cfg.baidukey2}")
-    private String baiduKey2;
+    private String tencentKey3;    
     @Value("${img.dir}")
     private String imgDir;
 

+ 1 - 0
flash-waimai-core/src/main/java/cn/enilu/flash/bean/vo/business/LoginVo.java

@@ -6,4 +6,5 @@ public class LoginVo{
     private String username;
     private String password;
     private String captchaCode;
+    private String captchCodeId;
 }

+ 7 - 2
flash-waimai-core/src/main/java/cn/enilu/flash/cache/TokenCache.java

@@ -14,12 +14,17 @@ public   class TokenCache {
 
     @Autowired
     private EhcacheDao ehcacheDao;
-
+    public void put(String key,Object value){
+        ehcacheDao.hset(EhcacheDao.SESSION,key,value);
+    }
+     public <T> T get(String key,Class<T> klass){
+         return ehcacheDao.hget(EhcacheDao.SESSION, key,klass);
+     }
     public   void put(String token, Long idUser) {
         ehcacheDao.hset(EhcacheDao.SESSION,token, idUser);
     }
 
-    public   Long get(String token) {
+    public   Long getToken(String token) {
         return ehcacheDao.hget(EhcacheDao.SESSION,token,Long.class);
     }
     public Long getIdUser(){

+ 0 - 3
flash-waimai-core/src/main/java/cn/enilu/flash/service/system/FileService.java

@@ -5,7 +5,6 @@ import cn.enilu.flash.bean.constant.cache.CacheKey;
 import cn.enilu.flash.bean.entity.system.FileInfo;
 import cn.enilu.flash.bean.enumeration.ConfigKeyEnum;
 import cn.enilu.flash.cache.ConfigCache;
-import cn.enilu.flash.cache.TokenCache;
 import cn.enilu.flash.dao.system.FileInfoRepository;
 import cn.enilu.flash.security.JwtUtil;
 import cn.enilu.flash.service.BaseService;
@@ -31,8 +30,6 @@ public class FileService extends BaseService<FileInfo,Long,FileInfoRepository> {
     private ConfigCache configCache;
     @Autowired
     private FileInfoRepository fileInfoRepository;
-    @Autowired
-    private TokenCache tokenCache;
 
     /**
      * 文件上传

+ 6 - 6
flash-waimai-core/src/main/java/cn/enilu/flash/service/task/TaskService.java

@@ -41,19 +41,19 @@ public class TaskService extends BaseService<Task,Long,TaskRepository> {
 	}
 
 @Override
-	public Task update(Task task) {
-		logger.info("更新定时任务{}", task.getName());
-		taskRepository.save(task);
+	public Task update(Task record) {
+		logger.info("更新定时任务{}", record.getName());
+		taskRepository.save(record);
 		try {
-			QuartzJob job = jobService.getJob(task.getId().toString(), task.getJobGroup());
+			QuartzJob job = jobService.getJob(record.getId().toString(), record.getJobGroup());
 			if (job != null) {
 				jobService.deleteJob(job);
 			}
-			jobService.addJob(jobService.getJob(task));
+			jobService.addJob(jobService.getJob(record));
 		} catch (SchedulerException e) {
 			logger.error(e.getMessage(), e);
 		}
-		return task;
+		return record;
 	}
 
 

+ 1 - 1
flash-waimai-manage/config/prod.env.js

@@ -1,5 +1,5 @@
 'use strict'
 module.exports = {
   NODE_ENV: '"production"',
-  BASE_API: '"http://flash-api.enilu.cn/"',
+  BASE_API: '"http://waimai-api.microapp.store"',
 }

+ 0 - 2
flash-waimai-manage/src/permission.js

@@ -39,7 +39,6 @@ router.beforeEach((to, from, next) => {
           // next()
         }).catch((err) => {
           store.dispatch('FedLogOut').then(() => {
-            console.log('1111111'.err)
             // Message.error(err || 'Verification failed, please login again')
             next({ path: '/' })
           })
@@ -47,7 +46,6 @@ router.beforeEach((to, from, next) => {
       } else {
         // 没有动态改变权限的需求可直接next() 删除下方权限判断 ↓
         if (hasPermission(store.getters.roles, to.meta.roles)) {
-          console.log('next')
           next()
         } else {
           console.log(401)

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

@@ -123,10 +123,8 @@ export default {
     addressSelect(address) {
       this.formData.latitude = address.latitude
       this.formData.longitude = address.longitude
-      console.log(this.formData.latitude, this.formData.longitude)
     },
     handleShopAvatarScucess(res, file) {
-      console.log('res', res)
       this.formData.imagePath = getApiUrl() + '/file/getImgStream?fileName=' + res.data.realFileName
       this.formData.image_path = res.data.realFileName
     },
@@ -222,7 +220,6 @@ export default {
           const activitiesJson = JSON.stringify(activities)
           delete this.formData.activities
           this.formData.activitiesJson = activitiesJson
-          console.log(this.formData)
           addShop(this.formData).then(response => {
             this.$message({
               type: 'success',

+ 2 - 1
flash-waimai-manage/src/views/business/shop/index.vue

@@ -113,7 +113,8 @@
             <el-form-item label="商铺图片" label-width="100px">
               <el-upload
                 class="avatar-uploader"
-                :action="fileMgrUrl + '/v1/addimg/shop'"
+                :action="fileMgrUrl"
+                :headers="uploadHeaders"
                 :show-file-list="false"
                 :on-success="handleServiceAvatarScucess"
                 :before-upload="beforeAvatarUpload">

+ 11 - 15
flash-waimai-manage/src/views/business/shop/shop.js

@@ -1,4 +1,5 @@
 import { getApiUrl } from '@/utils/utils'
+import { getToken } from '@/utils/auth'
 import { cityGuess } from '@/api/getData'
 import {
   getResturants,
@@ -13,11 +14,11 @@ export default {
   data() {
     return {
       city: {},
-
-      // offset: 0,
-      // limit: 20,
       count: 0,
-      fileMgrUrl: getApiUrl(),
+      fileMgrUrl: getApiUrl() + '/file',
+      uploadHeaders: {
+        'Authorization': ''
+      },
       tableData: [],
       currentPage: 1,
       selectTable: {},
@@ -34,6 +35,7 @@ export default {
   },
   created() {
     this.initData()
+    this.uploadHeaders['Authorization'] = getToken()
   },
 
   methods: {
@@ -78,11 +80,9 @@ export default {
       }
     },
     async fetchData() {
-      // const {latitude, longitude} = this.city;
       const latitude = ''
       const longitude = ''
       getResturants({ page: this.listQuery.page, limit: this.listQuery.limit }).then(response => {
-        console.log(response)
         const restaurants = response.data.records
         this.total = response.data.total
         this.tableData = []
@@ -127,8 +127,7 @@ export default {
     },
     handleEdit(index, row) {
       this.selectTable = row
-      this.selectTable.image = getApiUrl() + '/file/getImgStream?fileName=' + row.image_path
-      console.log(this.selectTable)
+      this.selectTable.image = getApiUrl() + '/file/getImgStream?fileName=' + row.image_path    
       this.address.address = row.address
       this.dialogFormVisible = true
       this.selectedCategory = row.category.split('/')
@@ -180,11 +179,9 @@ export default {
       this.address = { address, latitude, longitude }
     },
     handleServiceAvatarScucess(res, file) {
-      if (res.status == 1) {
-        this.selectTable.image_path = res.image_path
-      } else {
-        this.$message.error('上传图片失败!')
-      }
+      this.selectTable.image_path = res.data.realFileName
+      this.selectTable.image =  getApiUrl() + '/file/getImgStream?fileName=' + res.data.realFileName
+      
     },
     beforeAvatarUpload(file) {
       const isRightType = (file.type === 'image/jpeg') || (file.type === 'image/png')
@@ -202,8 +199,7 @@ export default {
       this.dialogFormVisible = false
       try {
         Object.assign(this.selectTable, this.address)
-        this.selectTable.category = this.selectedCategory.join('/')
-        console.log(this.selectTable)
+        this.selectTable.category = this.selectedCategory.join('/')         
         updateResturant(this.selectTable).then(response => {
           this.$message({
             type: 'success',

+ 4 - 1
flash-waimai-mobile/build/webpack.base.conf.js

@@ -67,7 +67,10 @@ module.exports = {
         }),
         postcss: [
             require('autoprefixer')({
-                browsers: ['last 10 versions']
+                browsers: [
+                    'Android >= 4.4',
+                    'iOS >= 8'
+                  ]
             })
         ]
     }

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

@@ -9,7 +9,7 @@ module.exports = {
         index: path.resolve(__dirname, '../elm/index.html'),
         assetsRoot: path.resolve(__dirname, '../elm'),
         assetsSubDirectory: 'static',
-        assetsPublicPath: '/elm/',
+        assetsPublicPath: '/',
         productionSourceMap: true,
         // Surge or Netlify already gzip all static assets for you.
         // Before setting to `true`, make sure to:

BIN
flash-waimai-mobile/favicon.ico


+ 1 - 1
flash-waimai-mobile/package.json

@@ -11,7 +11,7 @@
     "build": "node build/build.js"
   },
   "dependencies": {
-    "better-scroll": "^0.1.15",
+    "better-scroll": "1.15.2",
     "fastclick": "^1.0.6",
     "iscroll": "^5.2.0",
     "showdown": "^1.6.4",

+ 3 - 5
flash-waimai-mobile/src/config/env.js

@@ -14,12 +14,10 @@ let imgBaseUrl = '';
 
 if (process.env.NODE_ENV == 'development') {
     // imgBaseUrl = '/img/';
-        imgBaseUrl = '/file/getImgStream?fileName='
-  console.log('development',baseUrl)
+        imgBaseUrl = '/file/getImgStream?fileName='  
 }else if(process.env.NODE_ENV == 'production'){
-	baseUrl = '//elm.cangdu.org';
-	console.log('product',baseUrl)
-    imgBaseUrl = '//elm.cangdu.org/img/';
+	baseUrl = '//waimai-api.microapp.store';
+    imgBaseUrl = '//waimai-api.microapp.store/file/getImgStream?fileName=';
 }
 
 export {

+ 0 - 7
flash-waimai-mobile/src/main.js

@@ -4,13 +4,6 @@ import routes from './router/router'
 import store from './store/'
 import {routerMode} from './config/env'
 import './config/rem'
-import FastClick from 'fastclick'
-
-if ('addEventListener' in document) {
-    document.addEventListener('DOMContentLoaded', function() {
-        FastClick.attach(document.body);
-    }, false);
-}
 
 Vue.use(VueRouter)
 const router = new VueRouter({

+ 6 - 3
flash-waimai-mobile/src/page/login/login.vue

@@ -69,6 +69,7 @@
                 userAccount: null, //用户名
                 passWord: null, //密码
                 captchaCodeImg: null, //验证码地址
+                captchCodeId:null,//验证码id
                 codeNumber: null, //验证码
                 showAlert: false, //显示提示组件
                 alertText: null, //提示的内容
@@ -101,8 +102,10 @@
             },
             //获取验证吗,线上环境使用固定的图片,生产环境使用真实的验证码
             async getCaptchaCode(){
-                let res = await getcaptchas();
-                this.captchaCodeImg = res.code;
+                let res = await getcaptchas()
+                console.log('res',res)
+                this.captchaCodeImg = res.code
+                this.captchCodeId = res.captchCodeId
             },
             //获取短信验证码
             async getVerifyCode(){
@@ -164,7 +167,7 @@
                         return
                     }
                     //用户名登录
-                    this.userInfo = await accountLogin(this.userAccount, this.passWord, this.codeNumber);
+                    this.userInfo = await accountLogin(this.userAccount, this.passWord, this.codeNumber,this.captchCodeId);
                 }
                 //如果返回的值不正确,则弹出提示框,返回的值正确则返回上一页
                 if (!this.userInfo.user_id) {

+ 2 - 1
flash-waimai-mobile/src/page/order/order.vue

@@ -1,6 +1,7 @@
  <template>
     <div class="order_page">
         <head-top head-title="订单列表" go-back='true'></head-top>
+       
         <ul class="order_list_ul" v-load-more="loaderMore">
             <li class="order_list_li" v-for="item in orderList" :key="item.id">
                 <img :src="imgBaseUrl + item.restaurant_image_url" class="restaurant_image">
@@ -144,7 +145,7 @@
         p, span, h4{
             font-family: Helvetica Neue,Tahoma,Arial;
         }
-    }
+    }    
     .order_list_ul{
         padding-top: 1.95rem;
         .order_list_li{

+ 2 - 4
flash-waimai-mobile/src/page/shop/children/foodDetail.vue

@@ -1,4 +1,4 @@
- <template>
+<template>
 	<div class="rating_page">
         <head-top :head-title="name" go-back='true'></head-top>
         <section class="header_img">
@@ -35,7 +35,6 @@
     import ratingStar from 'src/components/common/ratingStar'
     import buyCart from 'src/components/common/buyCart'
     import {imgBaseUrl} from 'src/config/env'
-
     export default {
     	data(){
             return{
@@ -155,5 +154,4 @@
             }
         }
     }
-
-</style>
+</style>

+ 1 - 2
flash-waimai-mobile/src/page/shop/children/shopDetail.vue

@@ -81,7 +81,6 @@
     import {mapState} from 'vuex'
     import {getImgPath} from 'src/components/common/mixin'
     import {imgBaseUrl} from 'src/config/env'
-
     export default {
     	data(){
             return{
@@ -243,4 +242,4 @@
         transform: translate3d(2rem, 0, 0);
         opacity: 0;
     }
-</style>
+</style>

+ 20 - 21
flash-waimai-mobile/src/page/shop/shop.vue

@@ -1,4 +1,4 @@
- <template>
+<template>
     <div>
         <section v-if="!showLoading" class="shop_container">
             <nav class="goback" @click="goback">
@@ -7,7 +7,9 @@
                 </svg>
             </nav>
             <header class="shop_detail_header" ref="shopheader" :style="{zIndex: showActivities? '14':'10'}">
-                <img :src="imgBaseUrl + shopDetailData.image_path" class="header_cover_img">
+                <div class="header_cover_img_con">
+                  <img :src="imgBaseUrl + shopDetailData.image_path" class="header_cover_img">
+                </div>
                 <section class="description_header">
                     <router-link to="/shop/shopDetail" class="description_top">
                         <section class="description_left">
@@ -324,7 +326,6 @@
     import {loadMore, getImgPath} from 'src/components/common/mixin'
     import {imgBaseUrl} from 'src/config/env'
     import BScroll from 'better-scroll'
-
     export default {
         data(){
             return{
@@ -465,11 +466,9 @@
                     swipeTime: 2000,
                     click: true,
                 });
-
                 const wrapperMenu = new BScroll('#wrapper_menu', {
                     click: true,
                 });
-
                 const wrapMenuHeight = this.$refs.wrapperMenu.clientHeight;
                 this.foodScroll.on('scroll', (pos) => {
                     if (!this.$refs.wrapperMenu) {
@@ -758,15 +757,21 @@
         padding-left: 0.2rem;
     }
     .shop_detail_header{
-        overflow: hidden;
+        // overflow: hidden;
         position: relative;
-        .header_cover_img{
-            width: 100%;
-            position: absolute;
-            top: 0;
-            left: 0;
-            z-index: 9;
-            filter: blur(10px);
+        .header_cover_img_con {
+          height: 100%;
+          overflow: hidden;
+          position: absolute;
+          width: 100%;
+          .header_cover_img{
+              width: 100%;
+              position: absolute;
+              top: 0;
+              left: 0;
+              z-index: 9;
+              filter: blur(10px);
+          }
         }
         .description_header{
             position: relative;
@@ -888,7 +893,6 @@
                 padding: .2rem .4rem;
                 border-radius: 0.5rem;
             }
-
         }
         .close_activities{
             position: absolute;
@@ -896,11 +900,11 @@
             @include cl;
         }
     }
-
     .food_container{
         display: flex;
         flex: 1;
         padding-bottom: 2rem;
+        overflow: hidden;
     }
     .menu_container{
         display: flex;
@@ -1080,7 +1084,6 @@
                                 display: inline-block;
                                 transform: scale(.8);
                                 margin-left: -0.35rem;
-
                             }
                         }
                     }
@@ -1157,7 +1160,6 @@
             .cart_num{
                 @include ct;
                 left: 3.5rem;
-
                 div{
                     color: #fff;
                 }
@@ -1235,7 +1237,6 @@
                     span:nth-of-type(1){
                         @include sc(.6rem, #f60);
                         font-family: Helvetica Neue,Tahoma;
-
                     }
                     span:nth-of-type(2){
                         @include sc(.7rem, #f60);
@@ -1538,7 +1539,6 @@
         position: fixed;
         bottom: 30px;
         left: 30px;
-
         svg{
             @include wh(.9rem, .9rem);
             fill: #3190e8;
@@ -1572,5 +1572,4 @@
     .toggle-cart-enter, .toggle-cart-leave-active {
         transform: translateY(100%);
     }
-
-</style>
+</style>

+ 1 - 1
flash-waimai-mobile/src/service/getData.js

@@ -458,7 +458,7 @@ export const deleteAddress = (userid, addressid) => fetch( '/v1/users/' + userid
 /**
  * 账号密码登录
  */
-export const accountLogin = (username, password, captchaCode) => fetch('/v1/users/v2/login', {username, password, captchaCode}, 'POST');
+export const accountLogin = (username, password, captchaCode,captchCodeId ) => fetch('/v1/users/v2/login', {username, password, captchaCode,captchCodeId}, 'POST');
 
 
 /**