diff --git a/.env.development b/.env.development index bc6eb09..50d2480 100644 --- a/.env.development +++ b/.env.development @@ -8,7 +8,8 @@ API_TOKEN_EXPIRESIN=1d GOOGLE_OAUTH_CLIENT="53206975661-asnf3qe4bg29p8h981pgf099osvrjbme.apps.googleusercontent.com" GOOGLE_OAUTH_CLIENT2="53206975661-ih3r0ubph3rqejdq97b029difbrk2bqj.apps.googleusercontent.com" GOOGLE_OAUTH_CLIENT_IOS="53206975661-qan0rnefniegjv53ohild375pv0p7ekd.apps.googleusercontent.com" -DB_MAIN=mongodb://188.88.0.2/wallet-development +# DB_MAIN=mongodb://188.88.0.2/wallet-development +DB_MAIN=mongodb://192.168.100.22/wallet-development EMAIL_VERIFY_URL="https://wallet.cebggame.com" EMAIL_SERVER='http://127.0.0.1:3087' diff --git a/src/controllers/mail.controller.ts b/src/controllers/mail.controller.ts index 6f8bd0d..5d7ac94 100644 --- a/src/controllers/mail.controller.ts +++ b/src/controllers/mail.controller.ts @@ -3,6 +3,8 @@ import logger from 'logger/logger' import { Account } from 'modules/Account' import { CodeRecord, CodeStatus, CodeType, DEFAULT_CODE, DEFAULT_EXPIRE_TIME } from 'modules/CodeRecord' import { + DEFAULT_LOGIN_MAIL_HTML, + DEFAULT_LOGIN_MAIL_SUBJECT, DEFAULT_REGIST_HTML, DEFAULT_REGIST_SUBJECT, DEFAULT_RESET_HTML, @@ -154,6 +156,12 @@ class MailController extends BaseController { case CodeType.VERIFY: html = DEFAULT_VERIFY_MAIL_HTML subject = DEFAULT_VERIFY_MAIL_SUBJECT + case CodeType.LOGIN: + html = DEFAULT_LOGIN_MAIL_HTML + subject = DEFAULT_LOGIN_MAIL_SUBJECT + } + if (!html || !subject) { + throw new ZError(15, 'type error') } subject = record.code + ' ' + subject diff --git a/src/plats/PlatEmail.ts b/src/plats/PlatEmail.ts index a04f55a..b946490 100644 --- a/src/plats/PlatEmail.ts +++ b/src/plats/PlatEmail.ts @@ -38,7 +38,7 @@ export class PlatEmail implements IPlat { throw new ZError(14, 'code error') } const openId = sha1(email) - let data: any = { email, emailVerified: true } + let data: any = { email, emailReal: email, emailVerified: true } const { api_platform } = req.headers if (api_platform) { data.platform = api_platform