Commit 06e739ca by lixinming

no message

parent 795ca65b
...@@ -68,7 +68,10 @@ export async function firstLoginChangePwd(uscc:string, pwd:string, confirmPwd:st ...@@ -68,7 +68,10 @@ export async function firstLoginChangePwd(uscc:string, pwd:string, confirmPwd:st
export async function changePassword(uscc:string, pwd:string, newPwd:string) { export async function changePassword(uscc:string, pwd:string, newPwd:string) {
let reg = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?]"); let reg = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?]");
if (reg.test(newPwd)) { if (reg.test(newPwd)) {
throw new BizError(ERRORENUM.密码不允许有特殊字符); throw new BizError(ERRORENUM.密码不允许有特殊字符, uscc, pwd);
}
if (pwd.length > 24) {
throw new BizError(ERRORENUM.密码长度不能超过24个字符, uscc, pwd);
} }
let fuhuaqiInfo = await fuhuaqiData.findFuHuaQiByUSCC(uscc); let fuhuaqiInfo = await fuhuaqiData.findFuHuaQiByUSCC(uscc);
if (!fuhuaqiInfo) throw new BizError(ERRORENUM.未找到数据); if (!fuhuaqiInfo) throw new BizError(ERRORENUM.未找到数据);
......
...@@ -15,6 +15,7 @@ export enum ERRORENUM { ...@@ -15,6 +15,7 @@ export enum ERRORENUM {
身份验证失败, 身份验证失败,
非法登录, 非法登录,
身份验证过期, 身份验证过期,
密码长度不能超过24个字符
} }
export enum ERRORCODEENUM { export enum ERRORCODEENUM {
......
...@@ -10,7 +10,6 @@ import { baseDB } from '../../db/dbInit'; ...@@ -10,7 +10,6 @@ import { baseDB } from '../../db/dbInit';
const fuHuaQiSchema = new Schema({ const fuHuaQiSchema = new Schema({
name: {type:String,index: true},//名称 name: {type:String,index: true},//名称
firstLoginIsChangePwd:{type:Boolean, default:false},//首次登录是否修改密码
operationName:String,//运营机构名称 不可修改 operationName:String,//运营机构名称 不可修改
uscc:{type:String, index: true},//统一信用代码 也是登录账号 不可修改 uscc:{type:String, index: true},//统一信用代码 也是登录账号 不可修改
virtualEnterpriseNum:Number,//虚拟企业数量 virtualEnterpriseNum:Number,//虚拟企业数量
...@@ -32,7 +31,8 @@ const fuHuaQiSchema = new Schema({ ...@@ -32,7 +31,8 @@ const fuHuaQiSchema = new Schema({
/**登录相关 */ /**登录相关 */
pwd:String,//登录密码 pwd:String,//登录密码
token:{type:String, index:true}, token:{type:String, index:true},
tokenMs:Number tokenMs:Number,
firstLoginIsChangePwd:{type:Boolean, default:false},//首次登录是否修改密码
}); });
var fuHuaQiModel; var fuHuaQiModel;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment