套餐页面调整、婚检验证码功能、bug
parent
f3048eb78e
commit
09ce5ec7cd
@ -0,0 +1,54 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\API;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
|
class SendMsgCodeController extends Controller
|
||||||
|
{
|
||||||
|
//创建验证码
|
||||||
|
public function SendMsgCode(Request $request)
|
||||||
|
{
|
||||||
|
$mobile = request('mobile');
|
||||||
|
//查找相同手机号1分钟内是否发送过
|
||||||
|
$code = DB::table('send_code')->where('mobile', $mobile)->where('created_at', '>=', date('Y-m-d H:i:s', time() - 60))->first();
|
||||||
|
if ($code) {
|
||||||
|
return \Yz::echoError1("操作太频繁,请稍后再试");
|
||||||
|
}
|
||||||
|
$code = rand(100000, 999999);
|
||||||
|
//获取当前时间5分钟后的日期时间
|
||||||
|
$end_time = date('Y-m-d H:i:s', time() + 300);
|
||||||
|
$i=DB::table('send_code')->insert([
|
||||||
|
'mobile' => $mobile,
|
||||||
|
'code' => $code,
|
||||||
|
'created_at' => date('Y-m-d H:i:s'),
|
||||||
|
'end_time' => $end_time
|
||||||
|
]);
|
||||||
|
if ($i) {
|
||||||
|
$aspnet=new AspNetZhuanController();
|
||||||
|
$aspnet::SendYanZhengMaCode(1,$mobile,$code);
|
||||||
|
return \Yz::Return(true,"发送成功",[]);
|
||||||
|
} else {
|
||||||
|
return \Yz::echoError1("发送失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
//验证验证码
|
||||||
|
public function CheckMsgCode(){
|
||||||
|
$mobile = request('mobile');
|
||||||
|
$code = request('code');
|
||||||
|
$u = DB::table('send_code')
|
||||||
|
->where('mobile', $mobile)
|
||||||
|
->where('code', $code)
|
||||||
|
->where('end_time', '>=', date('Y-m-d H:i:s'))
|
||||||
|
->where(['status' => 1])
|
||||||
|
->update(['status' => 2]);
|
||||||
|
if($u){
|
||||||
|
return \Yz::Return(true,"验证成功",['data'=>$code]);
|
||||||
|
}else{
|
||||||
|
return \Yz::echoError1("验证码无效");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,41 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<uni-file-picker
|
||||||
|
v-model="imageValue"
|
||||||
|
fileMediatype="image"
|
||||||
|
mode="grid"
|
||||||
|
ref="files" :auto-upload="false"
|
||||||
|
@select="select"
|
||||||
|
@progress="progress"
|
||||||
|
|
||||||
|
/>
|
||||||
|
<button @click="upload">上传文件</button>
|
||||||
|
<view v-if="fileInfo">
|
||||||
|
{{fileInfo}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import {
|
||||||
|
ref
|
||||||
|
} from 'vue'
|
||||||
|
let files=ref(null);
|
||||||
|
let imageValue=ref(null);
|
||||||
|
const upload=()=>{
|
||||||
|
|
||||||
|
}
|
||||||
|
const progress=(e)=>{
|
||||||
|
console.log(e)
|
||||||
|
}
|
||||||
|
let fileInfo=ref(null);
|
||||||
|
const select=(e)=>{
|
||||||
|
console.log('-------',e)
|
||||||
|
fileInfo.value=e
|
||||||
|
fileInfo.value= JSON.stringify(fileInfo.value)
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
|
||||||
|
</style>
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 44 KiB |
Loading…
Reference in New Issue