代码提交
This commit is contained in:
@@ -49,8 +49,10 @@ import static springfox.documentation.schema.AlternateTypeRules.newRule;
|
||||
@EnableSwagger2
|
||||
public class SwaggerConfig {
|
||||
|
||||
@Value("${sa-token.token-name}")
|
||||
private String tokenHeader;
|
||||
|
||||
@Value("${sa-token.token-prefix}")
|
||||
private String tokenStartWith;
|
||||
|
||||
@Value("${swagger.enabled}")
|
||||
|
||||
@@ -19,6 +19,7 @@ import cn.dev33.satoken.secure.SaSecureUtil;
|
||||
import cn.dev33.satoken.stp.SaLoginModel;
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.wf.captcha.base.Captcha;
|
||||
@@ -106,21 +107,12 @@ public class AuthorizationController {
|
||||
user.setUser(userDto);
|
||||
user.setPermissions(permissionList);
|
||||
|
||||
|
||||
|
||||
// SaLoginModel 配置登录相关参数
|
||||
StpUtil.login(2L, new SaLoginModel()
|
||||
.setToken("123") // 此次登录的客户端设备类型, 用于[同端互斥登录]时指定此次登录的设备类型
|
||||
.setExtra("loginInfo", user) // Token挂载的扩展参数 (此方法只有在集成jwt插件时才会生效)
|
||||
);
|
||||
// SaLoginModel 配置登录相关参数
|
||||
StpUtil.login(userDto.getId(), new SaLoginModel()
|
||||
.setDevice("PC") // 此次登录的客户端设备类型, 用于[同端互斥登录]时指定此次登录的设备类型
|
||||
.setExtra("loginInfo", user) // Token挂载的扩展参数 (此方法只有在集成jwt插件时才会生效)
|
||||
);
|
||||
|
||||
StpUtil.
|
||||
|
||||
// 返回 token 与 用户信息
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("roles", permissionList);
|
||||
@@ -169,7 +161,10 @@ public class AuthorizationController {
|
||||
@ApiOperation("退出登录")
|
||||
@DeleteMapping(value = "/logout")
|
||||
public ResponseEntity<Object> logout(HttpServletRequest request) {
|
||||
// onlineUserService.logout(StpUtil.getTokenValue());
|
||||
if (ObjectUtil.isNotEmpty(StpUtil.getTokenValue())){
|
||||
onlineUserService.logout(StpUtil.getTokenValue());
|
||||
}
|
||||
|
||||
StpUtil.logout();
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -21,33 +21,4 @@ public class Init implements ApplicationRunner {
|
||||
public void run(ApplicationArguments args) throws Exception {
|
||||
System.out.println("项目启动成功!");
|
||||
}
|
||||
|
||||
private void initPoint() {
|
||||
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point");
|
||||
JSONArray arr = WQLObject.getWQLObject("sch_base_point").query("block_num>0").getResultJSONArray(0);
|
||||
for (int i = 0; i < arr.size(); i++) {
|
||||
JSONObject json = arr.getJSONObject(i);
|
||||
Integer block_num = json.getInteger("block_num");
|
||||
Integer col_num = json.getInteger("col_num");
|
||||
|
||||
String col_numS = "0" + col_num;
|
||||
if (col_num > 9) {
|
||||
col_numS = String.valueOf(col_num);
|
||||
}
|
||||
|
||||
Integer row_num = json.getInteger("row_num");
|
||||
String row_numS = "0" + row_num;
|
||||
if (row_num > 9) {
|
||||
row_numS = String.valueOf(row_num);
|
||||
}
|
||||
|
||||
|
||||
String point_code = 2+""+block_num + col_numS+"-" + row_numS +"-"+ "01";
|
||||
String point_name = col_num + "排" + row_num + "列1层";
|
||||
json.put("point_code", point_code);
|
||||
json.put("point_name", point_name);
|
||||
pointTab.update(json);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user