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

修改鉴权

parent 33f20e7b
......@@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.*;
/**
* 区域 Feign接口
*
* @author zxfei
* @date 2022-06-28
*/
......@@ -45,7 +46,7 @@ public interface IAreaFeign extends IFeign {
* @return
*/
@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 {
* @return
*/
@PostMapping(value = "/area/save")
String save(@RequestBody AreaPdu areaPdu,@RequestHeader("Authorization") String authorization);
String save(@RequestBody AreaPdu areaPdu, @RequestHeader("Authorization") String authorization);
}
......
......@@ -42,7 +42,7 @@
<profiles.rabbitmq.virtualhost>/test</profiles.rabbitmq.virtualhost>
<profiles.rabbitmq.exchange></profiles.rabbitmq.exchange>
<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.data.path>/data</profiles.data.path>
......
......@@ -90,11 +90,12 @@ public class AuthTokenServiceImpl implements IAuthTokenService {
Claims claims = parseToken(token);
String uuid = (String) claims.get(SysConstains.LOGIN_USER_KEY);
String userKey = getTokenKey(uuid);
//cacheService.select(portalDb);
// String userStr = cacheService.get(userKey);
Rest<String> rest = userFeign.getToken(userKey);
String userStr = rest.getData();
//cacheService.select(db);
// Rest<String> rest = userFeign.getToken(userKey);
// String userStr = rest.getData();
cacheService.select(portalDb);
String userStr = cacheService.get(userKey);
cacheService.select(db);
if (StringUtils.isNotEmpty(userStr)) {
UserEntity userEntity = JSONObject.parseObject(userStr, UserEntity.class);
userEntity.setToken(token);
......
......@@ -70,11 +70,7 @@ application:
registerApiPath: /api/register
deviceInitApiPath: /api/deviceInit
deviceUpdateApiPath: /api/deviceUpdate
cookie:
ssoServerUrl: http://sso.testnew.com
key: 026db82420614469897fcc2dc1b4ce38
domain: 192.168.0.98
port: 11010
upload:
path: @profiles.filepath@
feign:
......
......@@ -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
Authorization: {{authToken}}
......@@ -137,7 +148,7 @@ Content-Type: application/json
Authorization: {{authToken}}
{
"deviceCode": "B03",
"deviceCode": "94-DE-80-D5-3D-63",
"action": "upload"
}
......
......@@ -6,7 +6,7 @@
<parent>
<groupId>com.mortals</groupId>
<artifactId>mortals-common</artifactId>
<version>1.1.5-SNAPSHOT</version>
<version>1.1.7-SNAPSHOT</version>
</parent>
<groupId>com.mortals.xhx</groupId>
<artifactId>device-new-platform</artifactId>
......@@ -54,8 +54,22 @@
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-loadbalancer</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId> spring-cloud-starter-netflix-ribbon</artifactId>
</dependency>
</dependencies>
<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