Merge branch 'develop' of https://gitlab.eascs.com/tms-ui/tms-obc-web into develop

This commit is contained in:
wangshiming
2021-12-27 10:30:56 +08:00
6 changed files with 42 additions and 27 deletions

View File

@ -105,7 +105,7 @@ export class AccountComponentsEditNameComponent implements OnInit, AfterViewInit
const params = {
// phoneNumber: phone
};
this.service.request(this.service.$api_get_current_user_info, params, 'POST', true, 'FORM').subscribe((res) => {
this.service.request(this.service.$api_get_current_user_smVerification, params, 'POST', true, 'FORM').subscribe((res) => {
console.log(res);
// code==503046 弹出网易盾
if (res && res.code === '1') {

View File

@ -7,17 +7,18 @@
* @FilePath: \tms-obc-web\src\app\routes\account\components\edit\edit.component.ts
*/
import { Component, OnInit, ViewChild } from '@angular/core';
import { FormBuilder, FormGroup, Validators,ValidatorFn } from '@angular/forms';
import { FormBuilder, FormGroup, Validators, ValidatorFn } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { STChange, STColumn, STComponent, STData, STRequestOptions } from '@delon/abc/st';
import { SFComponent, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form';
import { NzDrawerRef, NzDrawerService } from 'ng-zorro-antd/drawer';
import { NzFormTooltipIcon } from 'ng-zorro-antd/form';
import { NzModalRef } from 'ng-zorro-antd/modal';
import { AccountService } from '../../services/account.service';
@Component({
selector: 'app-account-components-edit',
templateUrl: './edit-password.component.html',
templateUrl: './edit-password.component.html'
})
export class AccountComponentsCenterEditComponent implements OnInit {
url = `/rule?_allow_anonymous=true`;
@ -25,8 +26,8 @@ export class AccountComponentsCenterEditComponent implements OnInit {
record: any;
count = 0;
type = 'create';
passwordVisible = false;
passwordVisible2 = false;
passwordVisible = false;
passwordVisible2 = false;
password?: string;
password2?: string;
interval$: any;
@ -40,8 +41,8 @@ export class AccountComponentsCenterEditComponent implements OnInit {
public ar: ActivatedRoute,
private modalRef: NzModalRef,
private fb: FormBuilder,
) {
}
public service: AccountService
) {}
ngOnInit() {
this.validateForm = this.fb.group({
@ -51,11 +52,11 @@ export class AccountComponentsCenterEditComponent implements OnInit {
Validators.required,
Validators.maxLength(16),
Validators.minLength(8),
Validators.pattern('^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z-_]{8,16}$'),
],
Validators.pattern('^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z-_]{8,16}$')
]
],
passWordTo: [null, [this.confirmPasswordValidator, Validators.required, Validators.maxLength(16), Validators.minLength(8)]],
voucher: [null, [Validators.required]],
voucher: [null, [Validators.required]]
});
}
@ -63,19 +64,30 @@ export class AccountComponentsCenterEditComponent implements OnInit {
this.modalRef.destroy();
}
getCaptcha(e: MouseEvent): void {
e.preventDefault();
this.codeCountDown()
this.service.request(this.service.$api_get_current_user_smVerification).subscribe(res => {
console.log(res);
// code==503046 弹出网易盾
if (res && res.code === '1') {
this.service.msgSrv.success('发送成功');
e.preventDefault();
this.codeCountDown();
} else if (res.code === '503046') {
// this.dun.popUp();
} else {
this.service.msgSrv.success(res.msg);
}
});
}
save() {
// const params = { id: this.record.id, name: this.validateForm.value.name };
// this.service.request(this.service.$api_feedbackTypeupdate, params).subscribe((res) => {
// if (res) {
// this.modalRef.close(true);
// this.service.msgSrv.success('保存成功!');
// } else {
// this.service.msgSrv.error(res.msg);
// }
// });
// const params = { id: this.record.id, name: this.validateForm.value.name };
// this.service.request(this.service.$api_feedbackTypeupdate, params).subscribe((res) => {
// if (res) {
// this.modalRef.close(true);
// this.service.msgSrv.success('保存成功!');
// } else {
// this.service.msgSrv.error(res.msg);
// }
// });
}
/* code倒计时 */
codeCountDown() {

View File

@ -20,6 +20,9 @@ export class AccountService extends BaseService {
// 获取当前登录用户详情
$api_get_current_user_info = `/api/mdc/cuc/user/getUserInfo`;
// 根据当前登录用户绑定的手机号码获取短信验证码
$api_get_current_user_smVerification = `/api/mdc/pbc/smsSend/getSmVerificationCodeByToken`;
constructor(public injector: Injector) {
super(injector);
}

View File

@ -108,7 +108,7 @@ export class UserRetrievePasswordComponent implements OnInit, AfterViewInit {
submitForm2() {
for (const i in this.formGroup2.controls) {
if ( this.formGroup2.controls[i]) {
if (this.formGroup2.controls[i]) {
this.formGroup2.controls[i].markAsDirty();
this.formGroup2.controls[i].updateValueAndValidity();
}
@ -145,8 +145,8 @@ export class UserRetrievePasswordComponent implements OnInit, AfterViewInit {
return;
}
if (this.formGroup1.value.phone) {
this.service.http
.post(`${this.service.$getAccountSMVerificationCode}`, null, { phoneNumber: this.formGroup1.value.phone })
this.service
.request(`${this.service.$api_send_sms_by_mobile}`, { phoneNumber: this.formGroup1.value.phone })
.subscribe((res: any) => {
// console.log(res, 'res');
if (res.success) {

View File

@ -14,7 +14,7 @@ import { BaseService } from '../core/base.service';
})
export class EACaptchaService extends BaseService {
// 通过手机号发送短信验证码
private $api_send_sms_by_mobile = `/scm/sms/sms/verification/getSMVerificationCode?_allow_anonymous=true&_allow_badcode=true`;
private $api_send_sms_by_mobile = `/api/mdc/pbc/smsSend/getSMVerificationCode?_allow_anonymous=true&_allow_badcode=true`;
// 验证手机号为平台用户后发送短信验证码
private $api_send_sms__by_validate_mobile = `/chiauserBasicInfo/forgetPassword/getAccountSMVerificationCode`;

View File

@ -38,8 +38,8 @@ export class EAUserService extends BaseService {
public $api_get_agreement_info = `/scce/pbc/pbc/agreementInfo/getAgreementInfoByType?_allow_anonymous=true`;
// 未登录验证身份
public $forgetPasswordVerifyIdentity = `/scm/cuc/cuc/userBasicInfo/forgetPassword/verifyIdentity?_allow_anonymous=true`;
// 未登录账号发送验证码
public $getAccountSMVerificationCode = `/scm/cuc/cuc/userBasicInfo/forgetPassword/getAccountSMVerificationCode?_allow_anonymous=true`;
// 通过手机号发送短信验证码
public $api_send_sms_by_mobile = `/api/mdc/pbc/smsSend/getSMVerificationCode?_allow_anonymous=true&_allow_badcode=true`;
// 未设置密码的用户设置用户密码
public $api_set_password = `/scce/cuc/cuc/userBasicInfo/setPassword`;
// 凭证修改密码