Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Houserqu/nestjs-start
/ functions
Functions
49 in github.com/Houserqu/nestjs-start
⨍
Functions
49
◇
Types & classes
58
↓ 8 callers
Method
findOne
(phone: string)
src/modules/user/user.service.ts:15
↓ 8 callers
Method
get
* axios GET 请求 * @param url * @param config
src/modules/helper/helper.service.ts:29
↓ 5 callers
Function
getWinstonConfig
(label: string)
src/common/logger.ts:12
↓ 4 callers
Method
command
* 执行 redis 命令(该方法可以执行任何命令,可以在该方法基础上给特定命令封装方法) * @param command * @param arg
src/modules/cache/redis.service.ts:29
↓ 2 callers
Function
WXBizDataCrypt
(appId, sessionKey, encryptedData, iv)
src/utils/crypto-util.ts:35
↓ 1 callers
Method
bindPhone
(phone: string, userId: number)
src/modules/user/user.service.ts:87
↓ 1 callers
Function
bootstrap
()
src/main.ts:10
↓ 1 callers
Method
createByWechat
(createWeAppUserDto: CreateWeAppUserDto)
src/modules/user/user.service.ts:60
↓ 1 callers
Method
findOneByUnionid
(unionid: string)
src/modules/user/user.service.ts:31
↓ 1 callers
Method
findUserByID
(id: number)
src/modules/user/user.service.ts:23
↓ 1 callers
Method
loginByPassword
* 手机号和密码登录(jwt) * * @param {LoginDto} loginDto * @returns {Promise<any>} * @memberof AuthService
src/modules/auth/auth.service.ts:44
↓ 1 callers
Method
loginByWeApp
* 小程序登录(unionid 方式) * @param {WeAppLoginDto} weAppLoginDto * @returns {Promise<any>} * @memberof AuthService
src/modules/auth/auth.service.ts:69
↓ 1 callers
Function
signEncrypt
(algorithm, content)
src/utils/crypto-util.ts:66
↓ 1 callers
Method
validateUser
* 手机号 和 密码 校验用户 * @param {string} phone * @param {string} password * @returns {Promise<any>} * @memberof AuthService
src/modules/auth/auth.service.ts:28
Function
Permission
(...permissions: string[])
src/modules/auth/permission.decorator.ts:7
Function
RequestMiddleware
(req: Request, res: Response, next: NextFunction)
src/common/request.middleware.ts:9
Method
axios
* axios 自定义请求 * @param config
src/modules/helper/helper.service.ts:46
Method
bindWechatPhone
* 通过小程序获取手机号并绑定 * @param {string} code * @param {string} encryptedData * @param {string} iv * @param {number} userId * @returns {Promis
src/modules/auth/auth.service.ts:145
Method
bindWechatPhone
(@Body() decodePhoneDto: DecodePhoneDto, @Req() req)
src/modules/auth/auth.controller.ts:75
Method
canActivate
(context: ExecutionContext)
src/modules/auth/permission.guard.ts:14
Method
catch
(exception: any, host: ArgumentsHost)
src/common/exception.filter.ts:10
Method
constructor
( )
src/modules/cache/redis.service.ts:12
Method
constructor
( private redisService: RedisService )
src/modules/cache/cache.controller.ts:6
Method
constructor
( private readonly userService: UserService, private readonly jwtService: JwtService, private read
src/modules/auth/auth.service.ts:15
Method
constructor
()
src/modules/auth/jwt.strategy.ts:8
Method
constructor
(private readonly authService: AuthService)
src/modules/auth/local.strategy.ts:8
Method
constructor
( private reflector: Reflector, )
src/modules/auth/permission.guard.ts:10
Method
constructor
( private readonly userService: UserService, private readonly authService: AuthService, )
src/modules/auth/auth.controller.ts:14
Method
constructor
( @InjectModel(User) private userRepository: typeof User, )
src/modules/user/user.service.ts:10
Method
constructor
( private httpService: HttpService, )
src/modules/helper/helper.service.ts:7
Method
constructor
(code: string, message?: string, data?: any)
src/common/error.exception.ts:7
Method
constructor
()
src/common/transform.interceptor.ts:15
Method
constructor
()
src/common/exception.filter.ts:8
Method
create
(createUserDto: CreateUserDto)
src/modules/user/user.service.ts:39
Function
decrypt
(dataStr, key, iv)
src/utils/crypto-util.ts:10
Function
encrypt
(dataStr, key, iv)
src/utils/crypto-util.ts:26
Method
example
()
src/modules/cache/cache.controller.ts:15
Method
get
* 获取 字符串类型 值(基于 command 封装) * @param {string} key
src/modules/cache/redis.service.ts:41
Method
getHello
(@Res() res: Response)
src/modules/app/app.controller.ts:8
Method
getJwtPayload
* 根据 jwt token 获取 payload * @param {string} token * @returns {Promise<any>}
src/modules/auth/auth.service.ts:178
Method
getProfile
(@Request() req)
src/modules/auth/auth.controller.ts:27
Function
getRequestId
(request: Request)
src/modules/helper/helper.utils.ts:6
Method
intercept
( context: ExecutionContext, next: CallHandler<T>, )
src/common/transform.interceptor.ts:17
Method
login
(@Body() loginDto: LoginDto, @Res() res)
src/modules/auth/auth.controller.ts:44
Method
post
* axios POST 请求 * @param url * @param config
src/modules/helper/helper.service.ts:38
Function
sha1
(content)
src/utils/crypto-util.ts:76
Method
validate
* jwt 校验方法 * 在这之前 jwt 生成的 token 已经通过校验,是安全有效的,所以这里可以直接返回 payload,并自动挂载在请求上下文中(req.user) * 也可以在这里做一些额外查询/校验逻辑 * 安全问题:jwt 一旦签发之后,服务端无法主动销毁,存在被盗
src/modules/auth/jwt.strategy.ts:23
Method
validate
(phone: string, password: string)
src/modules/auth/local.strategy.ts:12
Method
wxlogin
(@Body() weAppLoginDto: WeAppLoginDto, @Res() res: Response)
src/modules/auth/auth.controller.ts:60