Merge branch '2.0-dev' of http://gitea.dctpay.com/hurui/high-web into 2.0-dev

2.0-dev
胡锐 2 years ago
commit 52add41874
  1. 2
      src/app/admin/api-merchants/list/list.component.html
  2. 2
      src/app/admin/config-manage/config-manage.module.ts
  3. 15
      src/app/admin/index/index/index.component.ts
  4. 2
      src/app/admin/login/login.module.ts
  5. 42
      src/app/admin/login/login/login.component.html
  6. 17
      src/app/admin/login/login/login.component.less
  7. 24
      src/app/admin/login/login/login.component.ts
  8. 3
      src/app/admin/order-manage/mobile-recharge-order-list/mobile-recharge-order-list.component.html
  9. 5
      src/app/common/verification-code/verification-code.component.html
  10. 0
      src/app/common/verification-code/verification-code.component.scss
  11. 120
      src/app/common/verification-code/verification-code.component.ts
  12. 14
      src/app/common/verification-code/verification-code.module.ts
  13. 4
      src/app/services/commons.service.ts
  14. 2
      src/environments/environment.ts

@ -258,8 +258,6 @@
</form> </form>
</nz-modal> </nz-modal>
<nz-modal [(nzVisible)]="visibleConfigProduct" nzTitle="商户产品" (nzOnCancel)="visibleConfigProduct = false" nzWidth="900px" [nzFooter]="null"> <nz-modal [(nzVisible)]="visibleConfigProduct" nzTitle="商户产品" (nzOnCancel)="visibleConfigProduct = false" nzWidth="900px" [nzFooter]="null">
<nz-table #productConfigTable [nzLoading]="loading" nzBordered [nzData]="productConfigArray"> <nz-table #productConfigTable [nzLoading]="loading" nzBordered [nzData]="productConfigArray">
<thead> <thead>

@ -10,7 +10,7 @@ import {RegionSelectorModule} from '../../common/region-selector/region-selector
import {NgZorroAntdModule} from 'ng-zorro-antd'; import {NgZorroAntdModule} from 'ng-zorro-antd';
import {FormsModule, ReactiveFormsModule} from '@angular/forms'; import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import { ThirdProductComponent } from './third-product/third-product.component'; import { ThirdProductComponent } from './third-product/third-product.component';
import {AppCommonModule} from "../../app-common.module"; import {AppCommonModule} from '../../app-common.module';
import { MemberProductComponent } from './member-product/member-product.component'; import { MemberProductComponent } from './member-product/member-product.component';
import { IntegralRebateComponent } from './integral-rebate/integral-rebate.component'; import { IntegralRebateComponent } from './integral-rebate/integral-rebate.component';

