hackycy / sf-nest-admin Goto Github PK
View Code? Open in Web Editor NEW🚀 基于NestJs + TypeScript + TypeORM + Redis + MySql + Vue2 + Element-UI编写的一款简单高效的前后端分离的权限管理系统
Home Page: http://opensource.admin.si-yee.com
License: MIT License
🚀 基于NestJs + TypeScript + TypeORM + Redis + MySql + Vue2 + Element-UI编写的一款简单高效的前后端分离的权限管理系统
Home Page: http://opensource.admin.si-yee.com
License: MIT License
{
"code": 500,
"data": null,
"message": "TypeError: classTransformer.plainToClass is not a function"
}
@Authorize()
@Post()
async updateQuestion(@Body() dto: UpdateQuestionDto) {
return await this.questionService.updateQuestion(dto);
}
export class UpdateQuestionDto extends CreateQuestionDto {
id: number;
}
export class CreateQuestionDto {
@ApiProperty({
required: true,
description: '问题',
})
@IsString()
question: string;
@ApiProperty({
required: false,
description: '答案',
})
@IsString()
@IsOptional()
anwser?: string;
@ApiProperty({
description: '类型',
})
@IsInt()
@IsOptional()
type?: number;
}
作者你好!我想问下怎么对特定的账号开放多点登录,刚接触nodejs后端,不是很懂要改哪里,希望作者指点一二,感谢🙏
我想新建一个模块,该模块有自己的守卫规则
小弟是菜鸟全干工程师一枚,我去看了 vue-element-admin 这个项目,发现他的路由是写在前端的。但是此项目的菜单路由是写在后端的。如果这样做的话路由不是需要在后端加,真实页面得在前端加,这样不会有点奇怪吗? 或者有其它考量呢? 望大佬赐教,小弟不胜感激。
server端启动后 报
Generic type 'RemoteSocket<EmitEvents, SocketData>' requires 2 type argument(s).
我把这个错误修复后又报
ERROR [ApiExceptionFilter] TypeError: classTransformer.plainToClass is not a function
问下,是有什么依赖没有锁定么。
文档如果添加一个新模块的demo实现教程会更加方便上手
比如一个文章编辑或者一个留言之类,或者网盘模块的实现等
刚启动时没提示,后面启动都报FastifyWarning.fastify-formbody: fastify-formbody has been deprecated. Use @fastify/[email protected] instead.
前端如果js代码都是不带分号的(代码结尾带分号会有警告)
后端你的js代码都是带分号的
建议统一前后端是js代码格式
项目根目录下命令行输入 nest g mo api 之类的nest-cli命令 ,无反应。
能否在项目里再启动一个websocket服务?要怎么写
debian 11 nodejs 12或者14 用cli全新安装后
npn run dev后提示
[2:31:50 PM] Starting compilation in watch mode...
node_modules/@nestjs/typeorm/dist/common/typeorm.decorators.d.ts:2:10 - error TS2305: Module '"typeorm"' has no exported member 'DataSource'.
2 import { DataSource, DataSourceOptions } from 'typeorm';
~~~~~~~~~~
node_modules/@nestjs/typeorm/dist/common/typeorm.decorators.d.ts:2:22 - error TS2305: Module '"typeorm"' has no exported member 'DataSourceOptions'.
2 import { DataSource, DataSourceOptions } from 'typeorm';
~~~~~~~~~~~~~~~~~
node_modules/@nestjs/typeorm/dist/common/typeorm.utils.d.ts:3:10 - error TS2305: Module '"typeorm"' has no exported member 'DataSource'.
3 import { DataSource, DataSourceOptions } from 'typeorm';
~~~~~~~~~~
node_modules/@nestjs/typeorm/dist/common/typeorm.utils.d.ts:3:22 - error TS2305: Module '"typeorm"' has no exported member 'DataSourceOptions'.
3 import { DataSource, DataSourceOptions } from 'typeorm';
~~~~~~~~~~~~~~~~~
node_modules/@nestjs/typeorm/dist/interfaces/typeorm-options.interface.d.ts:2:10 - error TS2305: Module '"typeorm"' has no exported member 'DataSource'.
2 import { DataSource, DataSourceOptions } from 'typeorm';
~~~~~~~~~~
node_modules/@nestjs/typeorm/dist/interfaces/typeorm-options.interface.d.ts:2:22 - error TS2305: Module '"typeorm"' has no exported member 'DataSourceOptions'.
2 import { DataSource, DataSourceOptions } from 'typeorm';
~~~~~~~~~~~~~~~~~
node_modules/@nestjs/typeorm/dist/typeorm.module.d.ts:2:10 - error TS2305: Module '"typeorm"' has no exported member 'DataSource'.
2 import { DataSource, DataSourceOptions } from 'typeorm';
~~~~~~~~~~
node_modules/@nestjs/typeorm/dist/typeorm.module.d.ts:2:22 - error TS2305: Module '"typeorm"' has no exported member 'DataSourceOptions'.
2 import { DataSource, DataSourceOptions } from 'typeorm';
~~~~~~~~~~~~~~~~~
src/modules/admin/system/online/online.service.ts:63:49 - error TS2314: Generic type 'RemoteSocket<EmitEvents, SocketData>' requires 2 type argument(s).
63 async findSocketIdByUid(uid: number): Promise<RemoteSocket> {
~~~~~~~~~~~~~~~~~~~~~
[2:32:08 PM] Found 9 errors. Watching for file changes.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.