diff --git a/javaweb-admin/.DS_Store b/javaweb-admin/.DS_Store index 6ddef89..03a2e13 100644 Binary files a/javaweb-admin/.DS_Store and b/javaweb-admin/.DS_Store differ diff --git a/javaweb-admin/pom.xml b/javaweb-admin/pom.xml index c952937..95c71f5 100644 --- a/javaweb-admin/pom.xml +++ b/javaweb-admin/pom.xml @@ -8,9 +8,9 @@ 4.0.0 - zsjyadmin + zsjyapi war - zsjyadmin + zsjyapi Demo project for Spring Boot @@ -257,7 +257,7 @@ - zsjyadmin + zsjyapi src/main/resources diff --git a/javaweb-admin/src/.DS_Store b/javaweb-admin/src/.DS_Store index f5e6eb8..302f228 100644 Binary files a/javaweb-admin/src/.DS_Store and b/javaweb-admin/src/.DS_Store differ diff --git a/javaweb-admin/src/main/.DS_Store b/javaweb-admin/src/main/.DS_Store index 25961dd..ec84f4a 100644 Binary files a/javaweb-admin/src/main/.DS_Store and b/javaweb-admin/src/main/.DS_Store differ diff --git a/javaweb-admin/src/main/java/.DS_Store b/javaweb-admin/src/main/java/.DS_Store index befeddb..7879834 100644 Binary files a/javaweb-admin/src/main/java/.DS_Store and b/javaweb-admin/src/main/java/.DS_Store differ diff --git a/javaweb-admin/src/main/java/com/.DS_Store b/javaweb-admin/src/main/java/com/.DS_Store index 85f8bf2..7af1504 100644 Binary files a/javaweb-admin/src/main/java/com/.DS_Store and b/javaweb-admin/src/main/java/com/.DS_Store differ diff --git a/javaweb-admin/src/main/java/com/iflytop/zsjyapi/controller/CollectImageController.java b/javaweb-admin/src/main/java/com/iflytop/zsjyapi/controller/CollectImageController.java index fec2126..80513cd 100644 --- a/javaweb-admin/src/main/java/com/iflytop/zsjyapi/controller/CollectImageController.java +++ b/javaweb-admin/src/main/java/com/iflytop/zsjyapi/controller/CollectImageController.java @@ -74,7 +74,8 @@ public class CollectImageController { SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); Date date = new Date(); String fileName_part = format.format(date); - String fileName = userId + "_" + fileName_part; + String verificationCode = String.valueOf((int)((Math.random()*9+1)*1000)); + String fileName = userId + "_" + fileName_part + "-" + verificationCode; File file = new File(absolutePath, fileName); diff --git a/javaweb-admin/src/main/java/com/iflytop/zsjyapi/dao/CurrentDetectionDao.java b/javaweb-admin/src/main/java/com/iflytop/zsjyapi/dao/CurrentDetectionDao.java new file mode 100644 index 0000000..1a29779 --- /dev/null +++ b/javaweb-admin/src/main/java/com/iflytop/zsjyapi/dao/CurrentDetectionDao.java @@ -0,0 +1,31 @@ +package com.iflytop.zsjyapi.dao; + +import com.iflytop.zsjyapi.entity.TestResult; +import com.javaweb.admin.entity.CurrentDetection; +import org.apache.shiro.authc.Account; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.jdbc.core.BeanPropertyRowMapper; +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * @author cool + * @date 2023/7/15 19:02 + */ +@Repository +public class CurrentDetectionDao { + + @Autowired + JdbcTemplate jdbcTemplate; + + public CurrentDetection getOne(){ + String querySql = "select * from current_detection where iscurrent = 1"; + List query = jdbcTemplate.query(querySql, new BeanPropertyRowMapper(CurrentDetection.class)); + if (query.size() > 0) { + return query.get(0); + } + return null; + } +} diff --git a/javaweb-admin/src/main/java/com/iflytop/zsjyapi/dao/TBatchDao.java b/javaweb-admin/src/main/java/com/iflytop/zsjyapi/dao/TBatchDao.java new file mode 100644 index 0000000..9d751e3 --- /dev/null +++ b/javaweb-admin/src/main/java/com/iflytop/zsjyapi/dao/TBatchDao.java @@ -0,0 +1,30 @@ +package com.iflytop.zsjyapi.dao; + +import com.javaweb.admin.entity.CurrentDetection; +import com.javaweb.admin.entity.TBatch; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.jdbc.core.BeanPropertyRowMapper; +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * @author cool + * @date 2023/7/15 20:06 + */ +@Repository +public class TBatchDao { + + @Autowired + JdbcTemplate jdbcTemplate; + + public TBatch getOne(){ + String querySql = "select * from t_batch where is_current = 1"; + List query = jdbcTemplate.query(querySql, new BeanPropertyRowMapper(TBatch.class)); + if (query.size() > 0) { + return query.get(0); + } + return null; + } +} diff --git a/javaweb-admin/src/main/java/com/iflytop/zsjyapi/dao/TestResultDao.java b/javaweb-admin/src/main/java/com/iflytop/zsjyapi/dao/TestResultDao.java index 3050613..6242fd5 100644 --- a/javaweb-admin/src/main/java/com/iflytop/zsjyapi/dao/TestResultDao.java +++ b/javaweb-admin/src/main/java/com/iflytop/zsjyapi/dao/TestResultDao.java @@ -11,12 +11,15 @@ public class TestResultDao { JdbcTemplate jdbcTemplate; public void add(TestResult testResult){ - String insertSql = "INSERT INTO testresult" + + String insertSql = "INSERT INTO t_testresult" + "(" + "`user_id`," + "`test_date`," + "`image_file_name`," + "`image_file_path`," + + "`idcard`," + + "`nickname`," + + "`batch_id`," + "`c1`," + "`c2`," + "`c3`," + @@ -41,6 +44,9 @@ public class TestResultDao { "'"+testResult.getTestDate()+"'," + "'"+testResult.getImageFileName()+"'," + "'"+testResult.getImageFilePath()+"'," + + "'"+testResult.getIdcard()+"'," + + "'"+testResult.getNickname()+"'," + + testResult.getBatch_id()+"," + testResult.getC1()+"," + testResult.getC2()+"," + testResult.getC3()+"," + diff --git a/javaweb-admin/src/main/java/com/iflytop/zsjyapi/entity/TestResult.java b/javaweb-admin/src/main/java/com/iflytop/zsjyapi/entity/TestResult.java index d91d91c..af4bc85 100644 --- a/javaweb-admin/src/main/java/com/iflytop/zsjyapi/entity/TestResult.java +++ b/javaweb-admin/src/main/java/com/iflytop/zsjyapi/entity/TestResult.java @@ -34,4 +34,10 @@ public class TestResult { String c5Color; String c6Color; + String idcard; + + String nickname; + + int batch_id; + } diff --git a/javaweb-admin/src/main/java/com/iflytop/zsjyapi/service/TestResultService.java b/javaweb-admin/src/main/java/com/iflytop/zsjyapi/service/TestResultService.java index ab7a7c3..6c8f0e1 100644 --- a/javaweb-admin/src/main/java/com/iflytop/zsjyapi/service/TestResultService.java +++ b/javaweb-admin/src/main/java/com/iflytop/zsjyapi/service/TestResultService.java @@ -1,10 +1,15 @@ package com.iflytop.zsjyapi.service; +import com.iflytop.zsjyapi.dao.CurrentDetectionDao; +import com.iflytop.zsjyapi.dao.TBatchDao; import com.iflytop.zsjyapi.dao.TestResultDao; import com.iflytop.zsjyapi.entity.Coor; import com.iflytop.zsjyapi.entity.CoorRGB; import com.iflytop.zsjyapi.entity.TestResult; import com.iflytop.zsjyapi.util.ImageUtil; +import com.javaweb.admin.entity.CurrentDetection; +import com.javaweb.admin.entity.TBatch; +import com.javaweb.common.utils.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -18,12 +23,15 @@ import java.util.Date; public class TestResultService { @Autowired TestResultDao testResultDao; - + @Autowired + CurrentDetectionDao currentDetectionDao; + @Autowired + TBatchDao tBatchDao; public void add(String userId,String imageFileName,String imageFilePath,File imageFile){ TestResult testResult = new TestResult(); - SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date date = new Date(); String testDate = format.format(date); @@ -112,27 +120,63 @@ public class TestResultService { CoorRGB CoorRGB_c4 = ImageUtil.getRGB(rgb3array, c4); CoorRGB CoorRGB_c5 = ImageUtil.getRGB(rgb3array, c5); CoorRGB CoorRGB_c6 = ImageUtil.getRGB(rgb3array, c6); - - double c1_result = c1_C*(Math.pow((c1_A-(c1_k1*CoorRGB_c1.getR() + c1_k2*CoorRGB_c1.getG() + c1_k3*CoorRGB_c1.getB()))/((c1_k1*CoorRGB_c1.getR() + c1_k2*CoorRGB_c1.getG() + c1_k3*CoorRGB_c1.getB())-c1_D),1/c1_B)); - testResult.setC1(0); - - double c2_result =c2_C*(Math.pow((c2_A-(c2_k1*CoorRGB_c2.getR() + c2_k2*CoorRGB_c2.getG() + c2_k3*CoorRGB_c2.getB()))/((c2_k1*CoorRGB_c2.getR() + c2_k2*CoorRGB_c2.getG() + c2_k3*CoorRGB_c2.getB())-c2_D),1/c2_B)); - testResult.setC2(0); - - double c3_result =c3_C*(Math.pow((c3_A-(c3_k1*CoorRGB_c3.getR() + c3_k2*CoorRGB_c3.getG() + c3_k3*CoorRGB_c3.getB()))/((c3_k1*CoorRGB_c3.getR() + c3_k2*CoorRGB_c3.getG() + c3_k3*CoorRGB_c3.getB())-c3_D),1/c3_B)); - testResult.setC3(0); - - - double c4_result = c4_C*(Math.pow((c4_A-(c4_k1*CoorRGB_c4.getR() + c4_k2*CoorRGB_c4.getG() + c4_k3*CoorRGB_c4.getB()))/((c4_k1*CoorRGB_c4.getR() + c4_k2*CoorRGB_c4.getG() + c4_k3*CoorRGB_c4.getB())-c4_D),1/c4_B)); - testResult.setC4(0); - - - double c5_result =c5_C*(Math.pow((c5_A-(c5_k1*CoorRGB_c5.getR() + c5_k2*CoorRGB_c5.getG() + c5_k3*CoorRGB_c5.getB()))/((c5_k1*CoorRGB_c5.getR() + c5_k2*CoorRGB_c5.getG() + c5_k3*CoorRGB_c5.getB())-c5_D),1/c5_B)); - testResult.setC5(0); - - - double c6_result =c6_C*(Math.pow((c6_A-(c6_k1*CoorRGB_c6.getR() + c6_k2*CoorRGB_c6.getG() + c6_k3*CoorRGB_c6.getB()))/((c6_k1*CoorRGB_c6.getR() + c6_k2*CoorRGB_c6.getG() + c6_k3*CoorRGB_c6.getB())-c6_D),1/c6_B)); - testResult.setC6(0); + double c1_result = 0; + double c2_result = 0; + double c3_result = 0; + double c4_result = 0; + double c5_result = 0; + double c6_result = 0; + + // 除数可能为NaN 导致错误 + // Math pow 底数目前为负数, 指数是小数 + /** + * - 如果底数是负数,指数是小数,将会返回NaN(非数值) + * - 如果底数是负数,指数是偶数,将会返回一个正数 + * - 如果底数是负数,指数是奇数,将会返回一个负数 + */ + if (Double.compare(c1_B, 0.0) != 0 && ((c1_k1*CoorRGB_c1.getR() + c1_k2*CoorRGB_c1.getG() + c1_k3*CoorRGB_c1.getB())-c1_D) != 0.0){ + c1_result = c1_C*(Math.pow((c1_A-(c1_k1*CoorRGB_c1.getR() + c1_k2*CoorRGB_c1.getG() + c1_k3*CoorRGB_c1.getB()))/((c1_k1*CoorRGB_c1.getR() + c1_k2*CoorRGB_c1.getG() + c1_k3*CoorRGB_c1.getB())-c1_D),1/c1_B)); + if(Double.isNaN(c1_result)) { + c1_result = 0.0; + } + } + if (Double.compare(c2_B, 0.0) != 0 && ((c2_k1*CoorRGB_c2.getR() + c2_k2*CoorRGB_c2.getG() + c2_k3*CoorRGB_c2.getB())-c2_D) != 0.0){ + c2_result =c2_C*(Math.pow((c2_A-(c2_k1*CoorRGB_c2.getR() + c2_k2*CoorRGB_c2.getG() + c2_k3*CoorRGB_c2.getB()))/((c2_k1*CoorRGB_c2.getR() + c2_k2*CoorRGB_c2.getG() + c2_k3*CoorRGB_c2.getB())-c2_D),1/c2_B)); + if(Double.isNaN(c2_result)) { + c2_result = 0.0; + } + } + if (Double.compare(c3_B, 0.0) != 0 && ((c3_k1*CoorRGB_c3.getR() + c3_k2*CoorRGB_c3.getG() + c3_k3*CoorRGB_c3.getB())-c3_D) != 0.0){ + c3_result =c3_C*(Math.pow((c3_A-(c3_k1*CoorRGB_c3.getR() + c3_k2*CoorRGB_c3.getG() + c3_k3*CoorRGB_c3.getB()))/((c3_k1*CoorRGB_c3.getR() + c3_k2*CoorRGB_c3.getG() + c3_k3*CoorRGB_c3.getB())-c3_D),1/c3_B)); + if(Double.isNaN(c3_result)) { + c3_result = 0.0; + } + } + if (Double.compare(c4_B, 0.0) != 0 && ((c4_k1*CoorRGB_c4.getR() + c4_k2*CoorRGB_c4.getG() + c4_k3*CoorRGB_c4.getB())-c4_D) != 0.0){ + c4_result = c4_C*(Math.pow((c4_A-(c4_k1*CoorRGB_c4.getR() + c4_k2*CoorRGB_c4.getG() + c4_k3*CoorRGB_c4.getB()))/((c4_k1*CoorRGB_c4.getR() + c4_k2*CoorRGB_c4.getG() + c4_k3*CoorRGB_c4.getB())-c4_D),1/c4_B)); + if(Double.isNaN(c4_result)) { + c4_result = 0.0; + } + } + if (Double.compare(c5_B, 0.0) != 0 && ((c5_k1*CoorRGB_c5.getR() + c5_k2*CoorRGB_c5.getG() + c5_k3*CoorRGB_c5.getB())-c5_D) != 0.0){ + c5_result =c5_C*(Math.pow((c5_A-(c5_k1*CoorRGB_c5.getR() + c5_k2*CoorRGB_c5.getG() + c5_k3*CoorRGB_c5.getB()))/((c5_k1*CoorRGB_c5.getR() + c5_k2*CoorRGB_c5.getG() + c5_k3*CoorRGB_c5.getB())-c5_D),1/c5_B)); + if(Double.isNaN(c5_result)) { + c5_result = 0.0; + } + } + if (Double.compare(c6_B, 0.0) != 0 && ((c6_k1*CoorRGB_c6.getR() + c6_k2*CoorRGB_c6.getG() + c6_k3*CoorRGB_c6.getB())-c6_D) != 0.0){ + c6_result =c6_C*(Math.pow((c6_A-(c6_k1*CoorRGB_c6.getR() + c6_k2*CoorRGB_c6.getG() + c6_k3*CoorRGB_c6.getB()))/((c6_k1*CoorRGB_c6.getR() + c6_k2*CoorRGB_c6.getG() + c6_k3*CoorRGB_c6.getB())-c6_D),1/c6_B)); + if(Double.isNaN(c6_result)) { + c6_result = 0.0; + } + } + + testResult.setC1(c1_result); + testResult.setC2(c2_result); + testResult.setC3(c3_result); + testResult.setC4(c4_result); + testResult.setC5(c5_result); + testResult.setC6(c6_result); testResult.setC1Rgb(CoorRGB_c1.getR()+"_"+CoorRGB_c1.getG()+"_"+CoorRGB_c1.getB()); testResult.setC1Color("#" + Long.toHexString(CoorRGB_c1.getR()) @@ -160,8 +204,16 @@ public class TestResultService { testResult.setC6Rgb(CoorRGB_c6.getR()+"_"+CoorRGB_c6.getG()+"_"+CoorRGB_c6.getB()); testResult.setC6Color("#" + Long.toHexString(CoorRGB_c6.getR()) + Long.toHexString(CoorRGB_c6.getG()) + Long.toHexString(CoorRGB_c6.getB())); - - + CurrentDetection one = currentDetectionDao.getOne(); + TBatch one1 = tBatchDao.getOne(); + if (StringUtils.isNotNull(one)) { + // 从数据库查询当前设置的检测人 + testResult.setNickname(one.getUsername()); + testResult.setIdcard(one.getIdcard()); + } + if (StringUtils.isNotNull(one1)) { + testResult.setBatch_id(one1.getId()); + } testResultDao.add(testResult); } diff --git a/javaweb-admin/src/main/java/com/javaweb/.DS_Store b/javaweb-admin/src/main/java/com/javaweb/.DS_Store new file mode 100644 index 0000000..cee630d Binary files /dev/null and b/javaweb-admin/src/main/java/com/javaweb/.DS_Store differ diff --git a/javaweb-admin/src/main/java/com/javaweb/admin/AdminApplication.java b/javaweb-admin/src/main/java/com/javaweb/admin/AdminApplication.java index 23fbdf5..8f090c9 100644 --- a/javaweb-admin/src/main/java/com/javaweb/admin/AdminApplication.java +++ b/javaweb-admin/src/main/java/com/javaweb/admin/AdminApplication.java @@ -24,10 +24,11 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; +import org.springframework.context.annotation.ComponentScan; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.transaction.annotation.EnableTransactionManagement; -@SpringBootApplication(scanBasePackages = {"com.javaweb.*","com.iflytop.zhongshengjinyu.*"}) +@SpringBootApplication(scanBasePackages = {"com.javaweb.*","com.iflytop.zsjyapi.*"}) @MapperScan("com.javaweb.**.mapper") @EnableTransactionManagement // 开启定时任务支持 diff --git a/javaweb-admin/src/main/java/com/javaweb/system/config/ShiroConfig.java b/javaweb-admin/src/main/java/com/javaweb/system/config/ShiroConfig.java index b38afd0..05d0d55 100644 --- a/javaweb-admin/src/main/java/com/javaweb/system/config/ShiroConfig.java +++ b/javaweb-admin/src/main/java/com/javaweb/system/config/ShiroConfig.java @@ -127,6 +127,7 @@ public class ShiroConfig { LinkedHashMap filterChainDefinitionMap = new LinkedHashMap<>(); filterChainDefinitionMap.put("/login", "anon"); filterChainDefinitionMap.put("/detection/**", "anon"); + filterChainDefinitionMap.put("/image/**", "anon"); //logout是shiro提供的过滤器,这是走自定义的 shiroLogoutFilter 上面有配置 filterChainDefinitionMap.put("/logout", "logout"); filterChainDefinitionMap.put("/captcha", "anon"); diff --git a/javaweb-admin/src/main/resources/application-local.yml b/javaweb-admin/src/main/resources/application-local.yml index 6fa64f8..be90494 100644 --- a/javaweb-admin/src/main/resources/application-local.yml +++ b/javaweb-admin/src/main/resources/application-local.yml @@ -3,7 +3,7 @@ server: port: 8080 servlet: # 项目的前缀名 - context-path: /zsjyadmin + context-path: /zsjyapi spring: # 配置数据源 diff --git a/javaweb-admin/src/main/resources/application-prod.yml b/javaweb-admin/src/main/resources/application-prod.yml index a1dc916..f613cfa 100644 --- a/javaweb-admin/src/main/resources/application-prod.yml +++ b/javaweb-admin/src/main/resources/application-prod.yml @@ -3,7 +3,7 @@ server: port: 9011 # servlet: # # 项目的前缀名 -# context-path: /javaweb +# context-path: /zsjyapi spring: # 配置数据源 diff --git a/javaweb-admin/src/main/resources/application.yml b/javaweb-admin/src/main/resources/application.yml index 3ffa0ee..b8ef8db 100644 --- a/javaweb-admin/src/main/resources/application.yml +++ b/javaweb-admin/src/main/resources/application.yml @@ -64,4 +64,4 @@ system: # 系统版本号 version: v1.0 # 上下文 - webContext: /zsjyadmin + webContext: /zsjyapi diff --git a/javaweb-admin/src/main/resources/static/module/javaweb_login.js b/javaweb-admin/src/main/resources/static/module/javaweb_login.js index aabbb34..4df8855 100644 --- a/javaweb-admin/src/main/resources/static/module/javaweb_login.js +++ b/javaweb-admin/src/main/resources/static/module/javaweb_login.js @@ -1,79 +1,82 @@ /** * 系统登录 */ -layui.use(['layer', 'form', 'index'], function () { - var $ = layui.jquery; - var layer = layui.layer; - var form = layui.form; - var index = layui.index; - $('.login-wrapper').removeClass('layui-hide'); +layui.use(["layer", "form", "index"], function () { + var $ = layui.jquery; + var layer = layui.layer; + var form = layui.form; + var index = layui.index; + $(".login-wrapper").removeClass("layui-hide"); - // 登录事件 - form.on('submit(loginSubmit)', function (data) { - // 设置按钮文字“登录中...”及禁止点击状态 - $(data.elem).attr('disabled', true).text('登录中。。。'); + // 登录事件 + form.on("submit(loginSubmit)", function (data) { + // 设置按钮文字“登录中...”及禁止点击状态 + $(data.elem).attr("disabled", true).text("登录中。。。"); - // 网络请求 - var loadIndex = layer.load(2); - $.ajax({ - type: "POST", - url: '/zsjyadmin/login', - data: JSON.stringify(data.field), - contentType: "application/json", - dataType: "json", - beforeSend: function () { - // TODO... - }, - success: function (res) { - layer.close(loadIndex); - if (res.code == 0) { - // 清除Tab记忆 - index.clearTabCache(); + // 网络请求 + var loadIndex = layer.load(2); + $.ajax({ + type: "POST", + url: "/zsjyapi/login", + data: JSON.stringify(data.field), + contentType: "application/json", + dataType: "json", + beforeSend: function () { + // TODO... + }, + success: function (res) { + layer.close(loadIndex); + if (res.code == 0) { + // 清除Tab记忆 + index.clearTabCache(); - // 设置登录成功状态 - $(data.elem).attr('disabled', true).text('登录成功'); + // 设置登录成功状态 + $(data.elem).attr("disabled", true).text("登录成功"); - // 提示语 - layer.msg('登录成功', { - icon: 1, - time: 1500 - }); + // 提示语 + layer.msg("登录成功", { + icon: 1, + time: 1500, + }); - // 延迟3秒 - setTimeout(function () { - // 跳转后台首页 - window.location.href = "/zsjyadmin/index"; - }, 2000); + // 延迟3秒 + setTimeout(function () { + // 跳转后台首页 + window.location.href = "/zsjyapi/index"; + }, 2000); - return false; - } else { - // 错误信息 - layer.msg(res.msg, {icon: 2, anim: 6}); - // 刷新验证码 - $('img.login-captcha').click(function () { - this.src = '/zsjyadmin/captcha?t=' + (new Date).getTime(); - }).trigger('click'); + return false; + } else { + // 错误信息 + layer.msg(res.msg, { icon: 2, anim: 6 }); + // 刷新验证码 + $("img.login-captcha") + .click(function () { + this.src = "/zsjyapi/captcha?t=" + new Date().getTime(); + }) + .trigger("click"); - // 延迟3秒恢复可登录状态 - setTimeout(function () { - // 设置按钮状态为登录” - var login_text = $(data.elem).text().replace('中。。。', ''); - // 设置按钮为可点击状态 - $(data.elem).text(login_text).removeAttr('disabled'); - }, 1000); - } - }, - error: function () { - layer.msg("AJAX请求异常"); - } - }); - return false; + // 延迟3秒恢复可登录状态 + setTimeout(function () { + // 设置按钮状态为登录” + var login_text = $(data.elem).text().replace("中。。。", ""); + // 设置按钮为可点击状态 + $(data.elem).text(login_text).removeAttr("disabled"); + }, 1000); + } + }, + error: function () { + layer.msg("AJAX请求异常"); + }, }); + return false; + }); - /* 图形验证码 */ - var captchaUrl = '/zsjyadmin/captcha'; - $('img.login-captcha').click(function () { - this.src = captchaUrl + '?t=' + (new Date).getTime(); - }).trigger('click'); - -}); \ No newline at end of file + /* 图形验证码 */ + var captchaUrl = "/zsjyapi/captcha"; + $("img.login-captcha") + .click(function () { + this.src = captchaUrl + "?t=" + new Date().getTime(); + }) + .trigger("click"); +}); diff --git a/javaweb-admin/src/main/resources/templates/index.html b/javaweb-admin/src/main/resources/templates/index.html index 6fcffdc..6be4902 100644 --- a/javaweb-admin/src/main/resources/templates/index.html +++ b/javaweb-admin/src/main/resources/templates/index.html @@ -1,136 +1,214 @@ - - - - + + + + - + - - - + + + - - -
- -
+ + +
+ +
-
+
- -
+ +
- +
    +
  • + + + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    +
  • +
-
+
- -
- - -
- -
-
+ +
+
+
-
- - - + + + - - - - \ No newline at end of file + }); + + + diff --git a/javaweb-admin/src/main/resources/templates/login.html b/javaweb-admin/src/main/resources/templates/login.html index fbe5bf2..5e9326d 100644 --- a/javaweb-admin/src/main/resources/templates/login.html +++ b/javaweb-admin/src/main/resources/templates/login.html @@ -1,206 +1,268 @@ - - - - - + + + + + - - - + + + - - - + - - \ No newline at end of file + + + + + + diff --git a/javaweb-admin/src/main/resources/templates/public/footer.html b/javaweb-admin/src/main/resources/templates/public/footer.html index 468dd85..8f72960 100644 --- a/javaweb-admin/src/main/resources/templates/public/footer.html +++ b/javaweb-admin/src/main/resources/templates/public/footer.html @@ -1,12 +1,12 @@ -
+
-
- \ No newline at end of file +
+ diff --git a/javaweb-admin/src/main/resources/templates/public/header.html b/javaweb-admin/src/main/resources/templates/public/header.html index d372ebb..e87a4b5 100644 --- a/javaweb-admin/src/main/resources/templates/public/header.html +++ b/javaweb-admin/src/main/resources/templates/public/header.html @@ -1,29 +1,41 @@ -
+
- - - - - - - - + + - - - - - - + -
- \ No newline at end of file +
+ diff --git a/javaweb-admin/src/main/resources/templates/ttestresult/index.html b/javaweb-admin/src/main/resources/templates/ttestresult/index.html index a0993ed..e64bf8f 100644 --- a/javaweb-admin/src/main/resources/templates/ttestresult/index.html +++ b/javaweb-admin/src/main/resources/templates/ttestresult/index.html @@ -60,7 +60,7 @@ const idcard = document.getElementById("idcard").value; var $ = layui.jquery; $.ajax({ - url: "/zsjyadmin/detection/set", + url: "/zsjyapi/detection/set", data: { username, idcard,