Lellansin Huang

Results 18 issues of Lellansin Huang

A small edit, for passing the error when using http://html2jade.com/

While we change the API URL, it usually means that we are seeking for a new Gitlab which have new projects. So it's more smooth for us to clear cache...

``` npm WARN engine [email protected]: wanted: {"node":">:z=0.8.0"} (current: {"node":"0.12.2","npm":"2.11.0"}) > [email protected] preinstall /Users/Lellansin/Documents/workspace/node/threads/node_modules/tagg2 > node install.js ########################################### thanks for choose tagg2 module to let node.js have multi threads functionally tagg2...

# 删除接口 前端 HTML 直出部分调整: ```ts // src/controller/home.ts // ... import { todoList } from './api'; // 导入 api.ts 中的 todolist 数组(需要 api.ts 中 export todolist) @Provide() @Controller('/') export class...

教程

本次编码:https://github.com/Lellansin/midwayjs-tutorial/commit/d219f4635a7918c24ace1329a98680178252f8cd ![image](https://user-images.githubusercontent.com/2081487/147403660-e89fa662-d7de-4eb6-8438-61c5f605d94f.png) 新增了 message dao 的两个方法,补全了增删改查。 然后针对 dao 编写了单元测试。 ```ts import { createApp, close } from '@midwayjs/mock'; import { Framework } from '@midwayjs/web'; import * as assert from 'assert'; import...

### MVC 梳理 commit https://github.com/Lellansin/midwayjs-tutorial/commit/fa9e4a83121962e01730704fd240e5dc5168d984 - view - 调整目录 src/app/view/*.ejs -> src/view/*.ejs - model - 建了一个 model 目录 - 将 fileDB 重命名并挪到 -> src/model/dao/user - 调整目录 src/entity/* -> src/model/entity/* -...

视频中的代码修改:https://github.com/Lellansin/midwayjs-tutorial/commit/95fd1a3f721b0bbee28a52dced5b3ed77690bcb4 ### 引入 typeorm 组件 ![image](https://user-images.githubusercontent.com/2081487/145400004-81dc35f8-9e2a-41cf-bfbe-b16803e13394.png) config 配置: ```ts // ... export default (appInfo: EggAppInfo) => { const config = {} as DefaultConfig; // ... config.orm = { type: 'mysql',...

教程

### Model ```ts import { Provide, Scope, ScopeEnum } from '@midwayjs/decorator'; import { writeFile, readFile, existsSync } from 'fs'; export interface IUser { id: number; username: string; password: string; }...

教程

## Controller ### UserController - POST /register - POST /login 调用 model 判断密码是否匹配,匹配则返回登录状态 cookie - POST /logout ### MessageController - GET /message 获取消息列表 - GET /message/:id 获取具体的对话消息 - POST /message/...

教程

## 重新设计 API 根据 RESTful 的一些原则,我们对之前的 API 进行如下重新设计。《[什么是 REST API 一文读懂](https://www.bilibili.com/video/BV1BA411c7Sd)》 ### Controller - GET /api/todo 目前还是渲染的时候拼在上面的,改成前端启动的时候 fetch - POST /api/todo 目前还是 form 提交,改成 fetch POST - PUT /api/todo/:id 目前调用完是重新刷新页面的,改成...

教程