修复userid关联性问题
This commit is contained in:
parent
b1e75dcb53
commit
1c71a2e7cb
|
@ -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) {
|
||||
|
|
|
@ -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 {}
|
||||
|
|
Loading…
Reference in New Issue
Block a user