Skip to content

Commit

Permalink
refactor: Padchat对外暴漏loginType
Browse files Browse the repository at this point in the history
  • Loading branch information
binsee committed Jun 13, 2018
1 parent 678222c commit 443dd95
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,22 +264,22 @@ class Padchat extends EventEmitter {
}

switch (type) {
case 'token':
case 'request':
case loginType.token:
case loginType.request:
if (!data.token || !data.wxData) {
throw new Error('login data error!')
}
_data.token = data.token || null
break
case 'phone':
case loginType.phone:
if (!data.phone) {
// code
throw new Error('login data error!')
}
_data.phone = data.phone
_data.code = data.code
break
case 'user':
case loginType.user:
if (!data.username || !data.password) {
throw new Error('login data error!')
}
Expand Down Expand Up @@ -2543,6 +2543,6 @@ function clearRawMsg(obj) {
}


Padchat.Padchat = Padchat
Padchat.loginType = loginType
Padchat.blacklist = blacklist
module.exports = Padchat

0 comments on commit 443dd95

Please sign in to comment.