| | |
| | | import com.matrix.system.app.dto.PwdResetDto; |
| | | import com.matrix.system.app.dto.SmsCodeDto; |
| | | import com.matrix.system.app.dto.UploadPhotoDto; |
| | | import com.matrix.system.app.utils.Sms106Send; |
| | | import com.matrix.system.app.vo.UserInfoVo; |
| | | import com.matrix.system.common.authority.DefaultAuthorityManager; |
| | | import com.matrix.system.common.authority.strategy.AccountPasswordLogin; |
| | | import com.matrix.system.common.authority.strategy.LoginStrategy; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.common.service.SysUsersService; |
| | | import com.matrix.system.common.tools.PasswordUtil; |
| | | import com.matrix.system.common.tools.UploadUtil; |
| | |
| | | import java.io.IOException; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.security.NoSuchAlgorithmException; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @author wzy |
| | | * @date 2020-12-21 |
| | | **/ |
| | | @CrossOrigin(origins = "*") |
| | | @Api(value = "CommonAction", tags = "手机端公共请求类(含登陆)") |
| | | @RestController |
| | | @RequestMapping(value = "/api/common") |
| | |
| | | |
| | | @Autowired |
| | | private AppAuthorityManager authorityManager; |
| | | |
| | | @Autowired |
| | | private BusParameterSettingsDao busParameterSettingsDao; |
| | | |
| | | @Autowired |
| | | private RedisClient redisClient; |
| | |
| | | |
| | | String token = UUIDUtil.getRandomID(); |
| | | redisClient.saveValueForever(token, JSONObject.toJSONString(user)); |
| | | redisClient.saveValueForever(user.getSuId().toString(), token); |
| | | |
| | | userInfoVo.setId(user.getSuId()); |
| | | userInfoVo.setName(user.getSuName()); |
| | |
| | | if (StringUtils.isNotBlank(codeExist)) { |
| | | return AjaxResult.buildFailInstance("请勿重复发送验证码"); |
| | | } |
| | | redisClient.saveValue(smsCodeDto.getTelphone(), "123456", 120); |
| | | |
| | | Integer code =(int) ((Math.random() * 9 + 1) * 100000); |
| | | Sms106Send.sendVerifyCode(smsCodeDto.getTelphone(), code.toString(), 2); |
| | | redisClient.saveValue(smsCodeDto.getTelphone(), code.toString(), 120); |
| | | return AjaxResult.buildSuccessInstance("发送成功"); |
| | | } |
| | | |
| | |
| | | public AjaxResult findAppVersion() { |
| | | return AjaxResult.buildSuccessInstance(sysUsersService.findAppVersion()); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "获取api接口地址", notes = "获取api接口地址") |
| | | @GetMapping(value = "/findApiUrl") |
| | | public AjaxResult findApiUrl() { |
| | | Map<String, String> url = new HashMap<>(); |
| | | url.put("prd", "http://myapp.jyymatrix.cc/"); |
| | | url.put("test", "http://test.hive.jyymatrix.cc/"); |
| | | |
| | | Map<String, String> des = new HashMap<>(); |
| | | des.put("prd", "正式环境"); |
| | | des.put("test", "测试环境"); |
| | | |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("url", url); |
| | | data.put("des", des); |
| | | return AjaxResult.buildSuccessInstance(data); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |