Commit 7c128f39 authored by litengwei's avatar litengwei

任务 15178

parent 78a10157
......@@ -70,6 +70,12 @@ public class LoginController {
@Value("${amos.system.user.app-key}")
private String appKey;
@Value("${amos.system.privilege.user.app-key:AMOS_ADMIN}")
private String appKeyPrivilege;
@Value("${amos.system.privilege.user.product:AMOS-WEB-ADMIN}")
private String productPrivilege;
@ApiOperation(value = "通过userId登录", notes = "查询设备指标")
@GetMapping(value = "/{userId}")
synchronized public ReginParams getBindEquipment(@PathVariable("userId") String userId) throws Exception {
......@@ -105,9 +111,10 @@ public class LoginController {
if (ObjectUtils.isEmpty(feignClientResult.getResult())){
throw new Exception("缺失登录信息");
}
// 调用平台授权接口
Map<String ,String > re = (Map<String, String>) feignClientResult.getResult();
String amosToken = re.get("token");
privilegeFeign.warrant(appKey, product, amosToken);
privilegeFeign.warrant(appKeyPrivilege, productPrivilege, amosToken);
RequestContext.setToken(amosToken);
RequestContext.setProduct(product);
RequestContext.setAppKey(appKey);
......@@ -124,7 +131,7 @@ public class LoginController {
reginParams.setToken(amosToken);
reginParams.setUserModel(userModel);
redisTemplate.opsForValue().set(buildKey(userId, token), JSONObject.toJSONString(reginParams),28, TimeUnit.DAYS);
redisTemplate.opsForValue().set(buildKey(userId, amosToken), JSONObject.toJSONString(reginParams),28, TimeUnit.DAYS);
// redisTemplate.opsForValue().set(buildKey(userId, amosToken), JSONObject.toJSONString(reginParams),28, TimeUnit.DAYS);
return reginParams;
}
......
......@@ -111,6 +111,8 @@ data.type.extinguisher=3104
#消火栓:3105
data.type.hydrant=3105
#amos.system.privilege.user.product=AMOS-WEB-ADMIN
#amos.system.privilege.user.app-key=AMOS_ADMIN
outSystem.fegin.name=unKnow
outSystem.user.password=a1234560
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment