密码混淆
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import http from '@/utils/http';
|
||||
import { AreaCode, SendCodeType } from '@/types/common';
|
||||
import { encodePhone } from '@/utils/transform';
|
||||
import { encodePhone, encryptPwd } from '@/utils/transform';
|
||||
|
||||
export enum CheckResult {
|
||||
Login = 0,
|
||||
@@ -20,7 +20,7 @@ export async function signIn(areacode: AreaCode, phone: string, password: string
|
||||
'/sign/in',
|
||||
{
|
||||
phone: encodePhone(areacode, phone),
|
||||
password,
|
||||
password: encryptPwd(password),
|
||||
},
|
||||
);
|
||||
if (!ok || !data || !data.token) {
|
||||
@@ -34,7 +34,7 @@ export async function signUp(areacode: AreaCode, phone: string, password: string
|
||||
'/sign/upwi',
|
||||
{
|
||||
phone: encodePhone(areacode, phone),
|
||||
password,
|
||||
password: encryptPwd(password),
|
||||
inviter,
|
||||
code,
|
||||
},
|
||||
@@ -50,7 +50,7 @@ export async function reset(areacode: AreaCode, phone: string, password: string,
|
||||
'/sign/forget',
|
||||
{
|
||||
phone: encodePhone(areacode, phone),
|
||||
password,
|
||||
password: encryptPwd(password),
|
||||
code,
|
||||
},
|
||||
);
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import http from '@/utils/http';
|
||||
import { encryptPwd } from '@/utils/transform';
|
||||
|
||||
export async function changeFundPwd(newPassword: string, password?: string) {
|
||||
const { ok, msg } = await http.post('/user/chFundPwd', {
|
||||
password,
|
||||
newPassword,
|
||||
password: password && encryptPwd(password),
|
||||
newPassword: encryptPwd(newPassword),
|
||||
});
|
||||
if (ok) return;
|
||||
throw Error(msg);
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import http from '@/utils/http';
|
||||
import { encryptPwd } from '@/utils/transform';
|
||||
|
||||
export async function changeLgpwd(newPassword: string, password?: string) {
|
||||
export async function changeLgpwd(newPassword: string, password: string) {
|
||||
const { ok, msg } = await http.post('/user/chpasswd', {
|
||||
password,
|
||||
newPassword,
|
||||
password: encryptPwd(password),
|
||||
newPassword: encryptPwd(newPassword),
|
||||
});
|
||||
if (ok) return;
|
||||
throw Error(msg);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import BigNumber from 'bignumber.js';
|
||||
import _ from 'lodash';
|
||||
import md5 from 'md5';
|
||||
import { AreaCode, Estate } from '@/types/common';
|
||||
|
||||
export function encodePhone(code: AreaCode, phone: string): string {
|
||||
@@ -41,3 +42,7 @@ export function fromLangToText(lang: string) {
|
||||
const target = _.find(supportedLangs, { lang });
|
||||
return target && target.text;
|
||||
}
|
||||
|
||||
export function encryptPwd(pwd: string): string {
|
||||
return md5(pwd);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user