# `Sp_interface_login_before` (procedure)

> 调用接口前参数组装


- **Type:** PROCEDURE
- **Deterministic:** NO
- **SQL data access:** CONTAINS SQL

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sProData` | `longtext` |
| 2 | IN | `sMakePerson` | `varchar(100)` |
| 3 | IN | `sBrId` | `varchar(100)` |
| 4 | IN | `sSuId` | `varchar(100)` |
| 5 | OUT | `sCode` | `int` |
| 6 | OUT | `sReturn` | `longtext` |
| 7 | OUT | `sHeader` | `longtext` |
| 8 | OUT | `sUrl` | `varchar(100)` |
| 9 | OUT | `sHttpUrl` | `varchar(1000)` |
| 10 | OUT | `sParam` | `longtext` |

## Body

_Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE PROCEDURE `Sp_interface_login_before`'`._

## Narrative

**Business context:** Kingdee K3 Cloud integration login-hook. Returns the URL/headers/JSON-body that `JdInterfaceServiceImpl.login()` needs in order to POST to the K3 Cloud `AuthService.validateUser` endpoint and harvest the auth cookies that subsequent voucher pushes (`Sp_interface_udfvoucher_before/_after`) reuse.

**What it does:** Hard-codes `sHttpUrl` to `https://zhhm.ik3cloud.com/K3cloud/Kingdee.BoS.WebApi.ServicesStub.AuthService.validateUser.common.kdsvc` and `sParam` to a `JSON_OBJECT('acctID','20210721173703','username','Administrator','password','Hamah@2022','lcid','2052')`. Returns an empty `sHeader` JSON object. Note: credentials are hard-coded customer-specific values; multi-tenant deployments must replace this body before going live (consider reading from `SysSystemSettings`).

**Invocation:** Called by `JdInterfaceServiceImpl.login()` (xly-src `xlyInterface/src/main/java/com/xly/service/impl/JdInterfaceServiceImpl.java`) via `procedureService.getCallPro()` whenever `JDUDFVOUCHER()` needs a fresh K3 Cloud auth cookie. The Java side passes `sBrId`/`sSuId` so a future implementation can pull tenant-specific credentials from configuration rather than the hard-coded constants here.
