Skip to content

Commit 3f23fb4

Browse files
committed
Refine code
1 parent 3a9b5e6 commit 3f23fb4

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

www/cart/order.js

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -182,20 +182,14 @@ function newOrder() {
182182
}
183183

184184
if ( license_type === 'G' ) {
185-
if ( email.indexOf('@gmail.') > 0
186-
|| email.indexOf('@qq.') > 0
187-
|| email.indexOf('@163.') > 0
188-
|| email.indexOf('@126.') > 0
189-
|| email.indexOf('@139.') > 0
190-
|| email.indexOf('@sohu.') > 0
191-
|| email.indexOf('@sina.') > 0
192-
|| email.indexOf('@foxmail.') > 0
193-
|| email.indexOf('@outlook.') > 0
194-
|| email.indexOf('@icloud.') > 0
195-
|| email.indexOf('@yahoo.') > 0
196-
|| email.indexOf('@proton.me') > 0
197-
|| email.indexOf('@protonmail.com') > 0
198-
|| email.indexOf('@hotmail.') > 0 ) {
185+
var pubemails = [
186+
'@qq.', '@163.', '@126.', '@139.',
187+
'@sohu.', '@sina.', '@foxmail.',
188+
'@gmail.', '@outlook.', '@hotmail.',
189+
'@icloud.', '@yahoo.',
190+
'@proton.me', '@protonmail.com',
191+
]
192+
if (pubemails.some((x) => email.indexOf(x) > 0)) {
199193
element.value = '必须是公司邮箱';
200194
element.focus();
201195
return false;

0 commit comments

Comments
 (0)