This commit is contained in:
@@ -52,11 +52,15 @@ app.get('/exchange', async (c) => {
|
||||
// 查询 depCode 对应的部门名称
|
||||
let depName = '';
|
||||
if (userInfo.depCode) {
|
||||
const [rows] = await pool.execute(
|
||||
'SELECT dep_name FROM tab_department WHERE dep_code = ? AND is_deleted = 0 LIMIT 1',
|
||||
[userInfo.depCode]
|
||||
) as [{ dep_name: string }[], unknown];
|
||||
depName = rows[0]?.dep_name || '';
|
||||
try {
|
||||
const [rows] = await pool.execute(
|
||||
'SELECT dep_name FROM tab_department WHERE dep_code = ? AND is_deleted = 0 LIMIT 1',
|
||||
[userInfo.depCode]
|
||||
) as [{ dep_name: string }[], unknown];
|
||||
depName = rows[0]?.dep_name || '';
|
||||
} catch (e: any) {
|
||||
if (e?.code !== 'ER_NO_SUCH_TABLE') throw e;
|
||||
}
|
||||
}
|
||||
|
||||
const payload: JwtPayload = {
|
||||
|
||||
Reference in New Issue
Block a user