Merge remote-tracking branch 'origin/dev' into dev
| | |
| | | @PostMapping(value = "/baseDownLoad",produces = {MediaType.APPLICATION_JSON_UTF8_VALUE},consumes = MediaType.MULTIPART_FORM_DATA_VALUE) |
| | | ResultBody baseDownLoad(@RequestBody Map<String,Object> map) throws Exception; |
| | | |
| | | @PostMapping(value="byteUplaod") |
| | | FileInfo byteUplaod(@RequestParam("fileName") String fileName,@RequestBody byte[] bytes); |
| | | |
| | | } |
| | |
| | | public ResultBody baseDownLoad(Map<String, Object> map) throws Exception { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public FileInfo byteUplaod(String fileName, byte[] bytes) { |
| | | return null; |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | import com.kidgrow.common.model.PageResult; |
| | | import com.kidgrow.common.model.ResultBody; |
| | | import com.kidgrow.filecenter.model.FileInfo; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.InputStream; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | * base64图片下载 |
| | | */ |
| | | ResultBody baseDownLoad(Map<String, Object> map) throws Exception; |
| | | |
| | | FileInfo byteUplaod(String fileName, InputStream inputStream,int size); |
| | | } |
| | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public FileInfo byteUplaod(String fileName, InputStream inputStream,int size) { |
| | | String houzhui=fileName.substring(fileName.lastIndexOf(".")+1); |
| | | String newFileName= RandomValueUtils.uuid()+"."+houzhui; |
| | | FileInfo newfileInfo=new FileInfo(); |
| | | newfileInfo.setName(newFileName); |
| | | newfileInfo.setId(IdUtil.fastSimpleUUID()); |
| | | newfileInfo.setSize(size); |
| | | newfileInfo.setIsImg(false); |
| | | newfileInfo.setContentType("byte[]"); |
| | | newfileInfo.setSource("aliyun"); |
| | | newfileInfo.setImgType(houzhui); |
| | | newfileInfo.setCreateTime(new Date()); |
| | | this.fileUpLoadOss(newfileInfo,"pdf/"+newFileName,inputStream); |
| | | baseMapper.insert(newfileInfo); |
| | | return newfileInfo; |
| | | } |
| | | } |
| | | |
| | |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.ByteArrayInputStream; |
| | | import java.io.ByteArrayOutputStream; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | } |
| | | return fileService.baseDownLoad(map); |
| | | } |
| | | /** |
| | | * byte[]上传 |
| | | */ |
| | | @PostMapping(value="byteUplaod") |
| | | public FileInfo byteUplaod(@RequestParam("fileName") String fileName,@RequestBody byte[] bytes){ |
| | | if(bytes.length == 0){ |
| | | return null; |
| | | } |
| | | if (com.kidgrow.common.utils.StringUtils.isBlank(fileName)) { |
| | | return null; |
| | | } |
| | | InputStream inputStream = new ByteArrayInputStream(bytes); |
| | | return fileService.byteUplaod(fileName,inputStream,bytes.length); |
| | | } |
| | | /** |
| | | * byte[]上传 |
| | | */ |
| | | @PostMapping(value="byteUplaodTest",produces = {MediaType.APPLICATION_JSON_UTF8_VALUE},consumes = MediaType.MULTIPART_FORM_DATA_VALUE) |
| | | public FileInfo byteUplaodTest(@RequestParam("fileName") String fileName,@RequestPart("file") MultipartFile file)throws IOException { |
| | | InputStream inputStream = file.getInputStream(); |
| | | ByteArrayOutputStream bytestream = new ByteArrayOutputStream(); |
| | | byte[] buffer=new byte[1024]; |
| | | int ch; |
| | | /** |
| | | * |
| | | * */ |
| | | while ((ch = inputStream.read(buffer)) != -1) { |
| | | bytestream.write(buffer,0,ch); |
| | | } |
| | | byte[] data = bytestream.toByteArray(); |
| | | InputStream inputStream1 = new ByteArrayInputStream(data); |
| | | return fileService.byteUplaod(fileName,inputStream,data.length); |
| | | } |
| | | |
| | | /** |
| | | * 文件删除 |
| | |
| | | String oldTel = MapUtils.getString(params, "oldTel"); |
| | | String newTel = AesUtils.desEncrypt(MapUtils.getString(params, "newTel")).trim(); |
| | | String authCode = AesUtils.desEncrypt(MapUtils.getString(params, "authCode")).trim(); |
| | | String userPassword = AesUtils.desEncrypt(MapUtils.getString(params, "userPassword")).trim(); |
| | | String userPassword =MapUtils.getString(params, "userPassword"); |
| | | |
| | | if (id > 0 && StringUtils.isNotBlank(oldTel) && StringUtils.isNotBlank(newTel) && StringUtils.isNotBlank(authCode) && StringUtils.isNotBlank(userPassword)) { |
| | | //检查验证码 |
| | |
| | | com.kidgrow.usercenter.model.SysDoctor newsysDoctorModel = new com.kidgrow.usercenter.model.SysDoctor(); |
| | | if (sysDoctorModel != null) { |
| | | //理论上只有一个,如果有多个 只取第一个 |
| | | newsysDoctorModel.setId(sysDoctorModel.getId()); |
| | | newsysDoctorModel.setDoctorTel(newTel); |
| | | sysDoctorModel.setId(sysDoctorModel.getId()); |
| | | sysDoctorModel.setDoctorTel(newTel); |
| | | sysDoctorMapper.updateById(newsysDoctorModel); |
| | | } |
| | | if (baseMapper.updateById(user) > 0) { |
| | |
| | | // var my_api_server_url = 'http://zuul.kidgrow.com/'; |
| | | // var my_api_server_url = 'http://192.168.2.240:8888/'; |
| | | // var my_api_server_url = 'http://127.0.0.1:8888/'; |
| | | var my_api_server_url = 'http://127.0.0.1:8888/'; |
| | | // var my_api_server_url = 'http://192.168.2.240:8888/'; |
| | | var my_api_server_url = 'http://open.zuul.kidgrow.cloud/'; |
| | | // var my_api_server_url = 'http://open.zuul.kidgrow.cloud/'; |
| | | // var my_api_server_url = 'http://uat.zuul.kidgrow.cloud/'; |
| | | // var my_api_server_url = 'https://zuul.kidgrow.cloud/'; |
| | | //var my_api_server_url = 'http://123.57.164.62:8888/'; |
| | |
| | | }, "POST"); |
| | | return false; |
| | | }); |
| | | //判断用户名是否被使用 |
| | | var username_is_usered = function (username_id) { |
| | | var username = $("#" + username_id).val() |
| | | admin.req('api-user/users/findCountByMap', JSON.stringify({ |
| | | username: username |
| | | }), function (data) { |
| | | if (data.code == 0) { |
| | | if (data.data > 0) { |
| | | $("#" + username_id).val("") |
| | | layer.msg("该手机号已经使用", { |
| | | icon: 2, |
| | | time: 2000 |
| | | }) |
| | | } |
| | | } else { |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 2000 |
| | | }); |
| | | } |
| | | }, 'post'); |
| | | } |
| | | /* |
| | | * 验证手机号码 |
| | | */ |
| | | function validatorTel(content) { |
| | | // 正则验证格式 |
| | | eval("var reg = /^1[34578]\\d{9}$/;"); |
| | | var flag = RegExp(reg).test(content) |
| | | return flag; |
| | | } |
| | | //验证手机号是否被使用 |
| | | $("#mobile").blur(function () { |
| | | let mobile=$("#mobile").val() |
| | | if (!validatorTel(mobile)) { |
| | | layer.msg("请输入正确的手机号"); |
| | | } else { |
| | | username_is_usered("mobile"); |
| | | } |
| | | }) |
| | | }); |
| | | </script> |