@ -62,15 +62,9 @@ export class IndexComponent implements OnInit {
ngOnInit(): void { ngOnInit(): void {
this.http.jsonp('/areas_v3/bound/510000_full.json' , 'features').subscribe(data => {
console.log(data);
});
this.adminInfoObject = this.store.get(ADMIN_INFO_OBJECT); this.adminInfoObject = this.store.get(ADMIN_INFO_OBJECT);
this.roleType = this.store.get(ADMIN_INFO_OBJECT)['secRole'].roleType; this.roleType = this.store.get(ADMIN_INFO_OBJECT)['secRole'].roleType;
console.log(this.roleType);
if (this.roleType === 1) { if (this.roleType === 1) {
this.getIndexCount(); this.getIndexCount();
this.getLineCount(); this.getLineCount();
@ -362,6 +356,12 @@ export class IndexComponent implements OnInit {
yAxis: { yAxis: {
type: 'value' type: 'value'
}, },
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
series: [ series: [
{ {
data: sumData, data: sumData,
@ -410,6 +410,7 @@ export class IndexComponent implements OnInit {
data: productData data: productData
}, },
series: [ series: [
{ {
data: sumData, data: sumData,

@ -5,6 +5,7 @@ import { LoginRoutingModule } from './login-routing.module';
import { LoginComponent } from './login/login.component'; import { LoginComponent } from './login/login.component';
import {NgZorroAntdModule} from 'ng-zorro-antd'; import {NgZorroAntdModule} from 'ng-zorro-antd';
import {FormsModule, ReactiveFormsModule} from '@angular/forms'; import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import { VerificationCodeModule } from 'src/app/common/verification-code/verification-code.module';
@NgModule({ @NgModule({
@ -13,6 +14,7 @@ import {FormsModule, ReactiveFormsModule} from '@angular/forms';
CommonModule, CommonModule,
LoginRoutingModule, LoginRoutingModule,
NgZorroAntdModule, NgZorroAntdModule,
VerificationCodeModule,
ReactiveFormsModule, ReactiveFormsModule,
FormsModule, FormsModule,
] ]

@ -7,9 +7,9 @@
</div> </div>
<div class="body-content-login"> <div class="body-content-login">
<div class="body-content-right-title">嗨森逛后台登录</div> <div class="body-content-right-title">嗨森逛后台登录</div>
<form nz-form class="login-form" [formGroup]="loginForm" (ngSubmit)="submitLogin()"> <form nz-form [nzLayout]="'vertical'" class="login-form" [formGroup]="loginForm" (ngSubmit)="submitLogin()">
<div class="form-item"> <!-- <div class="form-item">
<div class="form-item-label"><h3>用户名</h3></div> <div class="form-item-label"><h3>用户名</h3></div>
<div class="form-item-control"> <div class="form-item-control">
<input type="text" formControlName="loginName" placeholder="请输入您的用户名"> <input type="text" formControlName="loginName" placeholder="请输入您的用户名">
@ -22,6 +22,44 @@
<input type="password" formControlName="password" placeholder="请输入您的密码"> <input type="password" formControlName="password" placeholder="请输入您的密码">
</div> </div>
</div> </div>
<div class="form-item">
<div class="form-item-label"><h3>&nbsp;&nbsp;</h3></div>
<div class="form-item-control" nz-row [nzGutter]="16">
<input nz-col nzSpan="14" type="text" formControlName="vertifyCode" placeholder="请输入验证码">
<app-verification-code nz-col nzSpan="10" (validate)="validateFun($event)" ></app-verification-code>
</div>
</div> -->
<nz-form-item>
<nz-form-label nzRequired nzFor="loginName" class="form-item-label"><h3>用户名</h3></nz-form-label>
<nz-form-control nzErrorTip="请输入您的用户名!" class="form-item-control">
<input nz-input type="text" id="loginName" formControlName="loginName" placeholder="请输入您的用户名" />
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label nzFor="password" nzRequired class="form-item-label"><h3>&nbsp;&nbsp;&nbsp;</h3></nz-form-label>
<nz-form-control nzErrorTip="请输入您的密码!" class="form-item-control">
<input nz-input type="password" id="password" formControlName="password" placeholder="请输入您的密码" />
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label nzFor="verifyCode" nzRequired class="form-item-label"><h3>验证码</h3></nz-form-label>
<nz-form-control nzErrorTip="请输入验证码!" class="form-item-control">
<div nz-row >
<input nz-col nzSpan="12" nz-input type="text" id="verifyCode" formControlName="verifyCode" placeholder="请输入验证码" />
<app-verification-code nz-col nzSpan="12" (validate)="validateFun($event)" ></app-verification-code>
</div>
</nz-form-control>
</nz-form-item>
<!--<div class="forget-pwd"> <!--<div class="forget-pwd">
<a routerLink="/retrieveAdminPwd">忘记密码</a> <a routerLink="/retrieveAdminPwd">忘记密码</a>

@ -4,7 +4,7 @@
} }
.header-block { .header-block {
width: 1230px; // width: 1230px;
margin: 0 auto; margin: 0 auto;
overflow: hidden; overflow: hidden;
background: #ffffff; background: #ffffff;
@ -55,7 +55,9 @@
.body-content-login { .body-content-login {
margin: -300px auto; margin: -300px auto;
width: 350px; width: 350px;
height: 400px; // height: 400px;
padding:10px 0 20px;
border-radius: 16px; border-radius: 16px;
box-shadow: 0px 0px 16px 0px rgba(0, 0, 0, 0.17); box-shadow: 0px 0px 16px 0px rgba(0, 0, 0, 0.17);
background: #ffffff; background: #ffffff;
@ -122,6 +124,7 @@
} }
.from-btn button { .from-btn button {
cursor: pointer;
margin-top: 20px; margin-top: 20px;
width: 250px; width: 250px;
height: 37px; height: 37px;
@ -211,7 +214,17 @@
float: left; float: left;
} }
::ng-deep .ant-form-item-label > label.ant-form-item-required::before{
display: none;
}
::ng-deep .ant-form-vertical .ant-form-item-label{
padding:0;
}
::ng-deep .ant-form-vertical .ant-form-item{
margin-bottom: 15px;
}
/*常规验证码*/ /*常规验证码*/
::ng-deep .verify-code { ::ng-deep .verify-code {

@ -16,20 +16,20 @@ import {HttpClient} from '@angular/common/http';
export class LoginComponent implements OnInit { export class LoginComponent implements OnInit {
loginForm: FormGroup; // 登录表单 loginForm: FormGroup; // 登录表单
code: string;
constructor(private store: LocalStorageService, // 数据请求 constructor(private store: LocalStorageService, // 数据请求
private router: Router, // 路由 private router: Router, // 路由
private form: FormBuilder, // 表单校验 private form: FormBuilder, // 表单校验
private http: HttpClient, // http请求 private http: HttpClient, // http请求
private loginService: LoginService, private loginService: LoginService,
private message: NzMessageService, private message: NzMessageService) {
private modal: NzModalService) {
} }
ngOnInit() { ngOnInit() {
this.loginForm = this.form.group({ this.loginForm = this.form.group({
loginName: [null, [Validators.required]], loginName: [null, [Validators.required]],
password: [null, [Validators.required]], password: [null, [Validators.required]],
verifyCode: [null, [Validators.required]]
}); });
} }
@ -37,21 +37,24 @@ export class LoginComponent implements OnInit {
* *
*/ */
submitLogin() { submitLogin() {
// tslint:disable-next-line:forin // tslint:disable-next-line:forin
for (const i in this.loginForm.controls) { for (const i in this.loginForm.controls) {
this.loginForm.controls[i].markAsDirty(); this.loginForm.controls[i].markAsDirty();
this.loginForm.controls[i].updateValueAndValidity(); this.loginForm.controls[i].updateValueAndValidity();
} }
if (this.loginForm.status == null || this.loginForm.status !== 'VALID') { if (this.loginForm.status == null || this.loginForm.status !== 'VALID') {
this.modal.warning({
nzTitle: '提示',
nzContent: '请填写用户和密码',
});
return; return;
} }
if (this.loginForm.value.verifyCode.toLowerCase() !== this.code ) {
this.message.error('请填写正确的验证码');
return;
}
this.loginService.userLogin(this.loginForm.value, data => { this.loginService.userLogin(this.loginForm.value, data => {
if (data['return_code'] === '000000') { if (data['return_code'] === '000000') {
data['return_data']['object']['menuList'] = data['return_data']['object']['menuList'].filter(o => o.showOnMobile == 0); data['return_data']['object']['menuList'] = data['return_data']['object']['menuList'].filter(o => o.showOnMobile === 0);
this.store.set(ADMIN_INFO_OBJECT, data['return_data']['object']); this.store.set(ADMIN_INFO_OBJECT, data['return_data']['object']);
this.store.set(TOKEN, data['return_data']['uniqueCode']); this.store.set(TOKEN, data['return_data']['uniqueCode']);
this.store.set(INIT_FLAG, true); this.store.set(INIT_FLAG, true);
@ -63,4 +66,9 @@ export class LoginComponent implements OnInit {
}); });
} }
// 子组件验证方法
validateFun(str: string) {
this.code = str;
}
} }

@ -95,9 +95,6 @@
</nz-form-item> </nz-form-item>
</div> </div>
<div nz-col nzSpan="8"> <div nz-col nzSpan="8">
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="8">创建时间</nz-form-label> <nz-form-label [nzSpan]="8">创建时间</nz-form-label>

@ -0,0 +1,5 @@
<div id="v_container" (click)="refresh()" style="width: 100%;height: 100%;display: flex;justify-content: center;">
<canvas #verifyCanvas width="100" height="40" style="cursor: pointer;" ></canvas>
</div>

@ -0,0 +1,120 @@
import { Component, ElementRef, ViewChild, OnInit,Output,EventEmitter } from '@angular/core';
@Component({
selector: 'app-verification-code',
templateUrl: './verification-code.component.html',
styleUrls: ['./verification-code.component.scss']
})
export class VerificationCodeComponent implements OnInit {
@ViewChild('verifyCanvas') verifyCanvas: ElementRef;
@Output() validate = new EventEmitter()
codeLength = 4; // 设置验证码长度
options = {
// 默认options参数值
id: 'v_container', // 容器Id
canvasId: 'verifyCanvas', // canvas的ID
width: 100, // 默认canvas宽度
height: 40, // 默认canvas高度
type: 'blend', // 图形验证码默认类型blend:数字字母混合类型、number:纯数字、letter:纯字母
code: '',
numArr: [],
letterArr: [],
};
ctx;
constructor() {}
ngOnInit() {}
ngAfterViewInit(){
this.ctx = this.verifyCanvas.nativeElement.getContext('2d');
this.options.numArr = '0,1,2,3,4,5,6,7,8,9'.split(',');
this.options.letterArr = this.getAllLetter();
this.refresh();
}
// 生成验证码
refresh() {
this.options.code = '';
this.ctx.textBaseline = 'middle';
this.ctx.fillStyle = this.randomColor(180, 240);
this.ctx.fillRect(0, 0, this.options.width, this.options.height);
let txtArr = [];
if (this.options.type === 'blend') {
// 判断验证码类型
txtArr = this.options.numArr.concat(this.options.letterArr);
} else if (this.options.type === 'number') {
txtArr = this.options.numArr;
} else {
txtArr = this.options.letterArr;
}
for (let i = 1; i <= this.codeLength; i++) {
const txt = txtArr[this.randomNum(0, txtArr.length)];
this.options.code += txt;
this.ctx.font = this.randomNum(this.options.height / 2, this.options.height) + 'px SimHei'; // 随机生成字体大小
this.ctx.fillStyle = this.randomColor(50, 160); // 随机生成字体颜色
this.ctx.shadowOffsetX = this.randomNum(-3, 3);
this.ctx.shadowOffsetY = this.randomNum(-3, 3);
this.ctx.shadowBlur = this.randomNum(-3, 3);
this.ctx.shadowColor = 'rgba(0, 0, 0, 0.3)';
const x = (this.options.width / (this.codeLength + 1)) * i;
const y = this.options.height / 2;
const deg = this.randomNum(-30, 30);
// 设置旋转角度和坐标原点
this.ctx.translate(x, y);
this.ctx.rotate((deg * Math.PI) / 180);
this.ctx.fillText(txt, 0, 0);
// 恢复旋转角度和坐标原点
this.ctx.rotate((-deg * Math.PI) / 180);
this.ctx.translate(-x, -y);
}
// 绘制干扰线
for (let i = 0; i < 2; i++) {
this.ctx.strokeStyle = this.randomColor(40, 180);
this.ctx.beginPath();
this.ctx.moveTo(this.randomNum(0, this.options.width), this.randomNum(0, this.options.height));
this.ctx.lineTo(this.randomNum(0, this.options.width), this.randomNum(0, this.options.height));
this.ctx.stroke();
}
// 绘制干扰点
for (let i = 0; i < this.options.width / 2; i++) {
this.ctx.fillStyle = this.randomColor(0, 255);
this.ctx.beginPath();
this.ctx.arc(this.randomNum(0, this.options.width), this.randomNum(0, this.options.height), 1, 0, 2 * Math.PI);
this.ctx.fill();
}
this.validate.emit(this.options.code.toLowerCase())
}
// 生成字母数组
getAllLetter() {
const letterStr =
'a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z';
return letterStr.split(',');
}
// 生成一个随机数
randomNum(min, max) {
return Math.floor(Math.random() * (max - min) + min);
}
// 生成一个随机色
randomColor(min, max) {
const r = this.randomNum(min, max);
const g = this.randomNum(min, max);
const b = this.randomNum(min, max);
return 'rgb(' + r + ',' + g + ',' + b + ')';
}
}

@ -0,0 +1,14 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { VerificationCodeComponent } from './verification-code.component';
@NgModule({
imports: [
CommonModule
],
exports: [
VerificationCodeComponent
],
declarations: [VerificationCodeComponent]
})
export class VerificationCodeModule { }

@ -352,9 +352,9 @@ export class CommonsService {
*/ */
public dateTimeType(type: number): number { public dateTimeType(type: number): number {
if (type === 1) { if (type === 1) {
return new Date().getDay() - 2; return new Date().getDate() - 1;
} else if (type === 3) { } else if (type === 3) {
return new Date().getMonth() + 1; return new Date().getMonth();
} else { } else {
return 100; return 100;
} }

@ -4,7 +4,7 @@
export const environment = { export const environment = {
production: false, production: false,
baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址) baseUrl: 'https://hsgcs.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址)
orderUrl: 'https://hsgcs.dctpay.com/order/', // 测试环境服务器地址(请求数据地址) orderUrl: 'https://hsgcs.dctpay.com/order/', // 测试环境服务器地址(请求数据地址)
imageUrl: 'https://hsgcs.dctpay.com/filesystem/', imageUrl: 'https://hsgcs.dctpay.com/filesystem/',
key: 'https://hsgcs.dctpay.com/phone-recharge-H5/index.html?codeValue=', key: 'https://hsgcs.dctpay.com/phone-recharge-H5/index.html?codeValue=',

Loading…
Cancel
Save