Skip to content

Commit

Permalink
docs: 添加注释
Browse files Browse the repository at this point in the history
  • Loading branch information
LiuSongJiang committed Jul 26, 2019
1 parent ef2914b commit 55facc0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/api/test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as Hapi from "hapi";
import TestRequest from "./controller";
import Validator from "./validator";


export default (server: Hapi.Server): Hapi.ServerRoute[] => {
const testRequest = new TestRequest();

Expand Down
10 changes: 7 additions & 3 deletions src/api/wxLogin/controller.helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ export interface IWxLoginParams {

/**
* 微信登陆
* @param {object} {appid,secret,js_code,grant_type}
* @param {object} params
* @param {string} params.appid
* @param {string} params.secret
* @param {string} params.js_code
* @param {string} params.grant_type
* @returns {object} {openid, sessionKey}
*/
export async function getSession(params: IWxLoginParams) {
Expand All @@ -28,8 +32,8 @@ export async function getSession(params: IWxLoginParams) {

/**
* 签发JWT
* @param userId
* @returns token
* @param {string} userId
* @returns {string} token
*/
export function generateToken(userId: string) {
const payload = {
Expand Down
2 changes: 1 addition & 1 deletion src/api/wxLogin/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default class WxLoginController {
}

// 更新用户信息
await usersModel.save(user, {
usersModel.save(user, {
nickName: userInfo.nickName,
avatarUrl: userInfo.avatarUrl
});
Expand Down

0 comments on commit 55facc0

Please sign in to comment.