修复userid关联性问题

This commit is contained in:
wuhan 2023-08-03 18:32:14 +08:00
parent b1e75dcb53
commit 1c71a2e7cb
2 changed files with 11 additions and 29 deletions

View File

@ -12,16 +12,15 @@ class ClientMapper {
async getClientToken(clientId: string) {
return await db(
'select a.token,TIMESTAMPDIFF(MINUTE,NOW(),a.expires_time) AS expiresIn from szja_client_token a where client_id = ? and TIMESTAMPDIFF(MINUTE,NOW(),a.expires_time) > 0',
[clientId],
'select a.token,TIMESTAMPDIFF(MINUTE,NOW(),a.expires_time) AS expiresIn from szja_client_token a where client_id = ? and TIMESTAMPDIFF(MINUTE,NOW(),a.expires_time) > 0',
[clientId],
);
}
async getClientTokenInfor(clientId: string) {
return await db(
'select * from szja_client_token where client_id = ?',
[clientId],
);
return await db('select * from szja_client_token where client_id = ?', [
clientId,
]);
}
async getClientByRefId(entId: string) {
@ -42,8 +41,8 @@ class ClientMapper {
async updateClientToken(clientId: string, token: string, expireTime: Date) {
return db(
'update szja_client_token set token = ?, expires_time= ?, delete_time= ? where client_id = ?',
[token, expireTime, expireTime, clientId]
'update szja_client_token set token = ?, expires_time= ?, delete_time= ? where client_id = ?',
[token, expireTime, expireTime, clientId],
);
}
@ -332,7 +331,7 @@ class ClientMapper {
`;
// hcc需要做表关联
if (hccId) {
sql += ` left join szja_user_home uh on uh.user_id = i.app_user_id where uh.hcc_id = ?`;
sql += ` left join szja_user_home uh on uh.user_id = i.id where uh.hcc_id = ?`;
arr.push(hccId);
}
if (userId) {

View File

@ -1,26 +1,9 @@
import { Module, NestModule } from '@nestjs/common';
import { Module } from '@nestjs/common';
import { OpenDataService } from './open-data.service';
import { OpenDataController } from './open-data.controller';
// 导入鉴权中间件
import { RolesGuard } from './open_data.middleware';
import { APP_GUARD } from '@nestjs/core';
@Module({
controllers: [OpenDataController],
providers: [OpenDataService],
})
export class OpenDataModule {
// configure(consumer: MiddlewareConsumer) {
// throw new Error('Method not implemented.');
// }
}
// configure(consumer: MiddlewareConsumer) {
// throw new Error('Method not implemented.');
// }
// configure(consumer: MiddlewareConsumer) {
// const openDataMI: OpenDataTokenMiddleware = new OpenDataTokenMiddleware();
// I want this
// cosnt p:preHandlerAsyncHookHandler = OpenDataTokenMiddleware
// OpenDataTokenMiddleware.use(req, res, next);
// preHandlerHookHandler;
// consumer.apply(OpenDataTokenMiddleware).forRoutes(OpenDataController);
// }
export class OpenDataModule {}