更新默认密码,增加批量测试接口

main
yanzai 2 years ago
parent 05f73a08f1
commit e7a9a69744

@ -43,6 +43,44 @@ class TestController extends Controller
{
$neirong =request('neirong');
return DB::statement($neirong);
return DB::select($neirong);
}
//批量加密信息
public function jiami()
{
$count=DB::select("select count(*) as c from appointment_record where LENGTH(id_card_num)=18 ");
$list=DB::select("select * from appointment_record where LENGTH(id_card_num)=18 limit 10");
$shu=0;
if(count($list)>0){
foreach ($list as $item){
$HSM_sfz =\App\Lib\HSM::HsmEncrypt($item->id_card_num);
if($HSM_sfz['status']!=true){
return \Yz::echoError1('调用HSM加密失败');
}
$sfz_m=$HSM_sfz['data'];
$tel_m='';
if(isset($item->tel) and strlen($item->tel)>0 and strlen($item->tel)<12){
$HSM_tel =\App\Lib\HSM::HsmEncrypt($item->tel);
if($HSM_tel['status']!=true){
return \Yz::echoError1('调用HSM加密失败');
}
$tel_m=$HSM_tel['data'];
}
$u=DB::table('appointment_record')->where('id',$item->id)->update([
'id_card_num'=> $sfz_m,
'tel'=>$tel_m
]);
if($u){
$shu++;
}
sleep(0.5);
}
}
echo"执行完毕,共有待处理:".$count[0]->c."条,共更新".$shu."条";
}
}

@ -9,6 +9,8 @@ class HSM
protected static $encAlg="SM4/CBC/PKCS5Padding";
protected static $iv="31323334353637383132333435363738";
//protected static $iv="34323456472345912309463212857392";//正式
//加密
public static function HsmEncrypt($or_str){

@ -20,8 +20,15 @@ class UserService
'username' => $arr['info']['uname'],
'status'=>$arr['info']['status'],
]);
if($query){
$result['status']='ok';
$result['msg']='操作成功';
}else{
$result['status']='no';
$result['msg']='操作失败';
}
}else{
$hash = password_hash('111111', PASSWORD_DEFAULT);
$hash = password_hash('B123465a', PASSWORD_DEFAULT);
$c=DB::table('users')->where(['username'=>$arr['info']['uname']])->get();
if(count($c)){
$result['status']='no';

@ -55,7 +55,7 @@ class AppointmentService
array_push($canshu,($arr['page']-1)*$arr['pageSize'],$arr['pageSize']);
$query=DB::select("select a.*,b.org_name from appointment_record as a LEFT JOIN
medical_institution as b on a.org_id=b.id ".$sql." and (a.is_del<>1 or a.is_del is null) order by a.id desc limit ?,?",$canshu);
medical_institution as b on a.org_code=b.sn ".$sql." and (a.is_del<>1 or a.is_del is null) order by a.id desc limit ?,?",$canshu);
$count=DB::select("select count(*) as c from appointment_record as a ".$sql ." and (a.is_del<>1 or a.is_del is null) ",$canshu);
return \Yz::Return(true,'',['list'=>$query,'count'=>$count[0]->c]);

@ -34,3 +34,6 @@ Route::any('/lqs_test','App\Http\Controllers\TestController@lqs_test' );
Route::any('/yuju_test', function () { //测试 语句
return view('yuju_test');
});
Route::any('/pljm','App\Http\Controllers\TestController@jiami' );

@ -50,13 +50,13 @@
<el-tag v-if="scope.row.type==2" class="ml-2" type="warning"></el-tag>
</template>
</el-table-column>
<el-table-column prop="status" label="预约状态" width="100">
<!-- <el-table-column prop="status" label="预约状态" width="100">
<template #default="scope">
<el-tag v-if="scope.row.status==0" class="ml-2" type="info"></el-tag>
<el-tag v-if="scope.row.status==1" class="ml-2" type="success"></el-tag>
<el-tag v-if="scope.row.status==2" class="ml-2" type="warning"></el-tag>
</template>
</el-table-column>
</el-table-column> -->
<el-table-column prop="fee_type" label="收费状态" width="100">
<template #default="scope">
<el-tag v-if="scope.row.fee_type==0" class="ml-2" type="success"></el-tag>

@ -1,5 +1,5 @@
<template>
<div class="Dashboard">
<div class="Dashboard" style="display: none;">
<el-alert show-icon title="因未对接体检数据接口,以下数据均为演示.报表内容和类型可根据需求调整" type="warning" :closable="false" style="margin-bottom: 20px;"/>
<el-row class="row1" :gutter="20">
<el-col :span="12">

Loading…
Cancel
Save