diff --git a/tamguo-bms/src/main/java/com/tamguo/web/IndexController.java b/tamguo-bms/src/main/java/com/tamguo/web/IndexController.java new file mode 100644 index 0000000..3cfa6fc --- /dev/null +++ b/tamguo-bms/src/main/java/com/tamguo/web/IndexController.java @@ -0,0 +1,22 @@ +package com.tamguo.web; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.ModelAndView; + +/** + * Controller - 首页 + * + * @author tamguo + * + */ +@Controller +public class IndexController { + + @RequestMapping(path= {"index" , "/"}) + public ModelAndView index(ModelAndView model) { + model.setViewName("index"); + return model; + } + +} diff --git a/tamguo-bms/src/main/java/com/tamguo/web/member/BookController.java b/tamguo-bms/src/main/java/com/tamguo/web/member/BookController.java deleted file mode 100644 index 5fea8bc..0000000 --- a/tamguo-bms/src/main/java/com/tamguo/web/member/BookController.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.tamguo.web.member; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.servlet.ModelAndView; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.mapper.Condition; -import com.tamguo.common.utils.Result; -import com.tamguo.modules.book.model.BookEntity; -import com.tamguo.modules.book.model.DocumentEntity; -import com.tamguo.modules.book.model.enums.DocumentStatusEnum; -import com.tamguo.modules.book.service.IBookCategoryService; -import com.tamguo.modules.book.service.IBookService; -import com.tamguo.modules.book.service.IDocumentService; - -@Controller(value="memberBookController") -@RequestMapping(value="member/book") -public class BookController { - - private Logger logger = LoggerFactory.getLogger(getClass()); - - @Autowired - IBookService iBookService; - @Autowired - IBookCategoryService iBookCategoryService; - @Autowired - IDocumentService iDocumentService; - - @RequestMapping(value="list.html" , method = RequestMethod.GET) - public ModelAndView bookList(ModelAndView model) { - model.setViewName("member/book/list"); - return model; - } - - @SuppressWarnings("unchecked") - @RequestMapping(value="getBookList" , method = RequestMethod.POST) - @ResponseBody - public Result getBookList(Integer pageNo , Integer pageSize) { - try { - List bookList = iBookService.selectList(Condition.create().eq("owner", "tamguo")); - return Result.result(0, bookList, "查询成功!"); - } catch (Exception e) { - logger.error(e.getMessage() , e ); - return Result.failResult("查询失败"); - } - } - - @RequestMapping(value = "edit", method = RequestMethod.GET) - public ModelAndView edit(String bookId , ModelAndView model) { - model.setViewName("member/book/edit"); - model.addObject("bookId", bookId); - return model; - } - - @SuppressWarnings("unchecked") - @RequestMapping(value = "getDocumentList", method = RequestMethod.POST) - @ResponseBody - public Result getDocumentList(String id) { - Map map = new HashMap<>(); - try { - BookEntity book = iBookService.selectById(id); - List documentList = iDocumentService.selectList(Condition.create().eq("book_id", id).eq("status", DocumentStatusEnum.NORMAL.getValue())); - - map.put("documentList", this.processDocumentList(documentList)); - map.put("book", book); - } catch (Exception e) { - logger.error(e.getMessage() , e ); - return Result.failResult("查询失败"); - } - return Result.successResult(map); - } - - private JSONArray processDocumentList(List documentList) { - JSONArray entitys = new JSONArray(); - for(int i=0 ; i fileUploads = iFileUploadService.selectList(Condition.create().eq("biz_key", document.getId()).eq("biz_type", BizTypeEnum.DOCUMENT.getValue())); - if(!CollectionUtils.isEmpty(fileUploads)) { - for(int i=0 ; i vars = new HashMap<>(); vars.put("domainName", env.getProperty("domain.name")); vars.put("bookDomainName", env.getProperty("book.domain.name")); + vars.put("tamguoDomainName", env.getProperty("tamguo.domain.name")); vars.put("PAPER_TYPE_ZHENTI", SystemConstant.ZHENGTI_PAPER_ID); vars.put("PAPER_TYPE_MONI", SystemConstant.MONI_PAPER_ID); vars.put("PAPER_TYPE_YATI", SystemConstant.YATI_PAPER_ID); diff --git a/tamguo-mms/src/main/java/com/tamguo/config/web/WebConfig.java b/tamguo-mms/src/main/java/com/tamguo/config/web/WebConfig.java index 89908a9..5a5d3fc 100644 --- a/tamguo-mms/src/main/java/com/tamguo/config/web/WebConfig.java +++ b/tamguo-mms/src/main/java/com/tamguo/config/web/WebConfig.java @@ -20,7 +20,7 @@ public class WebConfig implements WebMvcConfigurer { @Override public void addInterceptors(InterceptorRegistry registry) { - registry.addInterceptor(memberInterceptor).addPathPatterns("/**").excludePathPatterns("/login.html","/register.html","/password/**","/captcha.jpg" , "/submitLogin.html" , "/miniLogin.html","/static/**"); + registry.addInterceptor(memberInterceptor).addPathPatterns("/**").excludePathPatterns("/login.html","/register.html","/password/**","/captcha.jpg" , "/submitLogin.html" , "/miniLogin.html","/static/**","/sendFindPasswordSms","/subRegister"); } @Override diff --git a/tamguo-mms/src/main/java/com/tamguo/web/RegisterController.java b/tamguo-mms/src/main/java/com/tamguo/web/RegisterController.java index 0337470..59eb872 100644 --- a/tamguo-mms/src/main/java/com/tamguo/web/RegisterController.java +++ b/tamguo-mms/src/main/java/com/tamguo/web/RegisterController.java @@ -43,7 +43,7 @@ public class RegisterController { return iMemberService.checkMobile(mobile); } - @RequestMapping(value = "/subRegister.html", method = RequestMethod.POST) + @RequestMapping(value = "/subRegister", method = RequestMethod.POST) @ResponseBody public Result subRegister(@RequestBody MemberEntity member , HttpSession session){ Result result = iMemberService.register(member); diff --git a/tamguo-mms/src/main/java/com/tamguo/web/SmsController.java b/tamguo-mms/src/main/java/com/tamguo/web/SmsController.java new file mode 100644 index 0000000..e66eeb5 --- /dev/null +++ b/tamguo-mms/src/main/java/com/tamguo/web/SmsController.java @@ -0,0 +1,30 @@ +package com.tamguo.web; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.aliyuncs.exceptions.ClientException; +import com.tamguo.common.utils.Result; +import com.tamguo.modules.sys.service.ISmsService; + +@Controller +public class SmsController { + + @Autowired + ISmsService iSmsService; + + @RequestMapping(value = {"sendFindPasswordSms"}, method = RequestMethod.GET) + @ResponseBody + public Result sendFindPasswordSms(String mobile){ + try { + return iSmsService.sendFindPasswordSms(mobile); + } catch (ClientException e) { + e.printStackTrace(); + } + return Result.result(500, null, ""); + } + +} diff --git a/tamguo-mms/src/main/resources/application.properties b/tamguo-mms/src/main/resources/application.properties index 1ebfbb5..e370d4a 100644 --- a/tamguo-mms/src/main/resources/application.properties +++ b/tamguo-mms/src/main/resources/application.properties @@ -1,5 +1,6 @@ domain.name=http://localhost:8084/ book.domain.name=http://localhost:8083/ +tamguo.domain.name=http://localhost:8081/ server.port=8084 jasypt.encryptor.password=tamguo diff --git a/tamguo-mms/src/main/resources/static/images/avatar.png b/tamguo-mms/src/main/resources/static/images/avatar.png new file mode 100644 index 0000000..616985e Binary files /dev/null and b/tamguo-mms/src/main/resources/static/images/avatar.png differ diff --git a/tamguo-mms/src/main/resources/static/js/member/register.js b/tamguo-mms/src/main/resources/static/js/member/register.js index c9f1eec..37a8bac 100644 --- a/tamguo-mms/src/main/resources/static/js/member/register.js +++ b/tamguo-mms/src/main/resources/static/js/member/register.js @@ -63,9 +63,6 @@ var vm = new Vue({ verifyCode:[ { required: true, message: '请输入验证码', trigger: 'blur' }, ], - kemuId:[ - {required: true, message: '请选择科目', trigger: 'change'} - ], email:[ { required: true, message: '请输入邮箱地址', trigger: 'blur' }, { type: 'email', message: '请输入正确的邮箱地址', trigger: ['blur', 'change'] } @@ -78,11 +75,10 @@ var vm = new Vue({ this.$refs[formName].validate((valid) => { if (valid) { vm.loading = true; - vm.member.subjectId = vm.member.kemuId[0]; - axios({method: 'post',url: mainHttp + 'subRegister.html',data: vm.member}).then(function(response){ + axios({method: 'post',url: mainHttp + 'subRegister',data: vm.member}).then(function(response){ if(response.data.code == 200){ vm.loading = false; - vm.$message({message: "注册成功",duration:500,type: 'success',onClose:function(){ + vm.$message({message: "注册成功",duration:100,type: 'success',onClose:function(){ window.location.href = "index.html"; }}); }else{ @@ -100,16 +96,11 @@ var vm = new Vue({ resetForm(formName) { this.$refs[formName].resetFields(); }, - getCourses:function(){ - axios.get(mainHttp + 'subject/getSubjectTree.html').then(function(response){ - vm.courses = response.data.result; - }); - }, sendSms:function(){ // 校验成功才能发送短信 vm.$refs['member'].validateField('mobile',function(message){ if(message == ""){ - axios.get(mainHttp + 'sms/sendFindPasswordSms.html?mobile='+vm.member.mobile).then(function(response){ + axios.get(mainHttp + 'sendFindPasswordSms?mobile='+vm.member.mobile).then(function(response){ if(response.data.code == 200){ vm.$message({message: response.data.message,type: 'success'}); }else{ @@ -120,5 +111,4 @@ var vm = new Vue({ }); } } - }); -vm.getCourses(); \ No newline at end of file + }); \ No newline at end of file diff --git a/tamguo-mms/src/main/resources/templates/booklist.html b/tamguo-mms/src/main/resources/templates/booklist.html index 2f5991d..5f12952 100644 --- a/tamguo-mms/src/main/resources/templates/booklist.html +++ b/tamguo-mms/src/main/resources/templates/booklist.html @@ -41,7 +41,7 @@
    diff --git a/tamguo-tms/src/main/resources/templates/include/minilogin.html b/tamguo-tms/src/main/resources/templates/include/minilogin.html index bd9579b..e3c4583 100644 --- a/tamguo-tms/src/main/resources/templates/include/minilogin.html +++ b/tamguo-tms/src/main/resources/templates/include/minilogin.html @@ -32,7 +32,7 @@

    短信快捷登录 - 忘记密码? + 忘记密码?

@@ -79,7 +79,7 @@
- 立即注册 + 立即注册