chengkun
2025-05-28 4be2904f3688c07e0e9793414bda33ae1f85f565
提交
7 files modified
13393 ■■■■ changed files
admin/images/system.css 11949 ●●●● patch | view | raw | blame | history
app/controller/login/index.class.php 861 ●●●● patch | view | raw | blame | history
app/include/public.function.php 10 ●●●●● patch | view | raw | blame | history
app/model/notice.model.php 214 ●●●● patch | view | raw | blame | history
app/template/admin/admin_member.htm 7 ●●●● patch | view | raw | blame | history
app/template/admin/admin_member_userlist.htm 5 ●●●●● patch | view | raw | blame | history
app/template/admin/admin_msg_config.htm 347 ●●●● patch | view | raw | blame | history
admin/images/system.css
Diff too large
app/controller/login/index.class.php
@@ -1,204 +1,204 @@
<?php
class index_controller extends common{
    function index_action(){
        if($this->uid!=""&&$this->username!=""){
            if($_GET['type']=="out"){
                $this->cookie->unset_cookie();
            }else{
                $this->ACT_msg($this->config['sy_weburl']."/member", "您已经登录了!");
            }
        }
        if($_GET['backurl']=='1'){
            $this->cookie->setCookie("backurl",$_SERVER['HTTP_REFERER'],time()+60);
        }
        if(!$_GET['usertype']){
            $_GET['usertype']        =        1;
        }
        $this->yunset("cookie", $_COOKIE['checkurl']);
        $this->yunset("usertype",(int)$_GET['usertype']);
        $this->yunset("loginname",$_COOKIE['loginname']);
        $this->yunset("referurl",$_SERVER['HTTP_REFERER']);
        $this->seo("login");
        $this->yun_tpl(array('index'));
    }
    //登录验证
    function loginsave_action(){
        $Member                    =            $this->MODEL('userinfo');
        $lData['username']        =            $_POST['username'];
        $lData['uid']            =            $this->uid;
        $lData['usertype']        =            $this->usertype;
        $lData['act_login']        =            $_POST['act_login'];
        $lData['num']            =            $_POST['num'];
        $lData['loginname']        =            $_POST['loginname'];
        $lData['password']        =            $_POST['password'];
        $lData['referurl']        =            $_POST['referurl'];
        $lData['authcode']        =            $_POST['authcode'];
        $lData['port']            =            1;
        $return                    =            $Member->userLogin($lData);
        if($return['uclogin']){
            $error    =    2;
            $return['msg'] = $return['uclogin'];
        }else{
            $error    =    1;
        }
        if($return['errcode']==2){
            $this->layer_msg($return['msg'],9,0,Url('register',array('c'=>'ident')),2,$error);
        }else if($return['url']){
            $this->layer_msg($return['msg'],9,0,$return['url'],2,$error);
        }else{
            $this->layer_msg($return['msg']);
        }
    }
    //登录短信验证码发送
    function sendmsg_action()
    {
        $noticeM    =    $this->MODEL('notice');
        $result        =    $noticeM->jycheck($_POST['code'],'前台登录');
        if(!empty($result)){
            $this->layer_msg($result['msg'], 9, 0, '', 2, $result['error']);
        }
        $moblie        =    $_POST['moblie'];
        $UserinfoM    =    $this->MODEL('userinfo');
        $userinfo    =    $UserinfoM->getInfo(array("moblie" => $moblie),array('field'=>"`usertype`,`uid`"));
        if ($this->config['sy_reg_type'] == 2 && empty($userinfo)){
            $result =   array(
                'error' =>  2,
                'msg'   =>  '请先注册账号'
            );
        }else{
            $user = array(
                'uid'        =>    $userinfo['uid'],
                'usertype'     =>    $userinfo['usertype']
            );
            $result    =    $noticeM->sendCode($moblie, 'login', 1, $user, 6, 90, 'msg');
class index_controller extends common {
    function index_action() {
        if ($this->uid != "" && $this->username != "") {
            if ($_GET['type'] == "out") {
                $this->cookie->unset_cookie();
            } else {
                $this->ACT_msg($this->config['sy_weburl'] . "/member", "您已经登录了!");
            }
        }
        echo json_encode($result);exit();
    }
    function rest_action(){
        $this->cookie->unset_cookie();
        $url = Url("login",array("usertype"=>"1"),"1");
        header("Location: ".$url);
    }
    function utype_action(){
        if($this->uid){
            header("Location:".$this->config['sy_weburl']."/member");
        }
        $this->seo("login");
        $this->yun_tpl(array('utype'));
    }
    function setutype_action(){
        //验证前期保存的登录数据,是否在本系统有存在并且密码对应
        if($_COOKIE['username'] && $_COOKIE['password'] && (CheckRegUser($_COOKIE['username']) OR CheckRegEmail($_COOKIE['username'])==false)){
            //无usertype情况下 才予以激活 否则直接登录会员中心
            $Member=$this->MODEL("userinfo");
            $user = $Member->getInfo(array("username"=>$_COOKIE['username']),array("field"=>"`uid`,`username`,`password`,`salt`,`usertype,did`"));
            $userid = $user['uid'];
            if(!$user['usertype']){
                if(passCheck($_COOKIE['password'],$user['salt'],$user['password']) && $user['password']!=''){
                    $usertype = (int)$_GET['usertype'];
                    if($usertype=='1'){
                        $table = "member_statis";
                        $table2 = "resume";
                        $data1=array("uid"=>$userid);
                        $data2['uid']=$userid;
                    }elseif($usertype=='2'){
                        $table         =  "company_statis";
                        $table2        =  "company";
                        $ratingM       =  $this->MODEL('rating');
                        $data1         =  $ratingM->FetchRatingInfo();
                        $data2['uid']  =  $userid;
                        $data1['did']  =  $user['did'];
                    }elseif($usertype=='3'){
                        $table = 'lt_statis';
                        $table2 = 'lt_info';
                        $id =$this->config['lt_rating'];
                        $row = $Member->GetRatinginfoOne(array('id'=>$id));
                        $data1=array('rating'=>$id,'integral'=>$this->config['integral_reg'],'rating_name'=>$row['name'],'rating_type'=>$row['type'],'lt_job_num'=>$row['lt_job_num'],'lt_down_resume'=>$row['lt_resume'],'lt_editjob_num'=>$row['lt_editjob_num'],'lt_breakjob_num'=>$row['lt_breakjob_num']);
                        if($row['service_time']>0){
                            $time=time()+86400*$row['service_time'];
                        }else{
                            $time=0;
                        }
                        $data1['vip_etime']=$time;
                        $data2['uid']=$userid;
                        $data2['did']=$user['did'];
                    }elseif($usertype=='4'){
                        $table = 'train_statis';
                        $table2 = 'px_train';
                        $data1=array('uid'=>$userid,'integral'=>$this->config['integral_reg']);
                        $data2['uid']=$userid;
                        $data2['did']=$user['did'];
                    }
                    $Member->upInfo(array(array("uid"=>$userid),"usertype"=>$usertype));
                    $Member->InsertReg($table,$data1);
                    $Member->InsertReg($table2,$data2);
                    $this->cookie->unset_cookie();
                    $this->cookie->add_cookie($userid,$user['username'],$user['salt'],$user['email'],$user['password'],$usertype,$this->config['sy_logintime'],$user['did']);
                    header("Location:".$this->config['sy_weburl'].'/member');
                }else{
                    $this->cookie->unset_cookie();
                    echo "激活失败";
                }
            }else{
                $this->cookie->unset_cookie();
                echo "激活失败";
            }
        }else{
            header("Location:".Url('index'));
        }
    }
    //微信登录
    function wxlogin_action()
    {
        $wxloginid  =   isset($_COOKIE['wxloginid']) ? $_COOKIE['wxloginid'] : '';
        $WxM        =   $this->MODEL('weixin');
        $qrcode     =   $WxM->applyWxQrcode($wxloginid, '', $this->uid);
        if ($_GET['backurl'] == '1') {
            $this->cookie->setCookie("backurl", $_SERVER['HTTP_REFERER'], time() + 60);
        }
        if (!$_GET['usertype']) {
            $_GET['usertype'] = 1;
        }
        $this->yunset("cookie", $_COOKIE['checkurl']);
        $this->yunset("usertype", (int)$_GET['usertype']);
        $this->yunset("loginname", $_COOKIE['loginname']);
        $this->yunset("referurl", $_SERVER['HTTP_REFERER']);
        $this->seo("login");
        $this->yun_tpl(array('index'));
    }
    //登录验证
    function loginsave_action() {
        $Member = $this->MODEL('userinfo');
        $lData['username'] = $_POST['username'];
        $lData['uid'] = $this->uid;
        $lData['usertype'] = $this->usertype;
        $lData['act_login'] = $_POST['act_login'];
        $lData['num'] = $_POST['num'];
        $lData['loginname'] = $_POST['loginname'];
        $lData['password'] = $_POST['password'];
        $lData['referurl'] = $_POST['referurl'];
        $lData['authcode'] = $_POST['authcode'];
        $lData['port'] = 1;
        $return = $Member->userLogin($lData);
        if ($return['uclogin']) {
            $error = 2;
            $return['msg'] = $return['uclogin'];
        } else {
            $error = 1;
        }
        if ($return['errcode'] == 2) {
            $this->layer_msg($return['msg'], 9, 0, Url('register', array('c' => 'ident')), 2, $error);
        } else if ($return['url']) {
            $this->layer_msg($return['msg'], 9, 0, $return['url'], 2, $error);
        } else {
            $this->layer_msg($return['msg']);
        }
    }
    /**
     * 登录短信验证码发送
     * @return void
     */
    function sendmsg_action() {
        $noticeM = $this->MODEL('notice');
        $result = $noticeM->jycheck($_POST['code'], '前台登录');
        if (!empty($result)) {
            $this->layer_msg($result['msg'], 9, 0, '', 2, $result['error']);
        }
        $moblie = $_POST['moblie']; // 获取手机号码参数
        $UserinfoM = $this->MODEL('userinfo'); // 获取用户模型
        $userinfo = $UserinfoM->getInfo(array("moblie" => $moblie), array('field' => "`usertype`,`uid`"));// 获取用户信息
        if ($this->config['sy_reg_type'] == 2 && empty($userinfo)) {
            $result = array(
                'error' => 2,
                'msg'   => '请先注册账号'
            );
        } else {
            $user = array(
                'uid'      => $userinfo['uid'],
                'usertype' => $userinfo['usertype']
            );
            $result = $noticeM->sendCode($moblie, 'login', 1, $user, 6, 90, 'msg'); //  发送短信验证码
        }
        echo json_encode($result);
        exit();
    }
    function rest_action() {
        $this->cookie->unset_cookie();
        $url = Url("login", array("usertype" => "1"), "1");
        header("Location: " . $url);
    }
    function utype_action() {
        if ($this->uid) {
            header("Location:" . $this->config['sy_weburl'] . "/member");
        }
        $this->seo("login");
        $this->yun_tpl(array('utype'));
    }
    function setutype_action() {
        //验证前期保存的登录数据,是否在本系统有存在并且密码对应
        if ($_COOKIE['username'] && $_COOKIE['password'] && (CheckRegUser($_COOKIE['username']) or CheckRegEmail($_COOKIE['username']) == false)) {
            //无usertype情况下 才予以激活 否则直接登录会员中心
            $Member = $this->MODEL("userinfo");
            $user = $Member->getInfo(array("username" => $_COOKIE['username']), array("field" => "`uid`,`username`,`password`,`salt`,`usertype,did`"));
            $userid = $user['uid'];
            if (!$user['usertype']) {
                if (passCheck($_COOKIE['password'], $user['salt'], $user['password']) && $user['password'] != '') {
                    $usertype = (int)$_GET['usertype'];
                    if ($usertype == '1') {
                        $table = "member_statis";
                        $table2 = "resume";
                        $data1 = array("uid" => $userid);
                        $data2['uid'] = $userid;
                    } elseif ($usertype == '2') {
                        $table = "company_statis";
                        $table2 = "company";
                        $ratingM = $this->MODEL('rating');
                        $data1 = $ratingM->FetchRatingInfo();
                        $data2['uid'] = $userid;
                        $data1['did'] = $user['did'];
                    } elseif ($usertype == '3') {
                        $table = 'lt_statis';
                        $table2 = 'lt_info';
                        $id = $this->config['lt_rating'];
                        $row = $Member->GetRatinginfoOne(array('id' => $id));
                        $data1 = array('rating' => $id, 'integral' => $this->config['integral_reg'], 'rating_name' => $row['name'], 'rating_type' => $row['type'], 'lt_job_num' => $row['lt_job_num'], 'lt_down_resume' => $row['lt_resume'], 'lt_editjob_num' => $row['lt_editjob_num'], 'lt_breakjob_num' => $row['lt_breakjob_num']);
                        if ($row['service_time'] > 0) {
                            $time = time() + 86400 * $row['service_time'];
                        } else {
                            $time = 0;
                        }
                        $data1['vip_etime'] = $time;
                        $data2['uid'] = $userid;
                        $data2['did'] = $user['did'];
                    } elseif ($usertype == '4') {
                        $table = 'train_statis';
                        $table2 = 'px_train';
                        $data1 = array('uid' => $userid, 'integral' => $this->config['integral_reg']);
                        $data2['uid'] = $userid;
                        $data2['did'] = $user['did'];
                    }
                    $Member->upInfo(array(array("uid" => $userid), "usertype" => $usertype));
                    $Member->InsertReg($table, $data1);
                    $Member->InsertReg($table2, $data2);
                    $this->cookie->unset_cookie();
                    $this->cookie->add_cookie($userid, $user['username'], $user['salt'], $user['email'], $user['password'], $usertype, $this->config['sy_logintime'], $user['did']);
                    header("Location:" . $this->config['sy_weburl'] . '/member');
                } else {
                    $this->cookie->unset_cookie();
                    echo "激活失败";
                }
            } else {
                $this->cookie->unset_cookie();
                echo "激活失败";
            }
        } else {
            header("Location:" . Url('index'));
        }
    }
    //微信登录
    function wxlogin_action() {
        $wxloginid = isset($_COOKIE['wxloginid']) ? $_COOKIE['wxloginid'] : '';
        $WxM = $this->MODEL('weixin');
        $qrcode = $WxM->applyWxQrcode($wxloginid, '', $this->uid);
        if (!$qrcode) {
            echo 0;
        } else {
            echo $qrcode;
        }
    }
    function getwxloginstatus_action()
    {
    function getwxloginstatus_action() {
        if ($_COOKIE['wxloginid']) {
            $WxM    =   $this->MODEL('weixin');
            $result =   $WxM->getWxLoginStatus($_COOKIE['wxloginid'], $this->uid);
            $WxM = $this->MODEL('weixin');
            $result = $WxM->getWxLoginStatus($_COOKIE['wxloginid'], $this->uid);
            if ($result['status'] == 1) {
                if (!empty($result['member'])) {
                    $user   =   $result['member'];
                    $user = $result['member'];
                    if ($user['usertype'] == 0) {
                        $this->cookie->unset_cookie();
                        $this->cookie->add_cookie($user['uid'], $user['username'], $user['salt'], $user['email'], $user['password'], '', $this->config['sy_logintime'], $user['did']);
                        $this->layer_msg('扫码成功', 9, 0, Url('register', array('c' => 'ident')));
                    } else {
                        if ($user['status'] == "2") {
                            $this->layer_msg('您的账号已被锁定', 9, 0, Url("register", array("c" => "ok", "type" => 2), "1"), 2);
                        }
@@ -207,259 +207,262 @@
                        $this->layer_msg('', 9, 0, Url("member"));
                    }
                } else {
                    $this->layer_msg('扫码成功,请绑定已有账号或直接创建新账号', 9, 0, Url('wxconnect', array('bind' => 1, 'type' => 'ba')));
                }
            } else {
                $this->layer_msg('');
            }
        } else {
            $this->layer_msg('');
        }
    }
    /**
     * 第三方登录后,绑定已有账号,登录验证并绑定
     */
    function baloginsave_action(){
        $userinfoM    =  $this->MODEL('userinfo');
        if ($_POST['provider'] == 'weixin'){
            if(!empty($_COOKIE['wxloginid'])){
                $weixinM  =  $this->MODEL('weixin');
                $wxqrcode  =  $weixinM->getWxQrcode(array('wxloginid' => $_COOKIE['wxloginid'], 'status' => 1));
                if($wxqrcode['wxid'] || $wxqrcode['unionid']){
                    $lData['openid']    =    $wxqrcode['wxid'];
                    $lData['unionid']    =    $wxqrcode['unionid'];
                    $lData['username']    =    $_POST['username'];
                    $lData['uid']        =    $this->uid;
                    $lData['usertype']    =    $this->usertype;
                    $lData['source']    =    1;
                    $lData['password']    =    $_POST['password'];
                    $lData['authcode']    =    $_POST['authcode'];
                    $return        =  $userinfoM->bindacount($lData,'weixin');
                }
            }else{
                $return['msg']        =    '微信登录信息已失效,请重新登录!';
            }
        }else if($_POST['provider'] == 'qq'){
            session_start();
            if($_SESSION['qq']['openid']){
                $lData  =  array(
                    'openid'       =>  $_SESSION['qq']['openid'],
                    'unionid'      =>  $_SESSION['qq']['unionid'],
                    'authcode'     =>  $_POST['authcode'],
                    'username'     =>  $_POST['username'],
                    'password'     =>  $_POST['password'],
                    'source'    =>  1,
                    'uid'        =>    $this->uid,
                    'usertype'    =>    $this->usertype
                );
                $return        =  $userinfoM->bindacount($lData,'qq');
            }else{
                $return['msg']        =    'qq登录信息已失效,请重新登录!';
            }
        }else if ($_POST['provider'] == 'sinaweibo'){
            session_start();
            if($_SESSION['sina']['openid']){
                $lData  =  array(
                    'openid'       =>  $_SESSION['sina']['openid'],
                    'authcode'     =>  $_POST['authcode'],
                    'username'     =>  $_POST['username'],
                    'password'     =>  $_POST['password'],
                    'source'    =>  1,
                    'uid'        =>    $this->uid,
                    'usertype'    =>    $this->usertype
                );
                $return        =  $userinfoM->bindacount($lData,'sinaweibo');
            }else{
                $return['msg']        =    '新浪微博登录信息已失效,请重新登录!';
            }
        }
        if($return['errcode']==2){
            $this->layer_msg($return['msg'],9,0,Url('register',array('c'=>'ident')),2,1);
        }else if($return['url']){
            $this->layer_msg($return['msg'],9,0,$return['url'],2,1);
        }else{
            $this->layer_msg($return['msg']);
        }
    }
    function balogin_action(){
        if ($_POST['provider'] == 'weixin'){
            if($_COOKIE['wxloginid']){
                $weixinM  =  $this->MODEL('weixin');
                $qrcode   =  $weixinM->getWxQrcode(array('wxloginid' => $_COOKIE['wxloginid'], 'status' => 1));
                $wdata  =  array(
                    'openid'   =>  $qrcode['wxid'],
                    'unionid'  =>  $qrcode['unionid'],
                    'source'   =>  9
                );
                $userinfoM  =  $this->MODEL('userinfo');
                $result     =  $userinfoM->fastReg($wdata, '', 'weixin');
                if ($result['errcode'] == 9){
                    $this->layer_msg('创建成功',9,0, Url('register',array('c'=>'ident')));
                }else{
                    $this->layer_msg('账号注册失败',8,0);
                }
            }else{
                $this->layer_msg('请扫描微信二维码',9,0, Url('wxconnect'));
            }
        }else if($_POST['provider'] == 'qq'){
            session_start();
            if($_SESSION['qq']['openid']){
                // 未设置实名注册,QQ未绑定账号的,直接注册账号
                $wdata  =  array(
                    'openid'   =>  $_SESSION['qq']['openid'],
                    'unionid'  =>  $_SESSION['qq']['unionid'],
                    'source'   =>  8
                );
                $userinfoM  =  $this->MODEL('userinfo');
                $result     =  $userinfoM->fastReg($wdata, '', 'qq');
                if ($result['errcode'] == 9){
                    $this->layer_msg('创建成功',9,0, Url('register',array('c'=>'ident')));
                }else{
                    $this->layer_msg('账号注册失败',8,0);
                }
            }else{
                $this->layer_msg('qq登录信息已失效,请重新登录!',8,0);
            }
        }else if($_POST['provider'] == 'sinaweibo'){
            session_start();
            if($_SESSION['sina']['openid']){
                // 未设置实名注册,微博未绑定账号的,直接注册账号
                $wdata  =  array(
                    'openid'   =>  $_SESSION['sina']['openid'],
                    'source'   =>  10
                );
                $userinfoM  =  $this->MODEL('userinfo');
                $result     =  $userinfoM->fastReg($wdata, '', 'sinaweibo');
                if ($result['errcode'] == 9){
                    $this->layer_msg('创建成功',9,0, Url('register',array('c'=>'ident')));
                }else{
                    $this->layer_msg('账号注册失败',8,0);
                }
            }else{
                $this->layer_msg('新浪微博登录信息已失效,请重新登录!',8,0);
            }
        }
    }
    /**
     * 微信扫码后,后台设置实名验证,需绑定手机号后再自动注册账号
     */
    function fastregsave_action(){
        if ($_POST['provider'] == 'weixin'){
            if(!empty($_COOKIE['wxloginid'])){
                $weixinM  =  $this->MODEL('weixin');
                $wxqrcode  =  $weixinM->getWxQrcode(array('wxloginid' => $_COOKIE['wxloginid'], 'status' => 1));
                if($wxqrcode['wxid'] || $wxqrcode['unionid']){
                    $data  =  array(
                        'openid'       =>  $wxqrcode['wxid'],
                        'unionid'      =>  $wxqrcode['unionid'],
                        'source'       =>  9,
                        'moblie'       =>  $_POST['moblie'],
                        'moblie_code'  =>  $_POST['moblie_code'],
                        'code'         =>  $_POST['authcode'],
                        'port'         =>  1
                    );
                    $userinfoM    =  $this->MODEL('userinfo');
                    $return        =  $userinfoM->fastReg($data, '', 'weixin');
                }
            }else{
                $return['msg']        =    '微信登录信息已失效,请重新登录!';
            }
        }
        if ($_POST['provider'] == 'qq'){
            session_start();
            if($_SESSION['qq']['openid']){
                $data  =  array(
                    'openid'       =>  $_SESSION['qq']['openid'],
                    'unionid'      =>  $_SESSION['qq']['unionid'],
                    'source'       =>  8,
                    'moblie'       =>  $_POST['moblie'],
                    'moblie_code'  =>  $_POST['moblie_code'],
                    'code'         =>  $_POST['authcode'],
                    'port'         =>  1
                );
                $userinfoM    =  $this->MODEL('userinfo');
                $return        =  $userinfoM->fastReg($data, '', 'qq');
            }else{
                $return['msg']        =    'QQ登录信息已失效,请重新登录!';
            }
        }
        if ($_POST['provider'] == 'sinaweibo'){
            session_start();
            if($_SESSION['sina']['openid']){
                $data  =  array(
                    'openid'       =>  $_SESSION['sina']['openid'],
                    'source'       =>  10,
                    'moblie'       =>  $_POST['moblie'],
                    'moblie_code'  =>  $_POST['moblie_code'],
                    'code'         =>  $_POST['authcode'],
                    'port'         =>  1
                );
                $userinfoM    =  $this->MODEL('userinfo');
                $return        =  $userinfoM->fastReg($data, '', 'sinaweibo');
            }else{
                $return['msg']        =    '新浪微博登录信息已失效,请重新登录!';
            }
        }
        if($return['errcode']==9){
            $arr['status']    =    9;
            $arr['msg']        =    $return['msg'];
            $arr['url']        =    Url('register',array('c' => 'ident'));
        }else{
            $arr['msg']        =    $return['msg'];
            $arr['status']    =    8;
    /**
     * 第三方登录后,绑定已有账号,登录验证并绑定
     */
    function baloginsave_action() {
        $userinfoM = $this->MODEL('userinfo');
        if ($_POST['provider'] == 'weixin') {
            if (!empty($_COOKIE['wxloginid'])) {
                $weixinM = $this->MODEL('weixin');
                $wxqrcode = $weixinM->getWxQrcode(array('wxloginid' => $_COOKIE['wxloginid'], 'status' => 1));
                if ($wxqrcode['wxid'] || $wxqrcode['unionid']) {
                    $lData['openid'] = $wxqrcode['wxid'];
                    $lData['unionid'] = $wxqrcode['unionid'];
                    $lData['username'] = $_POST['username'];
                    $lData['uid'] = $this->uid;
                    $lData['usertype'] = $this->usertype;
                    $lData['source'] = 1;
                    $lData['password'] = $_POST['password'];
                    $lData['authcode'] = $_POST['authcode'];
                    $return = $userinfoM->bindacount($lData, 'weixin');
                }
            } else {
                $return['msg'] = '微信登录信息已失效,请重新登录!';
            }
        } else if ($_POST['provider'] == 'qq') {
            session_start();
            if ($_SESSION['qq']['openid']) {
                $lData = array(
                    'openid'   => $_SESSION['qq']['openid'],
                    'unionid'  => $_SESSION['qq']['unionid'],
                    'authcode' => $_POST['authcode'],
                    'username' => $_POST['username'],
                    'password' => $_POST['password'],
                    'source'   => 1,
                    'uid'      => $this->uid,
                    'usertype' => $this->usertype
                );
                $return = $userinfoM->bindacount($lData, 'qq');
            } else {
                $return['msg'] = 'qq登录信息已失效,请重新登录!';
            }
        } else if ($_POST['provider'] == 'sinaweibo') {
            session_start();
            if ($_SESSION['sina']['openid']) {
                $lData = array(
                    'openid'   => $_SESSION['sina']['openid'],
                    'authcode' => $_POST['authcode'],
                    'username' => $_POST['username'],
                    'password' => $_POST['password'],
                    'source'   => 1,
                    'uid'      => $this->uid,
                    'usertype' => $this->usertype
                );
                $return = $userinfoM->bindacount($lData, 'sinaweibo');
            } else {
                $return['msg'] = '新浪微博登录信息已失效,请重新登录!';
            }
        }
        echo json_encode($arr);die;
    }
        if ($return['errcode'] == 2) {
            $this->layer_msg($return['msg'], 9, 0, Url('register', array('c' => 'ident')), 2, 1);
        } else if ($return['url']) {
            $this->layer_msg($return['msg'], 9, 0, $return['url'], 2, 1);
        } else {
            $this->layer_msg($return['msg']);
        }
    }
    function balogin_action() {
        if ($_POST['provider'] == 'weixin') {
            if ($_COOKIE['wxloginid']) {
                $weixinM = $this->MODEL('weixin');
                $qrcode = $weixinM->getWxQrcode(array('wxloginid' => $_COOKIE['wxloginid'], 'status' => 1));
                $wdata = array(
                    'openid'  => $qrcode['wxid'],
                    'unionid' => $qrcode['unionid'],
                    'source'  => 9
                );
                $userinfoM = $this->MODEL('userinfo');
                $result = $userinfoM->fastReg($wdata, '', 'weixin');
                if ($result['errcode'] == 9) {
                    $this->layer_msg('创建成功', 9, 0, Url('register', array('c' => 'ident')));
                } else {
                    $this->layer_msg('账号注册失败', 8, 0);
                }
            } else {
                $this->layer_msg('请扫描微信二维码', 9, 0, Url('wxconnect'));
            }
        } else if ($_POST['provider'] == 'qq') {
            session_start();
            if ($_SESSION['qq']['openid']) {
                // 未设置实名注册,QQ未绑定账号的,直接注册账号
                $wdata = array(
                    'openid'  => $_SESSION['qq']['openid'],
                    'unionid' => $_SESSION['qq']['unionid'],
                    'source'  => 8
                );
                $userinfoM = $this->MODEL('userinfo');
                $result = $userinfoM->fastReg($wdata, '', 'qq');
                if ($result['errcode'] == 9) {
                    $this->layer_msg('创建成功', 9, 0, Url('register', array('c' => 'ident')));
                } else {
                    $this->layer_msg('账号注册失败', 8, 0);
                }
            } else {
                $this->layer_msg('qq登录信息已失效,请重新登录!', 8, 0);
            }
        } else if ($_POST['provider'] == 'sinaweibo') {
            session_start();
            if ($_SESSION['sina']['openid']) {
                // 未设置实名注册,微博未绑定账号的,直接注册账号
                $wdata = array(
                    'openid' => $_SESSION['sina']['openid'],
                    'source' => 10
                );
                $userinfoM = $this->MODEL('userinfo');
                $result = $userinfoM->fastReg($wdata, '', 'sinaweibo');
                if ($result['errcode'] == 9) {
                    $this->layer_msg('创建成功', 9, 0, Url('register', array('c' => 'ident')));
                } else {
                    $this->layer_msg('账号注册失败', 8, 0);
                }
            } else {
                $this->layer_msg('新浪微博登录信息已失效,请重新登录!', 8, 0);
            }
        }
    }
    /**
     * 微信扫码后,后台设置实名验证,需绑定手机号后再自动注册账号
     */
    function fastregsave_action() {
        if ($_POST['provider'] == 'weixin') {
            if (!empty($_COOKIE['wxloginid'])) {
                $weixinM = $this->MODEL('weixin');
                $wxqrcode = $weixinM->getWxQrcode(array('wxloginid' => $_COOKIE['wxloginid'], 'status' => 1));
                if ($wxqrcode['wxid'] || $wxqrcode['unionid']) {
                    $data = array(
                        'openid'      => $wxqrcode['wxid'],
                        'unionid'     => $wxqrcode['unionid'],
                        'source'      => 9,
                        'moblie'      => $_POST['moblie'],
                        'moblie_code' => $_POST['moblie_code'],
                        'code'        => $_POST['authcode'],
                        'port'        => 1
                    );
                    $userinfoM = $this->MODEL('userinfo');
                    $return = $userinfoM->fastReg($data, '', 'weixin');
                }
            } else {
                $return['msg'] = '微信登录信息已失效,请重新登录!';
            }
        }
        if ($_POST['provider'] == 'qq') {
            session_start();
            if ($_SESSION['qq']['openid']) {
                $data = array(
                    'openid'      => $_SESSION['qq']['openid'],
                    'unionid'     => $_SESSION['qq']['unionid'],
                    'source'      => 8,
                    'moblie'      => $_POST['moblie'],
                    'moblie_code' => $_POST['moblie_code'],
                    'code'        => $_POST['authcode'],
                    'port'        => 1
                );
                $userinfoM = $this->MODEL('userinfo');
                $return = $userinfoM->fastReg($data, '', 'qq');
            } else {
                $return['msg'] = 'QQ登录信息已失效,请重新登录!';
            }
        }
        if ($_POST['provider'] == 'sinaweibo') {
            session_start();
            if ($_SESSION['sina']['openid']) {
                $data = array(
                    'openid'      => $_SESSION['sina']['openid'],
                    'source'      => 10,
                    'moblie'      => $_POST['moblie'],
                    'moblie_code' => $_POST['moblie_code'],
                    'code'        => $_POST['authcode'],
                    'port'        => 1
                );
                $userinfoM = $this->MODEL('userinfo');
                $return = $userinfoM->fastReg($data, '', 'sinaweibo');
            } else {
                $return['msg'] = '新浪微博登录信息已失效,请重新登录!';
            }
        }
        if ($return['errcode'] == 9) {
            $arr['status'] = 9;
            $arr['msg'] = $return['msg'];
            $arr['url'] = Url('register', array('c' => 'ident'));
        } else {
            $arr['msg'] = $return['msg'];
            $arr['status'] = 8;
        }
        echo json_encode($arr);
        die;
    }
}
app/include/public.function.php
@@ -16,6 +16,11 @@
    }
}
/**
 * @desc 检测用户名格式
 * @param $str
 * @return bool
 */
function CheckRegUser($str) {
    if (!preg_match("/^[\x{4e00}-\x{9fa5}A-Za-z0-9\-@#.\$_!]+$/u", $str)) {
        return FALSE;
@@ -24,6 +29,11 @@
    }
}
/**
 * 检测电话号码
 * @param $str
 * @return bool
 */
function CheckTell($str) {
    if (preg_match("/^[0-9-]+?$/", $str) == 0) {
        return FALSE;
app/model/notice.model.php
@@ -199,7 +199,7 @@
    /**
     * @desc 根据业务类型,判断后台设置是否开启该类型email提醒,选择设定好的email模板,发送指定类型的邮件
     *
     * @param string $data ['type'] 发送email的类型:
     * @param array $data ['type'] 发送email的类型:
     *            reg注册,yqms邀请面试,fkcg付款成功,zzshtg职位审核成功,sqzw申请职位,getpass找回密码,yqmshf回复面试邀请,login登录验证
     *            'birthday',
     *            'webbirthday',
@@ -234,6 +234,12 @@
        return $this->sendEmail($data);
    }
    
    /**
     * @desc 发送短信
     * @param $type
     * @param $data
     * @return bool|string
     */
    private function postSMS($type = "msgsend", $data = '') {
        $sing = $this->config['sy_msg_appsing'];
        $data['content'] = str_replace(array(" ", " ", "\t", "\n", "\r"), array("", "", "", "", ""), $data['content']);
@@ -253,6 +259,11 @@
        return $file_contents;
    }
    
    /**
     * 检测手机号
     * @param $phone
     * @return mixed
     */
    private function checkPhone($phone) {
        
        
@@ -287,7 +298,7 @@
        }
        
        $data['mobile'] = $data['moblie'] ? $data['moblie'] : $data['mobile'];
        if ($this->_isKey('mobile', $data) == false || CheckMobile($data['mobile']) == false) {
        if (!$this->_isKey('mobile', $data) || !CheckMobile($data['mobile'])) {
            return array('status' => -1, 'msg' => '手机号错误');
        }
        if ($this->config['sy_web_mobile'] != '') {
@@ -297,7 +308,7 @@
            }
        }
        
        if ($this->_isKey('content', $data) == false || $data['content'] == '') {
        if (!$this->_isKey('content', $data) || $data['content'] == '') {
            return array('status' => -1, 'msg' => '短信内容为空');
        }
        
@@ -395,7 +406,7 @@
    }
    
    /**
     *
     * 发送短信
     * @param array $data 传入参数
     * @param string $content 短信内容
     * @return number[]|string[]
@@ -519,19 +530,15 @@
     * @return array|number[]|string[]
     */
    public function sendCode($sended, $type, $port = '', $user = array(), $length = 6, $validity = 120, $kind = 'msg') {
        $time = time();
        $overtime = $time - $validity;
        $today = strtotime('today');
        $ip = fun_ip_get();
        $code = gt_Generate_code($length); //验证码
        $lastSend = [];
        if ($kind == 'msg') {
            ///// 短信 /////
            if (!checkMsgOpen($this->config)) {
                return array('error' => 107, 'msg' => '网站没有配置短信,请联系管理员!');
            }
            
            $ip = fun_ip_get();
@@ -539,69 +546,48 @@
            $ipnum = $this->select_num('moblie_msg', array('ip' => $ip, 'ctime' => array('>', strtotime(date('Y-m-d')))));
            
            if ($ipnum >= $this->config['ip_msgnum']) {
                return array('error' => 107, 'msg' => '当前IP短信发送受限!');
            }
            
            $num = $this->select_num('moblie_msg', array('moblie' => $sended, 'ctime' => array('>', strtotime(date('Y-m-d')))));
            
            if ($num >= $this->config['moblie_msgnum']) {
                return array('error' => 107, 'msg' => '请不要频繁发送!');
            }
            
            if (CheckMobile($sended) == false) {
            if (!CheckMobile($sended)) {
                return array('error' => 106, 'msg' => '手机号码格式错误');
            }
            
            if ($type == 'getpass') {
                ///// 找回密码的情况 /////
                $member = $this->select_once('member', array('moblie' => $sended), '`uid`,`username` as `name`, `usertype`');
                if (!empty($member)) {
                    $user = array(
                        'uid'      => $member['uid'],
                        'usertype' => $member['usertype'],
                        'name'     => $member['name']
                    );
                } else {
                    return array('error' => 105, 'msg' => '该手机尚未注册');
                }
                ///// 获取企业认证信息  /////
                $lastSend = $this->select_once('company_cert', array('check' => $sended, 'type' => 7, 'orderby' => 'id,desc'), '`ctime`,`type`');
            } else {
                $lastSend = $this->select_once('company_cert', array('check' => $sended, 'type' => 2, 'orderby' => 'id,desc'), '`ctime`,`type`');
            }
            if ($lastSend['ctime'] > $overtime) {
                return array('error' => 102, 'msg' => '两次发送间隔需超过' . $validity . '秒');
            }
            if ($type == 'cert') {
                $certover = $time - ($this->config['cert_msgtime'] * 60);
                if ($lastSend['ctime'] > $certover) {
                    return array('error' => 102, 'msg' => '手机认证短信发送间隔需超过' . $this->config['cert_msgtime'] . '分钟');
                }
            }
            $sendToday = $this->select_all('moblie_msg', array('moblie' => $sended, 'ctime' => array('>', $today)), '`ip`');
            if (count($sendToday) >= $this->config['moblie_msgnum']) {
                return array('error' => 103, 'msg' => '同一手机号一天最多发送' . $this->config['moblie_msgnum'] . '条');
            }
            
            $ipSendNum = 0;
@@ -612,14 +598,12 @@
                }
            }
            if ($ipSendNum >= $this->config['ip_msgnum']) {
                return array('error' => 104, 'msg' => '同一IP一天最多发送' . $this->config['ip_msgnum'] . '条');
            }
            $result = $this->sendType($sended, $type, $code, 'msg', $user, $port);
            
        } elseif ($kind == 'email') {
            if (CheckRegEmail($sended) == false) {
            if (!CheckRegEmail($sended)) {
                
                return array('error' => 101, 'msg' => '邮箱格式错误');
            }
@@ -669,8 +653,6 @@
        }
        
        if ($result['status'] != -1) {
            $sendData = array(
                'uid'        => intval($user['uid']),
                'status'     => 0,
@@ -689,29 +671,30 @@
            }
            //只修改短信验证码相关的验证
            if ($lastSend && ($lastSend['type'] == 2 || $lastSend['type'] == 7)) {
                if ($lastSend['type'] == 2) {
                    $this->update_once('company_cert', $sendData, array('check' => $sended, 'type' => 2));
                } elseif ($lastSend['type'] == 7) {
                    $this->update_once('company_cert', $sendData, array('check' => $sended, 'type' => 7));
                }
            } else {
                $this->insert_into('company_cert', $sendData);
            }
        }
        return array('error' => $result['status'], 'msg' => $result['msg']);
    }
    
    //按类别发送验证码
    /**
     * 按类别发送验证码
     * @param $sended // 发送对象
     * @param $type // 验证码类别
     * @param $code // 验证码
     * @param $kind //  发送类别
     * @param $user // 用户信息
     * @param $port // 端口
     * @return array|mixed|number[]|string[]
     */
    private function sendType($sended, $type, $code, $kind = 'msg', $user = array(), $port = null) {
        $finfo = $this->forsend($user);       //用户信息
        $data = array(
            'uid'      => $finfo['uid'],
            'username' => $finfo['name'],
@@ -720,23 +703,23 @@
            'type'     => $type,
            'code'     => $code
        );
        $result = [];
        if ($kind == 'msg') {
            $data['moblie'] = $sended;
            $data['port'] = $port;
            $result = $this->sendSMSType($data);
        } elseif ($kind == 'email') {
            $data['email'] = $sended;
            $result = $this->sendEmailType($data);
        }
        return $result;
    }
    
    //手机验证码类型
    /**
     * 手机验证码类型
     * @param $type
     * @return string
     */
    private function codeType($type) {
        $status = array(
            'login'   => '手机登录验证码',
@@ -744,9 +727,14 @@
            'cert'    => '手机认证',
            'getpass' => '找回密码'
        );
        return $status[$type] ?: '';
    }
    
    //查询接收短信、邮件用户信息
    /**
     * 查询接收短信、邮件用户信息
     * @param $user
     * @return array|mixed|string
     */
    private function forsend($user) {
        $info = array(
            'uid'   => 0,
@@ -755,16 +743,11 @@
            'cname' => '系统'
        );
        if (!empty($user['uid'])) {
            if (!empty($user['name'])) {
                $info['uid'] = $user['uid'];
                $info['name'] = $user['name'];
            } else {
                $info = $this->select_once('member', array('uid' => $user['uid']), '`uid`, `username` as `name`');
            }
        }
        return $info;
@@ -809,7 +792,116 @@
        }
    }
    
    /**
     * 签名-腾讯云
     * @param $key
     * @param $msg
     * @return string
     */
    function sign($key, $msg) {
        return hash_hmac("sha256", $msg, $key, true);
    }
    /**
     * 发送短信接口-腾讯云
     * @param $params
     * @return array
     */
    public function sendSmsHttpRequest($params = []) {
        // 实例化一个认证对象,入参需要传入腾讯云账户 SecretId 和 SecretKey,此处还需注意密钥对的保密
        // 代码泄露可能会导致 SecretId 和 SecretKey 泄露,并威胁账号下所有资源的安全性。以下代码示例仅供参考,建议采用更安全的方式来使用密钥,请参见:https://cloud.tencent.com/document/product/1278/85305
        // 密钥可前往官网控制台 https://console.cloud.tencent.com/cam/capi 进行获取
        try {
            $secret_id = "SecretId";
            $secret_key = "SecretKey";
            $token = "";
            $service = "sms";
            $host = "sms.tencentcloudapi.com";
            $req_region = "ap-guangzhou";
            $version = "2021-01-11";
            $action = "SendSms";
//            $params = [
//                'PhoneNumberSet' => '18019261992',
//                'SmsSdkAppId'    => '2343224242',
//                'TemplateId'     => '54645454'
//            ];
            $payload = json_encode($params);
            $endpoint = "https://sms.tencentcloudapi.com";
            $algorithm = "TC3-HMAC-SHA256";
            $timestamp = time();
            $date = gmdate("Y-m-d", $timestamp);
            // ************* 步骤 1:拼接规范请求串 *************
            $http_request_method = "POST";
            $canonical_uri = "/";
            $canonical_querystring = "";
            $ct = "application/json; charset=utf-8";
            $canonical_headers = "content-type:" . $ct . "\nhost:" . $host . "\nx-tc-action:" . strtolower($action) . "\n";
            $signed_headers = "content-type;host;x-tc-action";
            $hashed_request_payload = hash("sha256", $payload);
            $canonical_request = "$http_request_method\n$canonical_uri\n$canonical_querystring\n$canonical_headers\n$signed_headers\n$hashed_request_payload";
            // ************* 步骤 2:拼接待签名字符串 *************
            $credential_scope = "$date/$service/tc3_request";
            $hashed_canonical_request = hash("sha256", $canonical_request);
            $string_to_sign = "$algorithm\n$timestamp\n$credential_scope\n$hashed_canonical_request";
            // ************* 步骤 3:计算签名 *************
            $secret_date = sign("TC3" . $secret_key, $date);
            $secret_service = sign($secret_date, $service);
            $secret_signing = sign($secret_service, "tc3_request");
            $signature = hash_hmac("sha256", $string_to_sign, $secret_signing);
            // ************* 步骤 4:拼接 Authorization *************
            $authorization = "$algorithm Credential=$secret_id/$credential_scope, SignedHeaders=$signed_headers, Signature=$signature";
            // ************* 步骤 5:构造并发起请求 *************
            $headers = [
                "Authorization"  => $authorization,
                "Content-Type"   => "application/json; charset=utf-8",
                "Host"           => $host,
                "X-TC-Action"    => $action,
                "X-TC-Timestamp" => $timestamp,
                "X-TC-Version"   => $version
            ];
            if ($req_region) {
                $headers["X-TC-Region"] = $req_region;
            }
            if ($token) {
                $headers["X-TC-Token"] = $token;
            }
            $ch = curl_init();
            curl_setopt($ch, CURLOPT_URL, $endpoint);
            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
            curl_setopt($ch, CURLOPT_HTTPHEADER, array_map(function ($k, $v) {
                return "$k: $v";
            }, array_keys($headers), $headers));
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            $response = curl_exec($ch);
            curl_close($ch);
            $result = json_decode($response, TRUE);
            if (!$result['Response']['RequestId']) {
                throw new Exception("请求失败", 10000);
            }
            $result_result = [
                'code' => 1,
                'msg'  => 'ok',
                'data' => $result['Response']
            ];
        } catch (Exception $exc) {
            $result_result = [
                'code' => $exc->getCode(),
                'msg'  => $exc->getMessage()
            ];
        }
        return $result_result;
    }
    
}
?>
app/template/admin/admin_member.htm
@@ -12,6 +12,11 @@
        <script src="{yun:}$config.sy_weburl{/yun}/js/layui/layui.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
        <script src="{yun:}$config.sy_weburl{/yun}/js/layui/custom_layer.js?v={yun:}$config.cachecode{/yun}"></script>
        <title>后台管理</title>
        <style>
            .layui-input-block{
            margin-left: 0;
        }
    </style>
    </head>
    <body class="body_ifm">
@@ -376,7 +381,7 @@
                        title :'转换身份',
                        closeBtn : [0 , true],
                        border : [10 , 0.3 , '#000', true],
                        area : ['550px','300px'],
                        area : ['550px','350px'],
                        page : {dom :"#status_usertype"}
                      });
  
app/template/admin/admin_member_userlist.htm
@@ -12,6 +12,11 @@
    <script src="{yun:}$config.sy_weburl{/yun}/js/layui/layui.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
    <script src="{yun:}$config.sy_weburl{/yun}/js/layui/custom_layer.js?v={yun:}$config.cachecode{/yun}"></script>
    <title>后台管理</title>
    <style>
        .layui-input-block{
            margin-left: 0;
        }
    </style>
</head>
<body class="body_ifm">
app/template/admin/admin_msg_config.htm
@@ -1,93 +1,101 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<link href="images/reset.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
<link href="images/system.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
<link href="images/table_form.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
<script src="{yun:}$config.sy_weburl{/yun}/js/jquery-1.8.0.min.js?v={yun:}$config.cachecode{/yun}"></script>
<script src="js/admin_public.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
<link href="{yun:}$config.sy_weburl{/yun}/js/layui/css/layui.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet">
<script src="{yun:}$config.sy_weburl{/yun}/js/layui/layui.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
<script src="{yun:}$config.sy_weburl{/yun}/js/layui/custom_layer.js?v={yun:}$config.cachecode{/yun}"></script>
<title>后台管理</title>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Cache-Control" content="no-cache" />
    <meta http-equiv="Expires" content="0" />
    <link href="images/reset.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
    <link href="images/system.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
    <link href="images/table_form.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
    <script src="{yun:}$config.sy_weburl{/yun}/js/jquery-1.8.0.min.js?v={yun:}$config.cachecode{/yun}"></script>
    <script src="js/admin_public.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
    <link href="{yun:}$config.sy_weburl{/yun}/js/layui/css/layui.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet">
    <script src="{yun:}$config.sy_weburl{/yun}/js/layui/layui.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
    <script src="{yun:}$config.sy_weburl{/yun}/js/layui/custom_layer.js?v={yun:}$config.cachecode{/yun}"></script>
    <title>后台管理</title>
    <style>
        .table_form .layui-input-block{
            margin-left: 0;
        }
    </style>
</head>
<body class="body_ifm">
<div class="infoboxp">
<div class="tty-tishi_top">
<div class="admin_new_tip">
<a href="javascript:;" class="admin_new_tip_close"></a>
<a href="javascript:;" class="admin_new_tip_open" style="display:none;"></a>
<div class="admin_new_tit"><i class="admin_new_tit_icon"></i>操作提示</div>
<div class="admin_new_tip_list_cont">
<div class="admin_new_tip_list">请先注册帐户 短信内容支持长短信,最多500个字,65个字按一条短信计费。</div>
</div>
</div>
<div class="clear"></div>
<div class="tag_box">
 <div>
    <form action="" method="post" class="layui-form">
    <table width="100%" class="table_form" >
        <tr class="admin_table_trbg">
            <th width="220">是否开启:</th>
            <td>
              <div class="layui-input-block">
                 <div class="layui-input-inline">
                   <input id="sy_msg_isopen_1" type="radio" {yun:}if $config.sy_msg_isopen=='1'{/yun}checked=""{yun:}/if{/yun} value="1" name="sy_msg_isopen" title="开启" >
                   <input id="sy_msg_isopen_2" type="radio" {yun:}if $config.sy_msg_isopen!='1'{/yun}checked=""{yun:}/if{/yun} value="2" name="sy_msg_isopen" title="关闭" >
                 </div>
               </div>
            </td>
        </tr>
         <tr>
            <th width="220">短信宝账号:</th>
            <td><input class="tty_input t_w250" type="text" name="sy_msg_appkey" id="sy_msg_appkey" value="{yun:}$config.sy_msg_appkey{/yun}" size="30"/>
        </tr>
        <tr class="admin_table_trbg">
            <th width="220">短信宝密码:</th>
            <td><input class="tty_input t_w250" type="password" name="sy_msg_appsecret" id="sy_msg_appsecret" value="{yun:}$config.sy_msg_appsecret{/yun}" size="50"/>
        </tr>
        <tr>
            <th width="220">短信宝签名:</th>
            <td><input class="tty_input t_w250" type="text" name="sy_msg_appsing" id="sy_msg_appsing" value="{yun:}$config.sy_msg_appsing{/yun}" size="50"/>
        </tr>
         <tr  class="admin_table_trbg">
            <th width="220">单IP每日最大发信:</th>
            <td><input class="tty_input t_w250" type="text" name="ip_msgnum" id="ip_msgnum" value="{yun:}$config.ip_msgnum{/yun}" size="30" />条</td>
        </tr>
        <tr>
            <th width="220">单手机号每日最大发信:</th>
            <td><input class="tty_input t_w250" type="text" name="moblie_msgnum" id="moblie_msgnum" value="{yun:}$config.moblie_msgnum{/yun}" size="30" />条</td>
        </tr>
        <tr>
            <th width="220">单手机号认证类短信发送频率:</th>
            <td><input class="tty_input t_w250" type="text" name="cert_msgtime" id="cert_msgtime" value="{yun:}$config.cert_msgtime{/yun}" size="30"/>分钟</td>
        </tr>
        <tr  class="admin_table_trbg">
            <th width="220" class="t_fr">短信验证码时效:</th>
               <td>
                <div class="layui-input-block">
                    <input class="tty_input t_w250" type="text" name="moblie_codetime" id="moblie_codetime" value="{yun:}$config.moblie_codetime{/yun}" size="30" maxlength="60"/>分钟 <span class="admin_web_tip">验证码类短信有效时长,建议大于两分钟。</span>
                </div>
                </td>
         </tr>
         <tr>
            <th width="220">剩余短信数量:</th>
            <td><input class="tty_input t_w250" type="text" name="rest_msgnum" id="rest_msgnum" value="0" disabled="disabled"/>条</td>
        </tr>
         <tr  class="admin_table_trbg">
            <th width="220">购买短信:</th>
            <td><div class="yun_admin_divh"><a href="http://www.smsbao.com/reg?r=11641" target="_blank" style=" color:#CC3300; text-decoration:underline; "> 短信购买地址</a></div></td>
         </tr>
        <!--
<body class="body_ifm">
    <div class="infoboxp">
        <div class="tty-tishi_top">
            <div class="admin_new_tip">
                <a href="javascript:;" class="admin_new_tip_close"></a>
                <a href="javascript:;" class="admin_new_tip_open" style="display:none;"></a>
                <div class="admin_new_tit"><i class="admin_new_tit_icon"></i>操作提示</div>
                <div class="admin_new_tip_list_cont">
                    <div class="admin_new_tip_list">请先注册帐户 短信内容支持长短信,最多500个字,65个字按一条短信计费。</div>
                </div>
            </div>
            <div class="clear"></div>
            <div class="tag_box">
                <div>
                    <form action="" method="post" class="layui-form">
                        <table width="100%" class="table_form">
                            <tr class="admin_table_trbg">
                                <th width="220">是否开启:</th>
                                <td>
                                    <div class="layui-input-block">
                                        <div class="layui-input-inline">
                                            <input id="sy_msg_isopen_1" type="radio" {yun:}if $config.sy_msg_isopen=='1' {/yun}checked="" {yun:}/if{/yun} value="1" name="sy_msg_isopen" title="开启">
                                            <input id="sy_msg_isopen_2" type="radio" {yun:}if $config.sy_msg_isopen!='1' {/yun}checked="" {yun:}/if{/yun} value="2" name="sy_msg_isopen" title="关闭">
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <th width="220">短信宝账号:</th>
                                <td><input class="tty_input t_w250" type="text" name="sy_msg_appkey" id="sy_msg_appkey" value="{yun:}$config.sy_msg_appkey{/yun}" size="30" />
                            </tr>
                            <tr class="admin_table_trbg">
                                <th width="220">短信宝密码:</th>
                                <td><input class="tty_input t_w250" type="password" name="sy_msg_appsecret" id="sy_msg_appsecret" value="{yun:}$config.sy_msg_appsecret{/yun}" size="50" />
                            </tr>
                            <tr>
                                <th width="220">短信宝签名:</th>
                                <td><input class="tty_input t_w250" type="text" name="sy_msg_appsing" id="sy_msg_appsing" value="{yun:}$config.sy_msg_appsing{/yun}" size="50" />
                            </tr>
                            <tr class="admin_table_trbg">
                                <th width="220">单IP每日最大发信:</th>
                                <td><input class="tty_input t_w250" type="text" name="ip_msgnum" id="ip_msgnum" value="{yun:}$config.ip_msgnum{/yun}" size="30" />条</td>
                            </tr>
                            <tr>
                                <th width="220">单手机号每日最大发信:</th>
                                <td><input class="tty_input t_w250" type="text" name="moblie_msgnum" id="moblie_msgnum" value="{yun:}$config.moblie_msgnum{/yun}" size="30" />条</td>
                            </tr>
                            <tr>
                                <th width="220">单手机号认证类短信发送频率:</th>
                                <td><input class="tty_input t_w250" type="text" name="cert_msgtime" id="cert_msgtime" value="{yun:}$config.cert_msgtime{/yun}" size="30" />分钟</td>
                            </tr>
                            <tr class="admin_table_trbg">
                                <th width="220" class="t_fr">短信验证码时效:</th>
                                <td>
                                    <div class="layui-input-block">
                                        <input class="tty_input t_w250" type="text" name="moblie_codetime" id="moblie_codetime" value="{yun:}$config.moblie_codetime{/yun}" size="30" maxlength="60" />分钟 <span class="admin_web_tip">验证码类短信有效时长,建议大于两分钟。</span>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <th width="220">剩余短信数量:</th>
                                <td><input class="tty_input t_w250" type="text" name="rest_msgnum" id="rest_msgnum" value="0" disabled="disabled" />条</td>
                            </tr>
                            <tr class="admin_table_trbg">
                                <th width="220">购买短信:</th>
                                <td>
                                    <div class="yun_admin_divh"><a href="http://www.smsbao.com/reg?r=11641" target="_blank" style=" color:#CC3300; text-decoration:underline; "> 短信购买地址</a></div>
                                </td>
                            </tr>
                            <!--
        <tr>
             <th colspan="2" class="admin_bold_box">
                 <div class="admin_bold">空号检测</div>
@@ -146,91 +154,92 @@
            <th width="220">购买天眼查:</th>
            <td><div class="yun_admin_divh"><a href="https://u.phpyun.com/" target="_blank" style=" color:#CC3300; text-decoration:underline; "> 购买地址</a></div></td>
         </tr>-->
           <tr>
            <th width="220"></th>
            <td>
                <input class="layui-btn tty_sub" id="config" type="button" name="msgconfig" value="提交" />&nbsp;&nbsp;
                <input class="layui-btn tty_cz" type="reset" value="重置" />
            </td>
        </tr>
    </table>
    <input type="hidden" id="pytoken" name="pytoken" value="{yun:}$pytoken{/yun}">
    </form>
</div>
</div>
</div>
<script>
layui.use(['layer', 'form'], function(){
    var layer = layui.layer
    ,form = layui.form
    ,$ = layui.$;
});
$(function(){
    $("#config").click(function(){
        var msgtime = $("#moblie_codetime").val();
        if(parseInt(msgtime) < 2){
            parent.layer.msg('短信验证时效因大于两分钟!',2,8); return false;
        }else{
            loadlayer();
            $.post("index.php?m=msgconfig&c=save",{
                config : $("#config").val(),
                sy_msg_isopen : $("input[name=sy_msg_isopen]:checked").val(),
                sy_msg_appkey :$("#sy_msg_appkey").val(),
                sy_msg_appsecret : $("#sy_msg_appsecret").val(),
                sy_msg_appsing : $("#sy_msg_appsing").val(),
                            <tr>
                                <th width="220"></th>
                                <td>
                                    <input class="layui-btn tty_sub" id="config" type="button" name="msgconfig" value="提交" />&nbsp;&nbsp;
                                    <input class="layui-btn tty_cz" type="reset" value="重置" />
                                </td>
                            </tr>
                sy_kh_isopen : $("input[name=sy_kh_isopen]:checked").val(),
                sy_kh_appkey :$("#sy_kh_appkey").val(),
                sy_kh_appsecret : $("#sy_kh_appsecret").val(),
                sy_kh_city : $("#sy_kh_city").val(),
                        </table>
                        <input type="hidden" id="pytoken" name="pytoken" value="{yun:}$pytoken{/yun}">
                    </form>
                sy_tyc_appkey :$("#sy_tyc_appkey").val(),
                sy_tyc_appsecret : $("#sy_tyc_appsecret").val(),
                pytoken : $("#pytoken").val(),
                sy_msgsendnum : $("#sy_msgsendnum").val(),
                ip_msgnum : $("#ip_msgnum").val(),
                moblie_msgnum : $("#moblie_msgnum").val(),
                cert_msgtime : $("#cert_msgtime").val(),
                moblie_codetime : $("#moblie_codetime").val(),
                integral_msg_proportion : $("#integral_msg_proportion").val()
            },function(data,textStatus){
                parent.layer.closeAll('loading');
                config_msg(data);
            });
        }
    });
    $.post("index.php?m=msgconfig&c=get_restnums",{pytoken : $("#pytoken").val(),msguser : $("#sy_msguser").val()},function(data){
        data = eval('('+data+')');
        if(data){
            if(data){
                $("#rest_msgnum").val(data);
            }else{
                $("#rest_msgnum").val(0);
            }
            $("#rest_khnum").val(data.khnum);
            $("#rest_businessnum").val(data.businessnum);
        }
    });
                </div>
            </div>
        </div>
        <script>
            layui.use(['layer', 'form'], function () {
                var layer = layui.layer
                    , form = layui.form
                    , $ = layui.$;
            });
            $(function () {
                $("#config").click(function () {
                    var msgtime = $("#moblie_codetime").val();
                    if (parseInt(msgtime) < 2) {
                        parent.layer.msg('短信验证时效因大于两分钟!', 2, 8); return false;
                    } else {
                        loadlayer();
                        $.post("index.php?m=msgconfig&c=save", {
                            config: $("#config").val(),
                            sy_msg_isopen: $("input[name=sy_msg_isopen]:checked").val(),
                            sy_msg_appkey: $("#sy_msg_appkey").val(),
                            sy_msg_appsecret: $("#sy_msg_appsecret").val(),
                            sy_msg_appsing: $("#sy_msg_appsing").val(),
})
</script>
</div>
                            sy_kh_isopen: $("input[name=sy_kh_isopen]:checked").val(),
                            sy_kh_appkey: $("#sy_kh_appkey").val(),
                            sy_kh_appsecret: $("#sy_kh_appsecret").val(),
                            sy_kh_city: $("#sy_kh_city").val(),
                            sy_tyc_appkey: $("#sy_tyc_appkey").val(),
                            sy_tyc_appsecret: $("#sy_tyc_appsecret").val(),
                            pytoken: $("#pytoken").val(),
                            sy_msgsendnum: $("#sy_msgsendnum").val(),
                            ip_msgnum: $("#ip_msgnum").val(),
                            moblie_msgnum: $("#moblie_msgnum").val(),
                            cert_msgtime: $("#cert_msgtime").val(),
                            moblie_codetime: $("#moblie_codetime").val(),
                            integral_msg_proportion: $("#integral_msg_proportion").val()
                        }, function (data, textStatus) {
                            parent.layer.closeAll('loading');
                            config_msg(data);
                        });
                    }
                });
                $.post("index.php?m=msgconfig&c=get_restnums", { pytoken: $("#pytoken").val(), msguser: $("#sy_msguser").val() }, function (data) {
                    data = eval('(' + data + ')');
                    if (data) {
                        if (data) {
                            $("#rest_msgnum").val(data);
                        } else {
                            $("#rest_msgnum").val(0);
                        }
                        $("#rest_khnum").val(data.khnum);
                        $("#rest_businessnum").val(data.businessnum);
                    }
                });
            })
        </script>
    </div>
</body>
</html>
</html>