ts-glitter 20.9.4 → 20.9.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lowcode/Entry.js +1 -1
- package/lowcode/Entry.ts +1 -1
- package/lowcode/cms-plugin/pos-config-setting.js +22 -16
- package/lowcode/cms-plugin/pos-config-setting.ts +25 -20
- package/lowcode/cms-plugin/pos-pages/connection-mode.js +1 -0
- package/lowcode/cms-plugin/pos-pages/connection-mode.ts +1 -0
- package/lowcode/cms-plugin/pos-pages/payment-function.js +2 -0
- package/lowcode/cms-plugin/pos-pages/payment-function.ts +2 -0
- package/lowcode/cms-plugin/shopping-finance-setting.js +42 -8
- package/lowcode/cms-plugin/shopping-finance-setting.ts +52 -9
- package/lowcode/glitter-base/global/payment-config.js +2 -2
- package/lowcode/glitter-base/global/payment-config.ts +10 -2
- package/lowcode/public-components/user-manager/um-login.js +309 -228
- package/lowcode/public-components/user-manager/um-login.ts +390 -306
- package/package.json +1 -1
- package/src/api-public/models/glitter-finance.js.map +1 -1
- package/src/api-public/models/glitter-finance.ts +1 -0
- package/src/services/private_config.js +5 -0
- package/src/services/private_config.js.map +1 -1
- package/src/services/private_config.ts +6 -0
|
@@ -5,7 +5,7 @@ import { Language } from '../../glitter-base/global/language.js';
|
|
|
5
5
|
import { Tool } from '../../modules/tool.js';
|
|
6
6
|
import { GlobalUser } from '../../glitter-base/global/global-user.js';
|
|
7
7
|
import { ApiUser } from '../../glitter-base/route/user.js';
|
|
8
|
-
import {FormCheck} from
|
|
8
|
+
import { FormCheck } from '../../cms-plugin/module/form-check.js';
|
|
9
9
|
import { ShareDialog } from '../../glitterBundle/dialog/ShareDialog.js';
|
|
10
10
|
|
|
11
11
|
const html = String.raw;
|
|
@@ -58,13 +58,18 @@ export class UMLogin {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
if (vm.viewType === 'send_forget_pwd_email') {
|
|
61
|
-
return html
|
|
61
|
+
return html` <section class="${gClass('container')}">
|
|
62
62
|
<div class="${gClass('box')}">
|
|
63
63
|
<div class="${gClass('login-title')}">${Language.text('forgot_password')}</div>
|
|
64
64
|
<div class="w-100 d-flex flex-column gap-3">
|
|
65
65
|
<div>
|
|
66
66
|
<label class="${gClass('label')}">${Language.text('email')}</label>
|
|
67
|
-
<input
|
|
67
|
+
<input
|
|
68
|
+
class="bgw-input"
|
|
69
|
+
type="text"
|
|
70
|
+
id="vm-email"
|
|
71
|
+
placeholder="${Language.text('email_placeholder')}"
|
|
72
|
+
/>
|
|
68
73
|
</div>
|
|
69
74
|
<div
|
|
70
75
|
class="${gClass('button')} my-2"
|
|
@@ -81,13 +86,18 @@ export class UMLogin {
|
|
|
81
86
|
}
|
|
82
87
|
|
|
83
88
|
if (vm.viewType === 'validation_code') {
|
|
84
|
-
return html
|
|
89
|
+
return html` <section class="${gClass('container')}">
|
|
85
90
|
<div class="${gClass('box')}">
|
|
86
91
|
<div class="${gClass('login-title')}">${Language.text('enter_verification_code')}</div>
|
|
87
92
|
<div class="w-100 d-flex flex-column gap-3">
|
|
88
93
|
<div>
|
|
89
94
|
<label class="${gClass('label')}">${Language.text('verification_code')}</label>
|
|
90
|
-
<input
|
|
95
|
+
<input
|
|
96
|
+
class="bgw-input"
|
|
97
|
+
type="text"
|
|
98
|
+
id="vm-code"
|
|
99
|
+
placeholder="${Language.text('please_enter_verification_code')}"
|
|
100
|
+
/>
|
|
91
101
|
</div>
|
|
92
102
|
${this.sendCodeAgain(gvc, vm.prefix, () => {
|
|
93
103
|
this.sendResetEmail(widget, vm);
|
|
@@ -107,17 +117,27 @@ export class UMLogin {
|
|
|
107
117
|
}
|
|
108
118
|
|
|
109
119
|
if (vm.viewType === 'reset_password') {
|
|
110
|
-
return html
|
|
120
|
+
return html` <section class="${gClass('container')}">
|
|
111
121
|
<div class="${gClass('box')}">
|
|
112
122
|
<div class="${gClass('login-title')}">${Language.text('reset_password')}</div>
|
|
113
123
|
<div class="w-100 d-flex flex-column gap-3">
|
|
114
124
|
<div>
|
|
115
125
|
<label class="${gClass('label')}">${Language.text('new_password')}</label>
|
|
116
|
-
<input
|
|
126
|
+
<input
|
|
127
|
+
class="bgw-input"
|
|
128
|
+
type="password"
|
|
129
|
+
id="vm-new-password"
|
|
130
|
+
placeholder="${Language.text('new_password_placeholder')}"
|
|
131
|
+
/>
|
|
117
132
|
</div>
|
|
118
133
|
<div>
|
|
119
134
|
<label class="${gClass('label')}">${Language.text('confirm_password')}</label>
|
|
120
|
-
<input
|
|
135
|
+
<input
|
|
136
|
+
class="bgw-input"
|
|
137
|
+
type="password"
|
|
138
|
+
id="vm-confirm-password"
|
|
139
|
+
placeholder="${Language.text('please_enter_password_again')}"
|
|
140
|
+
/>
|
|
121
141
|
</div>
|
|
122
142
|
<div
|
|
123
143
|
class="${gClass('button')} my-2"
|
|
@@ -134,24 +154,29 @@ export class UMLogin {
|
|
|
134
154
|
}
|
|
135
155
|
|
|
136
156
|
if (vm.viewType === 'register') {
|
|
137
|
-
return html
|
|
157
|
+
return html` <section class="${gClass('container')}">
|
|
138
158
|
<div class="${gClass('box')}">
|
|
139
159
|
<div class="${gClass('login-title')}">${Language.text('member_register')}</div>
|
|
140
160
|
<div class="w-100 d-flex flex-column gap-3">
|
|
141
161
|
${vm.registerConfig
|
|
142
162
|
.map((item: any) => {
|
|
143
163
|
if (item.hidden) return '';
|
|
144
|
-
const title = ['name', 'email', 'phone', 'birth'].includes(item.key)
|
|
145
|
-
|
|
146
|
-
|
|
164
|
+
const title = ['name', 'email', 'phone', 'birth'].includes(item.key)
|
|
165
|
+
? Language.text(`form_${item.key}`)
|
|
166
|
+
: item.title;
|
|
167
|
+
const placeholder =
|
|
168
|
+
Language.text(`please_enter_${item.key}`) || item.form_config.place_holder || '';
|
|
169
|
+
const cell = html` <div class="position-relative">
|
|
147
170
|
<label class="${gClass('label')}">${title}</label>
|
|
148
171
|
<input
|
|
149
172
|
class="bgw-input"
|
|
150
173
|
type="${item.form_config.type}"
|
|
151
174
|
id="reg-${item.key}"
|
|
152
|
-
${
|
|
175
|
+
${item.form_config.type === 'date'
|
|
176
|
+
? ``
|
|
177
|
+
: ` placeholder="${placeholder}"
|
|
153
178
|
data-placeholder="${placeholder}"`}
|
|
154
|
-
onchange="${gvc.event(
|
|
179
|
+
onchange="${gvc.event(e => {
|
|
155
180
|
if (CheckInput.isEmpty(e.value)) {
|
|
156
181
|
e.style.color = 'rgba(0,0,0,0)';
|
|
157
182
|
e.dataset.placeholder = placeholder;
|
|
@@ -165,25 +190,34 @@ export class UMLogin {
|
|
|
165
190
|
|
|
166
191
|
if (item.key === 'email' && vm.loginConfig.email_verify) {
|
|
167
192
|
return html`${cell}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
193
|
+
<div>
|
|
194
|
+
<label class="${gClass('label')}">${Language.text('email_verification_code')}</label>
|
|
195
|
+
<input
|
|
196
|
+
class="bgw-input"
|
|
197
|
+
type="text"
|
|
198
|
+
id="reg-${item.key}-verify"
|
|
199
|
+
placeholder="${Language.text('please_enter_verification_code')}"
|
|
200
|
+
/>
|
|
201
|
+
</div>
|
|
202
|
+
${this.sendCodeAgain(gvc, vm.prefix, () => {
|
|
203
|
+
this.sendVerifyEmailCode(widget, `reg-${item.key}`);
|
|
204
|
+
})}`;
|
|
175
205
|
}
|
|
176
206
|
|
|
177
207
|
if (item.key === 'phone' && vm.loginConfig.phone_verify) {
|
|
178
208
|
return html`${cell}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
209
|
+
<div>
|
|
210
|
+
<label class="${gClass('label')}">${Language.text('sms_verification_code')}</label>
|
|
211
|
+
<input
|
|
212
|
+
class="bgw-input"
|
|
213
|
+
type="text"
|
|
214
|
+
id="reg-${item.key}-verify"
|
|
215
|
+
placeholder="${Language.text('please_enter_verification_code')}"
|
|
216
|
+
/>
|
|
217
|
+
</div>
|
|
218
|
+
${this.sendCodeAgain(gvc, vm.prefix, () => {
|
|
219
|
+
this.sendVerifyPhoneCode(widget, `reg-${item.key}`);
|
|
220
|
+
})}`;
|
|
187
221
|
}
|
|
188
222
|
|
|
189
223
|
return cell;
|
|
@@ -191,11 +225,21 @@ export class UMLogin {
|
|
|
191
225
|
.join('')}
|
|
192
226
|
<div>
|
|
193
227
|
<label class="${gClass('label')}">${Language.text('password')}</label>
|
|
194
|
-
<input
|
|
228
|
+
<input
|
|
229
|
+
class="bgw-input"
|
|
230
|
+
type="password"
|
|
231
|
+
id="vm-password"
|
|
232
|
+
placeholder="${Language.text('please_enter_password')}"
|
|
233
|
+
/>
|
|
195
234
|
</div>
|
|
196
235
|
<div>
|
|
197
236
|
<label class="${gClass('label')}">${Language.text('confirm_password')}</label>
|
|
198
|
-
<input
|
|
237
|
+
<input
|
|
238
|
+
class="bgw-input"
|
|
239
|
+
type="password"
|
|
240
|
+
id="vm-confirm-password"
|
|
241
|
+
placeholder="${Language.text('please_enter_password_again')}"
|
|
242
|
+
/>
|
|
199
243
|
</div>
|
|
200
244
|
<div
|
|
201
245
|
class="${gClass('button')} my-2"
|
|
@@ -209,17 +253,19 @@ export class UMLogin {
|
|
|
209
253
|
<div class="d-flex flex-column gap-2 text-center mt-1">
|
|
210
254
|
<div class="${gClass('font-16')}">
|
|
211
255
|
${Language.text('member_exists_prompt')}<span
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
256
|
+
class="${gClass('blue-note')}"
|
|
257
|
+
onclick="${gvc.event(() => {
|
|
258
|
+
this.viewCallback(vm, '');
|
|
259
|
+
})}"
|
|
260
|
+
>${Language.text('login')}</span
|
|
261
|
+
>
|
|
218
262
|
</div>
|
|
219
263
|
<div class="${gClass('font-14')}">
|
|
220
|
-
${Language.text('registration_terms_agreement')}<a class="${gClass('blue-note')}" href="/privacy"
|
|
221
|
-
|
|
222
|
-
|
|
264
|
+
${Language.text('registration_terms_agreement')}<a class="${gClass('blue-note')}" href="/privacy"
|
|
265
|
+
>${Language.text('terms_of_service')}</a
|
|
266
|
+
>${Language.text('and')}<a class="${gClass('blue-note')}" href="/term"
|
|
267
|
+
>${Language.text('privacy_policy')}</a
|
|
268
|
+
>
|
|
223
269
|
</div>
|
|
224
270
|
</div>
|
|
225
271
|
</div>
|
|
@@ -227,26 +273,36 @@ export class UMLogin {
|
|
|
227
273
|
</section>`;
|
|
228
274
|
}
|
|
229
275
|
|
|
230
|
-
return html
|
|
276
|
+
return html` <section class="${gClass('container')}">
|
|
231
277
|
<div class="${gClass('box')}">
|
|
232
278
|
<div class="${gClass('login-title')}">${Language.text('member_login')}</div>
|
|
233
279
|
<div class="w-100 d-flex flex-column gap-3">
|
|
234
280
|
<div>
|
|
235
281
|
<label class="${gClass('label')}">${Language.text('email_phone')}</label>
|
|
236
|
-
<input
|
|
282
|
+
<input
|
|
283
|
+
class="bgw-input"
|
|
284
|
+
type="text"
|
|
285
|
+
id="vm-account"
|
|
286
|
+
placeholder="${Language.text('email_phone_placeholder')}"
|
|
287
|
+
/>
|
|
237
288
|
</div>
|
|
238
289
|
<div>
|
|
239
290
|
<label class="${gClass('label')}">${Language.text('password')}</label>
|
|
240
|
-
<input
|
|
291
|
+
<input
|
|
292
|
+
class="bgw-input"
|
|
293
|
+
type="password"
|
|
294
|
+
id="vm-password"
|
|
295
|
+
placeholder="${Language.text('please_enter_password')}"
|
|
296
|
+
/>
|
|
241
297
|
</div>
|
|
242
298
|
<div class="text-end">
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
299
|
+
<span
|
|
300
|
+
class="${gClass('blue-note')}"
|
|
301
|
+
onclick="${gvc.event(() => {
|
|
302
|
+
vm.viewType = 'send_forget_pwd_email';
|
|
303
|
+
})}"
|
|
304
|
+
>${Language.text('forgot_password')}</span
|
|
305
|
+
>
|
|
250
306
|
</div>
|
|
251
307
|
<div
|
|
252
308
|
class="${gClass('button')} my-2"
|
|
@@ -260,36 +316,35 @@ export class UMLogin {
|
|
|
260
316
|
<div class="d-flex flex-column gap-2 text-center mt-1">
|
|
261
317
|
<div class="${gClass('font-16')}">
|
|
262
318
|
${Language.text('member_not_exists_prompt')}<span
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
319
|
+
class="${gClass('blue-note')}"
|
|
320
|
+
onclick="${gvc.event(() => {
|
|
321
|
+
this.viewCallback(vm, 'register');
|
|
322
|
+
})}"
|
|
323
|
+
>${Language.text('register')}</span
|
|
324
|
+
>
|
|
269
325
|
</div>
|
|
270
326
|
<div class="${gClass('font-14')}">
|
|
271
|
-
${Language.text('login_terms_agreement')}<a class="${gClass('blue-note')}" href="/privacy"
|
|
272
|
-
|
|
273
|
-
href="/term"
|
|
274
|
-
|
|
275
|
-
|
|
327
|
+
${Language.text('login_terms_agreement')}<a class="${gClass('blue-note')}" href="/privacy"
|
|
328
|
+
>${Language.text('terms_of_service')}</a
|
|
329
|
+
>${Language.text('and')}<a class="${gClass('blue-note')}" href="/term"
|
|
330
|
+
>${Language.text('privacy_policy')}</a
|
|
331
|
+
>
|
|
276
332
|
</div>
|
|
277
333
|
</div>
|
|
278
334
|
</div>
|
|
279
335
|
</div>
|
|
280
336
|
</section>`;
|
|
281
|
-
}catch (e) {
|
|
282
|
-
console.log(`error==>`,e)
|
|
283
|
-
return
|
|
337
|
+
} catch (e) {
|
|
338
|
+
console.log(`error==>`, e);
|
|
339
|
+
return ``;
|
|
284
340
|
}
|
|
285
|
-
|
|
286
341
|
},
|
|
287
342
|
divCreate: {},
|
|
288
343
|
onCreate: () => {
|
|
289
344
|
if (loadings.view) {
|
|
290
345
|
Promise.all([
|
|
291
346
|
new Promise((resolve, reject) => {
|
|
292
|
-
ApiUser.getPublicConfig('login_config', 'manager').then(
|
|
347
|
+
ApiUser.getPublicConfig('login_config', 'manager').then(dd => {
|
|
293
348
|
if (dd.result && dd.response.value) {
|
|
294
349
|
resolve(dd.response.value);
|
|
295
350
|
} else {
|
|
@@ -298,7 +353,7 @@ export class UMLogin {
|
|
|
298
353
|
});
|
|
299
354
|
}),
|
|
300
355
|
new Promise((resolve, reject) => {
|
|
301
|
-
ApiUser.getPublicConfig('custom_form_register', 'manager').then(
|
|
356
|
+
ApiUser.getPublicConfig('custom_form_register', 'manager').then(dd => {
|
|
302
357
|
try {
|
|
303
358
|
resolve(dd.response.value.list || []);
|
|
304
359
|
} catch (e) {
|
|
@@ -306,9 +361,9 @@ export class UMLogin {
|
|
|
306
361
|
}
|
|
307
362
|
});
|
|
308
363
|
}),
|
|
309
|
-
]).then(
|
|
364
|
+
]).then(dataArray => {
|
|
310
365
|
vm.loginConfig = dataArray[0];
|
|
311
|
-
vm.registerConfig = FormCheck.initialRegisterForm(
|
|
366
|
+
vm.registerConfig = FormCheck.initialRegisterForm(dataArray[1] as any);
|
|
312
367
|
setTimeout(() => {
|
|
313
368
|
loadings.view = false;
|
|
314
369
|
gvc.notifyDataChange(ids.view);
|
|
@@ -322,96 +377,109 @@ export class UMLogin {
|
|
|
322
377
|
static addStyle(gvc: GVC, prefix: string) {
|
|
323
378
|
const isPhone = document.body.clientWidth < 768;
|
|
324
379
|
gvc.addStyle(css`
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
380
|
+
.${prefix}-container {
|
|
381
|
+
box-sizing: border-box;
|
|
382
|
+
display: flex;
|
|
383
|
+
align-items: center;
|
|
384
|
+
justify-content: center;
|
|
385
|
+
padding-top: ${isPhone ? 0 : '100px'};
|
|
386
|
+
padding-bottom: ${isPhone ? '0px' : '230px'};
|
|
387
|
+
overflow: hidden;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
.${prefix}-box {
|
|
391
|
+
border-radius: ${isPhone ? '0px' : '30px'};
|
|
392
|
+
background: #fff;
|
|
393
|
+
${isPhone ? '' : 'box-shadow: 5px 5px 20px 0px rgba(0, 0, 0, 0.15)'};
|
|
394
|
+
display: flex;
|
|
395
|
+
width: 576px;
|
|
396
|
+
padding: ${isPhone ? '56px 16px' : '56px'};
|
|
397
|
+
flex-direction: column;
|
|
398
|
+
justify-content: center;
|
|
399
|
+
align-items: center;
|
|
400
|
+
gap: 32px;
|
|
401
|
+
overflow: hidden;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
.${prefix}-login-title {
|
|
405
|
+
color: #393939;
|
|
406
|
+
text-align: center;
|
|
407
|
+
font-size: 32px;
|
|
408
|
+
font-style: normal;
|
|
409
|
+
font-weight: 700;
|
|
410
|
+
line-height: 140%;
|
|
411
|
+
margin-bottom: 24px;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
.${prefix}-label {
|
|
415
|
+
color: #393939;
|
|
416
|
+
font-size: 16px;
|
|
417
|
+
font-weight: 500;
|
|
418
|
+
margin-bottom: 6px;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
.${prefix}-button {
|
|
422
|
+
border-radius: 10px;
|
|
423
|
+
background: #393939;
|
|
424
|
+
display: flex;
|
|
425
|
+
justify-content: center;
|
|
426
|
+
align-items: center;
|
|
427
|
+
cursor: pointer;
|
|
428
|
+
padding: 14px 0;
|
|
429
|
+
cursor: pointer;
|
|
430
|
+
height: 48px;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
.${prefix}-button:hover {
|
|
434
|
+
background: #656565;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
.${prefix}-button-text {
|
|
438
|
+
color: #fff;
|
|
439
|
+
text-align: center;
|
|
440
|
+
font-size: 16px;
|
|
441
|
+
font-weight: 700;
|
|
442
|
+
letter-spacing: 0.64px;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
.${prefix}-auth-thrid-button {
|
|
446
|
+
border-radius: 5px;
|
|
447
|
+
background: #f1f1f1;
|
|
448
|
+
height: 50px;
|
|
449
|
+
flex: 1;
|
|
450
|
+
display: flex;
|
|
451
|
+
align-items: center;
|
|
452
|
+
justify-content: center;
|
|
453
|
+
cursor: pointer;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
.${prefix}-auth-thrid-button:hover {
|
|
457
|
+
background: #dbdbdb;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
.${prefix}-blue-note {
|
|
461
|
+
color: #4d86db;
|
|
462
|
+
cursor: pointer;
|
|
463
|
+
margin: 0 4px;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
.${prefix}-blue-note:hover {
|
|
467
|
+
color: #4d86db !important;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
.${prefix}-gray-hr {
|
|
471
|
+
flex: 1 1 auto !important;
|
|
472
|
+
height: 1px;
|
|
473
|
+
background-color: #ddd;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
.${prefix}-font-16 {
|
|
477
|
+
font-size: 16px;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
.${prefix}-font-14 {
|
|
481
|
+
font-size: 14px;
|
|
482
|
+
}
|
|
415
483
|
`);
|
|
416
484
|
}
|
|
417
485
|
|
|
@@ -425,85 +493,88 @@ export class UMLogin {
|
|
|
425
493
|
widget.event('success', { title: text ?? Language.text('login_success') });
|
|
426
494
|
setTimeout(() => {
|
|
427
495
|
ApiUser.getUserData(GlobalUser.token, 'me').then(res => {
|
|
428
|
-
if (
|
|
429
|
-
|
|
496
|
+
if (
|
|
497
|
+
res.response.userData &&
|
|
498
|
+
!res.response.userData.phone &&
|
|
499
|
+
(window as any).login_config.phone_verify &&
|
|
500
|
+
gvc.glitter.getUrlParameter('page') !== 'account_edit'
|
|
501
|
+
) {
|
|
502
|
+
const dialog = new ShareDialog(gvc.glitter);
|
|
430
503
|
dialog.infoMessage({
|
|
431
|
-
text:Language.text('phone_verify_check')
|
|
504
|
+
text: Language.text('phone_verify_check'),
|
|
432
505
|
});
|
|
433
|
-
gvc.glitter.href='/account_edit'
|
|
434
|
-
}else{
|
|
435
|
-
if(
|
|
436
|
-
const red=GlobalUser.loginRedirect
|
|
437
|
-
GlobalUser.loginRedirect='';
|
|
506
|
+
gvc.glitter.href = '/account_edit';
|
|
507
|
+
} else {
|
|
508
|
+
if (GlobalUser.loginRedirect) {
|
|
509
|
+
const red = GlobalUser.loginRedirect;
|
|
510
|
+
GlobalUser.loginRedirect = '';
|
|
438
511
|
gvc.glitter.href = red;
|
|
439
|
-
}else {
|
|
512
|
+
} else {
|
|
440
513
|
//蔡先生的Proshake頁面,沒時間先這樣改
|
|
441
|
-
if((window as any).appName==='proshake_v2'){
|
|
514
|
+
if ((window as any).appName === 'proshake_v2') {
|
|
442
515
|
gvc.glitter.href = '/user_info';
|
|
443
|
-
}else{
|
|
516
|
+
} else {
|
|
444
517
|
gvc.glitter.href = '/account_userinfo';
|
|
445
518
|
}
|
|
446
|
-
|
|
447
519
|
}
|
|
448
520
|
}
|
|
449
521
|
});
|
|
450
|
-
|
|
451
522
|
}, 700);
|
|
452
523
|
}
|
|
453
524
|
|
|
454
525
|
static authThirdPartyHTML(gvc: GVC, widget: any, vm: VM) {
|
|
455
526
|
const loginEvents = this.getAuthLoginEvents(gvc, widget);
|
|
456
527
|
|
|
457
|
-
return html
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
528
|
+
return html` <div class="w-100 d-flex align-items-center gap-2" style="color:#8D8D8D;">
|
|
529
|
+
<div class="${vm.prefix}-gray-hr"></div>
|
|
530
|
+
${Language.text('or')}
|
|
531
|
+
<div class="${vm.prefix}-gray-hr"></div>
|
|
532
|
+
</div>
|
|
533
|
+
<div class="d-flex w-100 align-items-center justify-content-center gap-2">
|
|
534
|
+
${[
|
|
535
|
+
{
|
|
536
|
+
type: 'google',
|
|
537
|
+
icon: 'https://d3jnmi1tfjgtti.cloudfront.net/file/252530754/Google__G__logo.svg.webp',
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
type: 'line',
|
|
541
|
+
icon: 'https://d3jnmi1tfjgtti.cloudfront.net/file/252530754/LINE_Brand_icon.png',
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
type: 'apple',
|
|
545
|
+
icon: 'https://d3jnmi1tfjgtti.cloudfront.net/file/252530754/14776639.png',
|
|
546
|
+
},
|
|
547
|
+
{
|
|
548
|
+
type: 'fb',
|
|
549
|
+
icon: 'https://d3jnmi1tfjgtti.cloudfront.net/file/252530754/5968764.png',
|
|
550
|
+
},
|
|
551
|
+
]
|
|
552
|
+
.map(item => {
|
|
553
|
+
if (!vm.loginConfig[item.type]) {
|
|
554
|
+
return '';
|
|
555
|
+
}
|
|
485
556
|
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
557
|
+
//Android版本不需要有APPLE登入
|
|
558
|
+
if (gvc.glitter.deviceType === gvc.glitter.deviceTypeEnum.Android && item.type === 'apple') {
|
|
559
|
+
return ``;
|
|
560
|
+
}
|
|
561
|
+
const event = loginEvents.find(data => data.key === item.type);
|
|
562
|
+
if (!event) {
|
|
563
|
+
return '';
|
|
564
|
+
}
|
|
565
|
+
event.created();
|
|
566
|
+
|
|
567
|
+
return html` <div
|
|
568
|
+
class="${vm.prefix}-auth-thrid-button"
|
|
569
|
+
onclick="${gvc.event(() => {
|
|
570
|
+
event.call();
|
|
571
|
+
})}"
|
|
572
|
+
>
|
|
573
|
+
<img style="width: 28px" src="${item.icon}" />
|
|
574
|
+
</div>`;
|
|
575
|
+
})
|
|
576
|
+
.join('')}
|
|
577
|
+
</div>`;
|
|
507
578
|
}
|
|
508
579
|
|
|
509
580
|
static checkValue(name: string): string | false {
|
|
@@ -519,7 +590,7 @@ export class UMLogin {
|
|
|
519
590
|
}
|
|
520
591
|
|
|
521
592
|
static backToLogin(gvc: GVC, vm: VM): string {
|
|
522
|
-
return html
|
|
593
|
+
return html` <section
|
|
523
594
|
class="m-auto d-flex align-items-center justify-content-center my-2"
|
|
524
595
|
style="cursor: pointer;"
|
|
525
596
|
onclick="${gvc.event(() => {
|
|
@@ -549,7 +620,9 @@ export class UMLogin {
|
|
|
549
620
|
}, 100);
|
|
550
621
|
}
|
|
551
622
|
})}"
|
|
552
|
-
|
|
623
|
+
>${n > 0
|
|
624
|
+
? Language.text('resend_code_timer').replace('xxx', n)
|
|
625
|
+
: Language.text('get_verification_code')}</span
|
|
553
626
|
>`;
|
|
554
627
|
},
|
|
555
628
|
divCreate: {
|
|
@@ -569,53 +642,15 @@ export class UMLogin {
|
|
|
569
642
|
static getAuthLoginEvents(gvc: GVC, widget: any): { key: string; created: () => void; call: () => void }[] {
|
|
570
643
|
const glitter = gvc.glitter;
|
|
571
644
|
return [
|
|
572
|
-
{
|
|
573
|
-
|
|
574
|
-
created: () => {
|
|
575
|
-
if (gvc.glitter.getUrlParameter('state') === 'line_login') {
|
|
576
|
-
gvc.glitter.setUrlParameter('state', '');
|
|
577
|
-
ApiUser.login({
|
|
578
|
-
login_type: 'line',
|
|
579
|
-
line_token: gvc.glitter.getUrlParameter('code'),
|
|
580
|
-
redirect: (() => {
|
|
581
|
-
if (glitter.deviceType !== glitter.deviceTypeEnum.Web) {
|
|
582
|
-
return 'app';
|
|
583
|
-
} else {
|
|
584
|
-
const url = new URL(location.origin + location.pathname);
|
|
585
|
-
if (gvc.glitter.getUrlParameter('appName')) {
|
|
586
|
-
url.searchParams.set('appName', (window as any).appName);
|
|
587
|
-
}
|
|
588
|
-
return encodeURI(url.href);
|
|
589
|
-
}
|
|
590
|
-
})(),
|
|
591
|
-
}).then((r) => {
|
|
592
|
-
gvc.glitter.setUrlParameter('code', '');
|
|
593
|
-
if (r.result) {
|
|
594
|
-
this.successCallback(gvc, widget, r.response);
|
|
595
|
-
} else {
|
|
596
|
-
widget.event('error', { title: `Line: ${Language.text('login_failure')}` });
|
|
597
|
-
}
|
|
598
|
-
});
|
|
599
|
-
} else {
|
|
600
|
-
ApiUser.getPublicConfig('login_line_setting', 'manager').then((dd) => {
|
|
601
|
-
widget.share.line = dd.response.value || {};
|
|
602
|
-
if (gvc.glitter.getUrlParameter('line_liff') === 'true') {
|
|
603
|
-
widget.event('loading', { visible: true });
|
|
604
|
-
setTimeout(() => {
|
|
605
|
-
localStorage.setItem('login_page', 'account');
|
|
606
|
-
}, 100);
|
|
607
|
-
}
|
|
608
|
-
});
|
|
609
|
-
}
|
|
610
|
-
},
|
|
611
|
-
call: () => {
|
|
645
|
+
(() => {
|
|
646
|
+
function callLogin() {
|
|
612
647
|
if (glitter.deviceType !== glitter.deviceTypeEnum.Web) {
|
|
613
648
|
gvc.glitter.runJsInterFace(
|
|
614
649
|
'line_login',
|
|
615
650
|
{
|
|
616
651
|
id: widget.share.line.id,
|
|
617
652
|
},
|
|
618
|
-
|
|
653
|
+
response => {
|
|
619
654
|
if (response.result) {
|
|
620
655
|
gvc.glitter.setUrlParameter('state', 'line_login');
|
|
621
656
|
gvc.glitter.setUrlParameter('code', response.code);
|
|
@@ -629,8 +664,49 @@ export class UMLogin {
|
|
|
629
664
|
redirect_url
|
|
630
665
|
)}&state=line_login&scope=profile%20openid%20email&nonce=09876xyz`;
|
|
631
666
|
}
|
|
632
|
-
}
|
|
633
|
-
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
return {
|
|
670
|
+
key: 'line',
|
|
671
|
+
created: () => {
|
|
672
|
+
if (gvc.glitter.getUrlParameter('state') === 'line_login') {
|
|
673
|
+
gvc.glitter.setUrlParameter('state', '');
|
|
674
|
+
ApiUser.login({
|
|
675
|
+
login_type: 'line',
|
|
676
|
+
line_token: gvc.glitter.getUrlParameter('code'),
|
|
677
|
+
redirect: (() => {
|
|
678
|
+
if (glitter.deviceType !== glitter.deviceTypeEnum.Web) {
|
|
679
|
+
return 'app';
|
|
680
|
+
} else {
|
|
681
|
+
const url = new URL(location.origin + location.pathname);
|
|
682
|
+
if (gvc.glitter.getUrlParameter('appName')) {
|
|
683
|
+
url.searchParams.set('appName', (window as any).appName);
|
|
684
|
+
}
|
|
685
|
+
return encodeURI(url.href);
|
|
686
|
+
}
|
|
687
|
+
})(),
|
|
688
|
+
}).then(r => {
|
|
689
|
+
gvc.glitter.setUrlParameter('code', '');
|
|
690
|
+
if (r.result) {
|
|
691
|
+
this.successCallback(gvc, widget, r.response);
|
|
692
|
+
} else {
|
|
693
|
+
widget.event('error', { title: `Line: ${Language.text('login_failure')}` });
|
|
694
|
+
}
|
|
695
|
+
});
|
|
696
|
+
} else {
|
|
697
|
+
ApiUser.getPublicConfig('login_line_setting', 'manager').then((dd) => {
|
|
698
|
+
widget.share.line = dd.response.value || {};
|
|
699
|
+
if (gvc.glitter.getUrlParameter('line_liff') === 'true') {
|
|
700
|
+
callLogin();
|
|
701
|
+
}
|
|
702
|
+
})
|
|
703
|
+
}
|
|
704
|
+
},
|
|
705
|
+
call: () => {
|
|
706
|
+
callLogin();
|
|
707
|
+
},
|
|
708
|
+
};
|
|
709
|
+
})(),
|
|
634
710
|
{
|
|
635
711
|
key: 'google',
|
|
636
712
|
created: () => {
|
|
@@ -641,13 +717,13 @@ export class UMLogin {
|
|
|
641
717
|
google_token: gvc.glitter.getUrlParameter('code'),
|
|
642
718
|
redirect: (() => {
|
|
643
719
|
if (glitter.deviceType !== glitter.deviceTypeEnum.Web) {
|
|
644
|
-
return
|
|
720
|
+
return glitter.deviceType === glitter.deviceTypeEnum.Android ? 'android' : 'app';
|
|
645
721
|
} else {
|
|
646
722
|
const googleRedirect = localStorage.getItem('google_redirect');
|
|
647
723
|
return googleRedirect ? encodeURI(googleRedirect) : '';
|
|
648
724
|
}
|
|
649
725
|
})(),
|
|
650
|
-
}).then(
|
|
726
|
+
}).then(r => {
|
|
651
727
|
if (r.result) {
|
|
652
728
|
this.successCallback(gvc, widget, r.response);
|
|
653
729
|
} else {
|
|
@@ -655,7 +731,7 @@ export class UMLogin {
|
|
|
655
731
|
}
|
|
656
732
|
});
|
|
657
733
|
} else {
|
|
658
|
-
ApiUser.getPublicConfig('login_google_setting', 'manager').then(
|
|
734
|
+
ApiUser.getPublicConfig('login_google_setting', 'manager').then(dd => {
|
|
659
735
|
widget.share.google = dd.response.value || {};
|
|
660
736
|
});
|
|
661
737
|
}
|
|
@@ -667,14 +743,17 @@ export class UMLogin {
|
|
|
667
743
|
localStorage.setItem('google_redirect', redirect_url);
|
|
668
744
|
|
|
669
745
|
if (glitter.deviceType !== glitter.deviceTypeEnum.Web) {
|
|
670
|
-
ApiUser.getPublicConfig('login_google_setting', 'manager').then(
|
|
746
|
+
ApiUser.getPublicConfig('login_google_setting', 'manager').then(dd => {
|
|
671
747
|
widget.share.google = dd.response.value || {};
|
|
672
748
|
gvc.glitter.runJsInterFace(
|
|
673
749
|
'google_login',
|
|
674
750
|
{
|
|
675
|
-
app_id:
|
|
751
|
+
app_id:
|
|
752
|
+
glitter.deviceType === glitter.deviceTypeEnum.Android
|
|
753
|
+
? widget.share.google.android_app_id
|
|
754
|
+
: widget.share.google.app_id,
|
|
676
755
|
},
|
|
677
|
-
|
|
756
|
+
response => {
|
|
678
757
|
if (response.result) {
|
|
679
758
|
gvc.glitter.setUrlParameter('state', 'google_login');
|
|
680
759
|
gvc.glitter.setUrlParameter('code', response.code);
|
|
@@ -683,7 +762,6 @@ export class UMLogin {
|
|
|
683
762
|
}
|
|
684
763
|
);
|
|
685
764
|
});
|
|
686
|
-
|
|
687
765
|
} else {
|
|
688
766
|
gvc.glitter.href = `https://accounts.google.com/o/oauth2/v2/auth?client_id=${widget.share.google.id}&redirect_uri=${redirect_url}&state=google_login&response_type=code&scope=profile+email`;
|
|
689
767
|
}
|
|
@@ -692,7 +770,7 @@ export class UMLogin {
|
|
|
692
770
|
{
|
|
693
771
|
key: 'fb',
|
|
694
772
|
created: () => {
|
|
695
|
-
ApiUser.getPublicConfig('login_fb_setting', 'manager').then(
|
|
773
|
+
ApiUser.getPublicConfig('login_fb_setting', 'manager').then(dd => {
|
|
696
774
|
widget.share.fb = dd.response.value || {};
|
|
697
775
|
const loadFacebookSDK = () => {
|
|
698
776
|
const intervalId = setInterval(() => {
|
|
@@ -702,8 +780,8 @@ export class UMLogin {
|
|
|
702
780
|
clearInterval(intervalId); // 清除間隔
|
|
703
781
|
FB.init({
|
|
704
782
|
appId: widget.share.fb.id,
|
|
705
|
-
xfbml
|
|
706
|
-
version
|
|
783
|
+
xfbml: true,
|
|
784
|
+
version: 'v22.0',
|
|
707
785
|
});
|
|
708
786
|
return;
|
|
709
787
|
}
|
|
@@ -725,26 +803,30 @@ export class UMLogin {
|
|
|
725
803
|
},
|
|
726
804
|
call: () => {
|
|
727
805
|
return new Promise(async (resolve, reject) => {
|
|
728
|
-
console.log('call fb',widget.share.fb)
|
|
806
|
+
console.log('call fb', widget.share.fb);
|
|
729
807
|
|
|
730
808
|
if (glitter.deviceType !== glitter.deviceTypeEnum.Web) {
|
|
731
|
-
gvc.glitter.runJsInterFace(
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
}
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
809
|
+
gvc.glitter.runJsInterFace(
|
|
810
|
+
'facebook_login',
|
|
811
|
+
{
|
|
812
|
+
app_id: widget.share.fb.id,
|
|
813
|
+
secret: widget.share.fb.secret,
|
|
814
|
+
},
|
|
815
|
+
response => {
|
|
816
|
+
if (response.result) {
|
|
817
|
+
ApiUser.login({
|
|
818
|
+
login_type: 'fb',
|
|
819
|
+
fb_token: response.accessToken,
|
|
820
|
+
}).then(r => {
|
|
821
|
+
if (r.result) {
|
|
822
|
+
this.successCallback(gvc, widget, r.response);
|
|
823
|
+
} else {
|
|
824
|
+
widget.event('error', { title: `Facebook: ${Language.text('login_failure')}` });
|
|
825
|
+
}
|
|
826
|
+
});
|
|
827
|
+
}
|
|
746
828
|
}
|
|
747
|
-
|
|
829
|
+
);
|
|
748
830
|
} else {
|
|
749
831
|
(window as any).FB.login(
|
|
750
832
|
(response: any) => {
|
|
@@ -752,7 +834,7 @@ export class UMLogin {
|
|
|
752
834
|
ApiUser.login({
|
|
753
835
|
login_type: 'fb',
|
|
754
836
|
fb_token: accessToken,
|
|
755
|
-
}).then(
|
|
837
|
+
}).then(r => {
|
|
756
838
|
if (r.result) {
|
|
757
839
|
this.successCallback(gvc, widget, r.response);
|
|
758
840
|
} else {
|
|
@@ -774,7 +856,7 @@ export class UMLogin {
|
|
|
774
856
|
ApiUser.login({
|
|
775
857
|
login_type: 'apple',
|
|
776
858
|
token: appleCode,
|
|
777
|
-
}).then(
|
|
859
|
+
}).then(r => {
|
|
778
860
|
if (r.result) {
|
|
779
861
|
this.successCallback(gvc, widget, r.response);
|
|
780
862
|
} else {
|
|
@@ -789,7 +871,7 @@ export class UMLogin {
|
|
|
789
871
|
},
|
|
790
872
|
],
|
|
791
873
|
() => {
|
|
792
|
-
ApiUser.getPublicConfig('login_apple_setting', 'manager').then(
|
|
874
|
+
ApiUser.getPublicConfig('login_apple_setting', 'manager').then(dd => {
|
|
793
875
|
widget.share.apple = dd.response.value || {};
|
|
794
876
|
});
|
|
795
877
|
},
|
|
@@ -835,7 +917,10 @@ export class UMLogin {
|
|
|
835
917
|
continue;
|
|
836
918
|
}
|
|
837
919
|
|
|
838
|
-
if (
|
|
920
|
+
if (
|
|
921
|
+
(item.key === 'email' && vm.loginConfig.email_verify) ||
|
|
922
|
+
(item.key === 'phone' && vm.loginConfig.phone_verify)
|
|
923
|
+
) {
|
|
839
924
|
const vData = this.checkValue(`reg-${item.key}-verify`);
|
|
840
925
|
if (item.key === 'email') {
|
|
841
926
|
if (!vData) {
|
|
@@ -874,7 +959,7 @@ export class UMLogin {
|
|
|
874
959
|
account: userData.email || userData.phone,
|
|
875
960
|
pwd: password,
|
|
876
961
|
userData: userData,
|
|
877
|
-
}).then(
|
|
962
|
+
}).then(r => {
|
|
878
963
|
widget.event('loading', { visible: false });
|
|
879
964
|
if (r.result) {
|
|
880
965
|
this.successCallback(gvc, widget, r.response, Language.text('registration_success'));
|
|
@@ -915,7 +1000,7 @@ export class UMLogin {
|
|
|
915
1000
|
ApiUser.login({
|
|
916
1001
|
account: account,
|
|
917
1002
|
pwd: password,
|
|
918
|
-
}).then(
|
|
1003
|
+
}).then(r => {
|
|
919
1004
|
if (r.result) {
|
|
920
1005
|
this.successCallback(gvc, widget, r.response);
|
|
921
1006
|
} else {
|
|
@@ -941,7 +1026,7 @@ export class UMLogin {
|
|
|
941
1026
|
}
|
|
942
1027
|
|
|
943
1028
|
widget.event('loading', { visible: true });
|
|
944
|
-
ApiUser.forgetPwd(vm.resetEmail).then(
|
|
1029
|
+
ApiUser.forgetPwd(vm.resetEmail).then(r => {
|
|
945
1030
|
widget.event('loading', { visible: false });
|
|
946
1031
|
if (r.result && r.response.result) {
|
|
947
1032
|
widget.event('success', { title: Language.text('verification_code_sent') });
|
|
@@ -968,7 +1053,7 @@ export class UMLogin {
|
|
|
968
1053
|
return;
|
|
969
1054
|
}
|
|
970
1055
|
|
|
971
|
-
ApiUser.emailVerify(email).then(
|
|
1056
|
+
ApiUser.emailVerify(email).then(r => {
|
|
972
1057
|
if (r.result && r.response.result) {
|
|
973
1058
|
widget.event('success', { title: Language.text('verification_code_sent') });
|
|
974
1059
|
} else {
|
|
@@ -977,7 +1062,7 @@ export class UMLogin {
|
|
|
977
1062
|
});
|
|
978
1063
|
}
|
|
979
1064
|
|
|
980
|
-
static async
|
|
1065
|
+
static async sendVerifyPhoneCode(widget: any, id: string) {
|
|
981
1066
|
const phone = UMLogin.checkValue(id);
|
|
982
1067
|
|
|
983
1068
|
if (!phone) {
|
|
@@ -992,7 +1077,7 @@ export class UMLogin {
|
|
|
992
1077
|
if ((await ApiUser.getPhoneCount(phone)).response.result) {
|
|
993
1078
|
widget.event('error', { title: Language.text('phone_number_already_exists') });
|
|
994
1079
|
} else {
|
|
995
|
-
ApiUser.phoneVerify(phone).then(
|
|
1080
|
+
ApiUser.phoneVerify(phone).then(r => {
|
|
996
1081
|
if (r.result && r.response.result) {
|
|
997
1082
|
widget.event('success', { title: Language.text('verification_code_sent') });
|
|
998
1083
|
} else {
|
|
@@ -1000,7 +1085,6 @@ export class UMLogin {
|
|
|
1000
1085
|
}
|
|
1001
1086
|
});
|
|
1002
1087
|
}
|
|
1003
|
-
|
|
1004
1088
|
}
|
|
1005
1089
|
|
|
1006
1090
|
static verifySubmitCode(widget: any, vm: VM) {
|
|
@@ -1011,7 +1095,7 @@ export class UMLogin {
|
|
|
1011
1095
|
return;
|
|
1012
1096
|
}
|
|
1013
1097
|
|
|
1014
|
-
ApiUser.forgetPwdCheckCode(vm.resetEmail, code).then(
|
|
1098
|
+
ApiUser.forgetPwdCheckCode(vm.resetEmail, code).then(r => {
|
|
1015
1099
|
if (r.result && r.response.result) {
|
|
1016
1100
|
vm.validationCode = code;
|
|
1017
1101
|
vm.viewType = 'reset_password';
|
|
@@ -1038,7 +1122,7 @@ export class UMLogin {
|
|
|
1038
1122
|
return;
|
|
1039
1123
|
}
|
|
1040
1124
|
|
|
1041
|
-
ApiUser.resetPwdV2(vm.resetEmail, vm.validationCode, newPassword).then(
|
|
1125
|
+
ApiUser.resetPwdV2(vm.resetEmail, vm.validationCode, newPassword).then(r => {
|
|
1042
1126
|
vm.resetEmail = '';
|
|
1043
1127
|
if (r.result && r.response.result) {
|
|
1044
1128
|
widget.event('success', { title: Language.text('password_change_success') });
|