/** * 外部登录接口 * POST /api/external/login * Header: X-API-Key: abc123456 * Body: { "account": "13800138000", "password": "123456" } */@PostMapping("/login")public CommonResult<LoginResponse> login(@RequestBody Map<String, String> params, HttpServletRequest request) { // 1. 认证调用方 String headerKey = request.getHeader("X-API-Key"); if (headerKey == null || !headerKey.equals(apiKey)) { return CommonResult.failed("认证失败"); } // 2. 获取账号密码 String account = params.get("account"); String password = params.get("password"); if (StrUtil.isBlank(account) || StrUtil.isBlank(password)) { return CommonResult.failed("参数错误"); } // 3. 构造 LoginRequest 并调用原有登录逻辑 LoginRequest loginRequest = new LoginRequest(); loginRequest.setPhone(account); // 手机号或用户名 loginRequest.setPassword(password); LoginResponse loginResponse = loginService.login(loginRequest); return CommonResult.success(loginResponse);}我调用了这个接口,获取到了tokne,我携带token访问首页,https:xxxxx?token=xxxxxxx,去访问,不能自动登录,要修改什么文件呢?

