wangwei 7 ani în urmă
părinte
comite
df12d53565

+ 21 - 0
examcloud-core-basic-api-provider/src/main/java/cn/com/qmth/examcloud/core/basic/api/controller/TestController.java

@@ -0,0 +1,21 @@
+package cn.com.qmth.examcloud.core.basic.api.controller;
+
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import cn.com.qmth.examcloud.commons.base.util.DateUtil;
+import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
+import io.swagger.annotations.ApiOperation;
+
+@RestController
+@RequestMapping("${$rmp.ctr.basic}")
+public class TestController extends ControllerSupport {
+
+	@ApiOperation(value = "测试")
+	@GetMapping()
+	public String info() {
+		return DateUtil.getNowISO();
+	}
+
+}

+ 6 - 1
examcloud-core-basic-service/src/main/java/cn/com/qmth/examcloud/core/basic/service/impl/AuthServiceImpl.java

@@ -188,7 +188,12 @@ public class AuthServiceImpl implements AuthService {
 
 	@Override
 	public void logout(User user) {
-		redisClient.delete(user.getKey());
+		if (StringUtils.isNotBlank(user.getKey())) {
+			redisClient.delete(user.getKey());
+		} else {
+			String key = buildUserKey(user.getUserType(), user.getRootOrgId(), user.getUserId());
+			redisClient.delete(key);
+		}
 	}
 
 	@Override