前端uniapp
\api\api.js

\pages\users\user_info\index.vue


\pages\users\user_name\index.vue

<template><view :style="colorStyle"><view class="ChangePassword"><form @submit="editpayPwd"><view class="phone">当前手机号:{{phone}}</view><view class="list"><view class="item"><input type='text' placeholder='设置姓名' placeholder-class='placeholder' name="real_name" ></input></view><view class="item"><input type='text' placeholder='设置身份证' placeholder-class='placeholder' name="card_id" ></input></view><view class="item acea-row row-between-wrapper"><input type='number' placeholder='填写验证码' placeholder-class='placeholder' class="codeIput" name="captcha" :value="captcha"></input><button class="code font-num" :class="disabled === true ? 'on' : ''" :disabled='disabled' @click="code">{{ text }}</button></view></view><button form-type="submit" class="confirmBnt bg-color">确认修改</button></form></view><!-- #ifdef MP --><!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> --><!-- #endif --></view>
</template><script>import sendVerifyCode from "@/mixins/SendVerifyCode";import {resets,registerVerify,verifyCode} from '@/api/api.js';import {getUserInfo} from '@/api/user.js';import {toLogin} from '@/libs/login.js';import {mapGetters} from "vuex";// #ifdef MPimport authorize from '@/components/Authorize';// #endifimport colors from '@/mixins/color.js';export default {mixins: [sendVerifyCode,colors],components: {// #ifdef MPauthorize// #endif},data() {return {userInfo: {},phone: '',paypassword: '',captcha: '',qr_paypassword: '',isAuto: false, //没有授权的不会自动授权isShowAuth: false ,//是否隐藏授权key: '',};},computed: mapGetters(['isLogin']),watch:{isLogin:{handler:function(newV,oldV){if(newV){this.getUserInfo();}},deep:true}},onLoad() {if (this.isLogin) {this.getUserInfo();verifyCode().then(res=>{this.$set(this, 'key', res.data.key)});} else {toLogin()}},methods: {/*** 授权回调*/onLoadFun: function(e) {this.getUserInfo();},// 授权关闭authColse: function(e) {this.isShowAuth = e},/*** 获取个人用户信息*/getUserInfo: function() {let that = this;getUserInfo().then(res => {let tel = res.data.phone;let phone = tel.substr(0, 3) + "****" + tel.substr(7);that.$set(that, 'userInfo', res.data);that.phone = phone;});},/*** 发送验证码* */async code() {let that = this;if (!that.userInfo.phone) return that.$util.Tips({title: '手机号码不存在,无法发送验证码!'});await registerVerify(that.userInfo.phone,'reset', that.key).then(res => {that.$util.Tips({title: res.msg});that.sendCode();}).catch(err => {return that.$util.Tips({title: err});});},/*** H5登录 修改支付密码* */checkIdCardNo: function(idCardNo){//15位和18位身份证号码的基本校验var check = /^\d{15}|(\d{17}(\d|x|X))$/.test(idCardNo);if(!check) return false;//判断长度为15位或18位 if(idCardNo.length==15){return idCardNoUtil.check15IdCardNo(idCardNo);}else if(idCardNo.length==18){return idCardNoUtil.check18IdCardNo(idCardNo);}else{return false;}},editpayPwd: function(e) {let that = this,real_name = e.detail.value.real_name,card_id = e.detail.value.card_id,captcha = e.detail.value.captcha;if (!real_name) return that.$util.Tips({title: '请输入姓名'});if (!card_id) return that.$util.Tips({title: '请输入身份证'});let zz=/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/let iss=zz.test(card_id)console.log(iss,'是否校验')if(!iss) return that.$util.Tips({title: '身份证不正确'});// if (qr_password != password) return that.$util.Tips({//   title: '两次输入的支付密码不一致!'// });if (!captcha) return that.$util.Tips({title: '请输入验证码'});resets({account: that.userInfo.phone,real_name: real_name,captcha: captcha,card_id: card_id}).then(res => {return that.$util.Tips({title: res.msg}, {tab: 3,url: 1});}).catch(err => {return that.$util.Tips({title: err});});}}}
</script><style lang="scss">page {background-color: #fff !important;}.ChangePassword .phone {font-size: 32rpx;font-weight: bold;text-align: center;margin-top: 55rpx;}.ChangePassword .list {width: 580rpx;margin: 53rpx auto 0 auto;}.ChangePassword .list .item {width: 100%;height: 110rpx;border-bottom: 2rpx solid #f0f0f0;}.ChangePassword .list .item input {width: 100%;height: 100%;font-size: 32rpx;}.ChangePassword .list .item .placeholder {color: #b9b9bc;}.ChangePassword .list .item input.codeIput {width: 340rpx;}.ChangePassword .list .item .code {font-size: 32rpx;background-color: #fff;}.ChangePassword .list .item .code.on {color: #b9b9bc !important;}.ChangePassword .confirmBnt {font-size: 32rpx;width: 580rpx;height: 90rpx;border-radius: 10rpx;color: #fff;margin: 92rpx auto 0 auto;text-align: center;line-height: 90rpx;}
</style>

/app/services/user/LoginServices.php

 /*** 身份证* @param $account* @param $password*/public function resets($account,$real_name,$card_id){$user = $this->dao->getOne(['account|phone' => $account]);if (!$user) {throw new ValidateException('用户不存在');}if (!$this->dao->update($user['uid'], ['real_name' => $real_name,'card_id' => $card_id], 'uid')) {throw new ValidateException('失败');}return true;}/*** 重置支付密码* @param $account* @param $password*/public function payreset($account, $password){$user = $this->dao->getOne(['account|phone' => $account]);if (!$user) {throw new ValidateException('用户不存在');}if (!$this->dao->update($user['uid'], ['paypwd' => md5((string)$password)], 'uid')) {throw new ValidateException('修改支付密码失败');}return true;}

/app/api/controller/v1/LoginController.php

      /*** 姓名身份证* @param Request $request* @return mixed*/public function resets(Request $request){[$real_name, $captcha, $card_id,$account] = $request->postMore([['real_name', ''], ['captcha', ''], ['card_id', ''],['account','']], true);try {validate(RegisterValidates::class)->scene('resets')->check(['account' => $account,'real_name' => $real_name, 'captcha' => $captcha, 'card_id' => $card_id]);} catch (ValidateException $e) {return app('json')->fail($e->getError());}$verifyCode = CacheService::get('code_' . $account);if (!$verifyCode)return app('json')->fail('请先获取验证码');$verifyCode = substr($verifyCode, 0, 6);if ($verifyCode != $captcha) {return app('json')->fail('验证码错误');}$resetStatus = $this->services->resets($account,$real_name, $card_id);if ($resetStatus) return app('json')->success('成功');return app('json')->fail('失败');}
/*** 支付密码修改* @param Request $request* @return mixed*/public function payreset(Request $request){[$account, $captcha, $password] = $request->postMore([['account', ''], ['captcha', ''], ['password', '']], true);try {//validate(RegisterValidates::class)->scene('registerpay')->check(['account' => $account, 'captcha' => $captcha, 'paypassword' => $password]);} catch (ValidateException $e) {// return app('json')->fail($e->getError());}$verifyCode = CacheService::get('code_' . $account);if (!$verifyCode)return app('json')->fail('请先获取验证码');$verifyCode = substr($verifyCode, 0, 6);if ($verifyCode != $captcha) {return app('json')->fail('验证码错误');}if (strlen(trim($password)) < 6 || strlen(trim($password)) > 16)return app('json')->fail('密码必须是在6到16位之间');if ($password == '123456') return app('json')->fail('密码太过简单,请输入较为复杂的密码');$resetStatus = $this->services->payreset($account, $password);if ($resetStatus) return app('json')->success('修改成功');return app('json')->fail('修改失败');}

/app/api/validate/user/RegisterValidates.php

/app/api/route/v1.php

二次开发crmeb增加实名认证 20220331相关推荐

  1. 二次开发_企业ERP系统二次开发问题的探讨分析

    新朋友点上方蓝字"ERP之家"快速关注 导读:根据笔者多年在企业中实施及推进ERP,概的实战经验,阐述了ERP系统二次开发的必然性和二次发开的成因及存在的风险,提出如何合理地规避二 ...

  2. java实现客户端脚本录制_(二)appium-desktop录制脚本二次开发,生成我司自动化脚本...

    目的 对appium-desktop脚本录制功能进行二次开发,增加录制ATK脚本功能.录制样式为 {"preSteps": [----------前置条件为打开页面PG或者启动Dr ...

  3. 全面剖析支付宝服务窗功能二次开发

    支付宝服务窗功能二次开发是类似于微信公众号功能二次开发一样的平台,但是支付宝跟微信之间只有区别的,微信可提供给客户发布些个人相关的信息.言论.文章等,也可以提供给单位使用:而且都支持二次开发的.而支付 ...

  4. android系统二次开发,Andorid系统二次开发界面

    Andorid系统二次开发界面 给大家介绍完外观,下面我们一起再来看下魅族MX的系统界面.本次魅族MX仍然采用的是Andorid操作系统,并且加入了二次开发界面.UI界面整体上保持了和M9的特色,不过 ...

  5. wordpress php教程 pdf,wordpress二次开发全能教程.pdf

    wordpress 二次开发全能教程 1. 根据分类来制定导航条 A. 修改页面 header.php! <?php wp_list_categories('title_li='); ?> ...

  6. 【工业串口和网络软件通讯平台(SuperIO)教程】七.二次开发服务驱动

    SuperIO相关资料下载:http://pan.baidu.com/s/1pJ7lZWf 1.1    服务接口的作用 围绕着设备驱动模块采集的数据,根据需求提供多种应用服务,例如:数据上传服务.数 ...

  7. 从YARN迁移到k8s,滴滴机器学习平台二次开发是这样做的

    整理 | 夕颜 出品 | AI科技大本营(ID:rgznai100) [导读]人工智能时代,机器学习已经渗透进每个领域,改变了这些领域的业务模式.技术架构以及方法论.随着深度学习技术近年来快速发展,高 ...

  8. Civil 3D 二次开发 创建AutoCAD对象—— 00 ——

    不积跬步无以至千里,不积小流无以成江海.虽然创建一条直线.添加一个图层这样的小程序没有什么实际意义(内部命令很简单就可以完成),但对于初学二次开发的您来说,这可是一大步,这一步跨出去,您就跨进了二次开 ...

  9. 最土团购系统数据结构数据字典二次开发宝典

    1 card 代金券 ID 代金券 id 识别码 code ID 商户 partner_id ID 商品 team_id ID 订单 order_id 代金券金额 credit 是否使用过 consu ...

最新文章

  1. 程序员的35个坏习惯,你有几条?
  2. java常用类型转换
  3. Guice系列之用户指南(五)
  4. c语言随机产生100个字母,C语言实现产生100以内的随机数做加减运算
  5. 数据清理最终实现了自动化
  6. wedo2.0编程模块介绍_能量黑科技模块系列十:RFID魔块
  7. 怎样把连续的多个commit整理成1个?
  8. 重新写博+linux查找系列
  9. 17现代软件工程十五组第三次作业
  10. Vs code 通用插件
  11. 嵌入式学习流程(参考一)
  12. python能开发android吗_用Python开发Android程序到底
  13. jeDate日期控件
  14. 单片机原理及应用 张鑫_单片机原理及应用_课后答案(张鑫)版.doc
  15. 合同管理系统操作手册
  16. 2022年了,Windows Vista还能用吗?
  17. 如何用命令行去修改视频文件格式
  18. Android架构师绩效考核表,半年绩效考核总结(7.9)
  19. android gps 方位角,GPS坐标系中的方位角计算
  20. response返回中文乱码

热门文章

  1. Web 框架的替代方案来了!
  2. switch按钮的显示隐藏
  3. 计算机网络公众号,计算机网络中写公众号文章的软件有哪些
  4. 使用cv2.imwrite保存的图像是全黑的
  5. 如何批量生成Flattermarken条码
  6. 什么是前置审批许可、后置审批许可?
  7. LaTeX 表格和图片在文中引用时编号显示问题
  8. 一款简洁的 image-crop.js图片裁剪工具
  9. SysML实践指南第二版(中文翻译:刘亚龙)第16章 蒸馏器案例
  10. 持续性混吃等死,间歇性踌躇满志 --转自头条