Commit 8f4b54f4 authored by 赵啸非's avatar 赵啸非

修改鉴权

parent 33f20e7b
...@@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.*; ...@@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.*;
/** /**
* 区域 Feign接口 * 区域 Feign接口
*
* @author zxfei * @author zxfei
* @date 2022-06-28 * @date 2022-06-28
*/ */
...@@ -45,7 +46,7 @@ public interface IAreaFeign extends IFeign { ...@@ -45,7 +46,7 @@ public interface IAreaFeign extends IFeign {
* @return * @return
*/ */
@GetMapping(value = "/area/delete") @GetMapping(value = "/area/delete")
String delete(Long[] ids,@RequestHeader("Authorization") String authorization); String delete(Long[] ids, @RequestHeader("Authorization") String authorization);
/** /**
...@@ -55,7 +56,7 @@ public interface IAreaFeign extends IFeign { ...@@ -55,7 +56,7 @@ public interface IAreaFeign extends IFeign {
* @return * @return
*/ */
@PostMapping(value = "/area/save") @PostMapping(value = "/area/save")
String save(@RequestBody AreaPdu areaPdu,@RequestHeader("Authorization") String authorization); String save(@RequestBody AreaPdu areaPdu, @RequestHeader("Authorization") String authorization);
} }
...@@ -69,12 +70,12 @@ class AreaFeignFallbackFactory implements FallbackFactory<IAreaFeign> { ...@@ -69,12 +70,12 @@ class AreaFeignFallbackFactory implements FallbackFactory<IAreaFeign> {
return new IAreaFeign() { return new IAreaFeign() {
@Override @Override
public String list(AreaPdu areaPdu) { public String list(AreaPdu areaPdu) {
return JSON.toJSONString(Rest.fail("暂时无法获取区域列表,请稍后再试!")); return JSON.toJSONString(Rest.fail("暂时无法获取区域列表,请稍后再试!"));
} }
@Override @Override
public String info(Long id) { public String info(Long id) {
return JSON.toJSONString(Rest.fail("暂时无法获取区域详细,请稍后再试!")); return JSON.toJSONString(Rest.fail("暂时无法获取区域详细,请稍后再试!"));
} }
@Override @Override
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<profiles.rabbitmq.virtualhost>/test</profiles.rabbitmq.virtualhost> <profiles.rabbitmq.virtualhost>/test</profiles.rabbitmq.virtualhost>
<profiles.rabbitmq.exchange></profiles.rabbitmq.exchange> <profiles.rabbitmq.exchange></profiles.rabbitmq.exchange>
<profiles.filepath>/mortals/data</profiles.filepath> <profiles.filepath>/mortals/data</profiles.filepath>
<profiles.log.level>INFO</profiles.log.level> <profiles.log.level>DEBUG</profiles.log.level>
<profiles.log.path>/logs</profiles.log.path> <profiles.log.path>/logs</profiles.log.path>
<profiles.data.path>/data</profiles.data.path> <profiles.data.path>/data</profiles.data.path>
......
...@@ -90,11 +90,12 @@ public class AuthTokenServiceImpl implements IAuthTokenService { ...@@ -90,11 +90,12 @@ public class AuthTokenServiceImpl implements IAuthTokenService {
Claims claims = parseToken(token); Claims claims = parseToken(token);
String uuid = (String) claims.get(SysConstains.LOGIN_USER_KEY); String uuid = (String) claims.get(SysConstains.LOGIN_USER_KEY);
String userKey = getTokenKey(uuid); String userKey = getTokenKey(uuid);
//cacheService.select(portalDb); // Rest<String> rest = userFeign.getToken(userKey);
// String userStr = cacheService.get(userKey); // String userStr = rest.getData();
Rest<String> rest = userFeign.getToken(userKey); cacheService.select(portalDb);
String userStr = rest.getData(); String userStr = cacheService.get(userKey);
//cacheService.select(db);
cacheService.select(db);
if (StringUtils.isNotEmpty(userStr)) { if (StringUtils.isNotEmpty(userStr)) {
UserEntity userEntity = JSONObject.parseObject(userStr, UserEntity.class); UserEntity userEntity = JSONObject.parseObject(userStr, UserEntity.class);
userEntity.setToken(token); userEntity.setToken(token);
......
...@@ -70,11 +70,7 @@ application: ...@@ -70,11 +70,7 @@ application:
registerApiPath: /api/register registerApiPath: /api/register
deviceInitApiPath: /api/deviceInit deviceInitApiPath: /api/deviceInit
deviceUpdateApiPath: /api/deviceUpdate deviceUpdateApiPath: /api/deviceUpdate
cookie:
ssoServerUrl: http://sso.testnew.com
key: 026db82420614469897fcc2dc1b4ce38
domain: 192.168.0.98
port: 11010
upload: upload:
path: @profiles.filepath@ path: @profiles.filepath@
feign: feign:
......
...@@ -10,6 +10,17 @@ Content-Type: application/json ...@@ -10,6 +10,17 @@ Content-Type: application/json
} }
###设备更新与保存
POST {{baseUrl}}/device/stopOrStartComsumeQueue
Authorization: {{authToken}}
Content-Type: application/json
{
"id": 60,
"enabled": 0
}
###设备更新与保存 ###设备更新与保存
POST {{baseUrl}}/device/save POST {{baseUrl}}/device/save
Authorization: {{authToken}} Authorization: {{authToken}}
...@@ -137,7 +148,7 @@ Content-Type: application/json ...@@ -137,7 +148,7 @@ Content-Type: application/json
Authorization: {{authToken}} Authorization: {{authToken}}
{ {
"deviceCode": "B03", "deviceCode": "94-DE-80-D5-3D-63",
"action": "upload" "action": "upload"
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.mortals</groupId> <groupId>com.mortals</groupId>
<artifactId>mortals-common</artifactId> <artifactId>mortals-common</artifactId>
<version>1.1.5-SNAPSHOT</version> <version>1.1.7-SNAPSHOT</version>
</parent> </parent>
<groupId>com.mortals.xhx</groupId> <groupId>com.mortals.xhx</groupId>
<artifactId>device-new-platform</artifactId> <artifactId>device-new-platform</artifactId>
...@@ -54,8 +54,22 @@ ...@@ -54,8 +54,22 @@
<dependency> <dependency>
<groupId>com.alibaba.cloud</groupId> <groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-loadbalancer</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId> spring-cloud-starter-netflix-ribbon</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
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