123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341 |
- @extends('module.layouts.company')
- @push('meta')
- @endpush
- @push('css')
- <link rel="stylesheet" type="text/css" href="{{ theme_asset('app/css/company/common.css') }}"/>
- <link rel="stylesheet" type="text/css" href="{{ theme_asset('app/css/company/company_user.css')}}"/>
- <link rel="stylesheet" type="text/css" href="{{ theme_asset('app/css/company/company_ajax_dialog.css')}}"/>
- <style>.td1 a:hover{cursor: pointer} </style>
- @endpush
- @push('js')
- <script type="text/javascript" src="{{ theme_asset('app/js/company/jquery.common.js') }}"></script>
- <script type="text/javascript" src="{{ theme_asset('gt/gt.js') }}"></script>
- <script type="text/javascript" src="{{ theme_asset('gt/gt.handle.js') }}"></script>
- <script>
- $(function () {
- @if(!empty(session('message')))
- disapperTooltip("remind", "{{ session('message') }}");
- @endif
- });
- </script>
- @endpush
- @section('content')
- <div class="user_main">
- <div class="mleft">
- @include('module.section.company_left')
- </div>
- <div class="mright">
- <div class="user_pagetitle safety_user_pagetitle">
- <div class="pat_l">账号安全</div>
- <div class="clear"></div>
- </div>
- <div class="user_tab">
- <a href="{{ route('com.security') }}" class="tabli select">账号安全</a>
- <a href="{{ route('com.security.loginLog') }}" class="tabli">登录日志</a>
- <div class="clear"></div>
- </div>
- <div class="user_tip w680">
- <div class="tiptit">小提示</div>
- <div class="tiptxt link_blue">
- 手机号、邮箱认证通过后可增强您账号的安全性,也可通过已认证的手机号、邮箱快速登录账号。
- </div>
- </div>
- <div class="safety J_hoverbut link_blue">
- <div class="td1">用户名</div>
- <div id="J_unameWrap" class="td2">{{ $companyInfo->username }}</div>
- <div class="td3"> </div>
- <div class="td4"><a id="J_edit_uname" href="javascript:;">修改</a></div>
- <div class="clear"></div>
- </div>
- <div class="safety J_hoverbut link_blue">
- <div class="td1 t1">密码</div>
- <div class="td2">上次登录时间:<span>{{ date('Y-m-d H:i:s', $companyInfo->last_login_time) }}</span></div>
- <div class="td3"><a href="{{ route('com.security.loginLog') }}">[查看登录日志]</a></div>
- <div class="td4"><a id="J_edit_password" href="javascript:;">修改</a></div>
- <div class="clear"></div>
- </div>
- <div class="safety J_hoverbut link_blue">
- <div class="td1 t2">手机</div>
- <div id="J_mobileWrap" class="td2">{{ $companyInfo->mobile or "手机未填写"}}<span>(认证后可用于登录账号、找回密码)</span></div>
- <div id="J_mobileStatus" class="td3">
- @if(!$companyInfo->mobile_audit)<div class="no"> 未认证</div>@else
- <div class="yes"> 已认证</div>
- @endif
- </div>
- <input type="hidden" id="J_mobile_verify" value="{{ config('aix.system.site_safety.site_vo_code.captcha_open') }}" />
- <div class="td4"><a id="J_auth_mobile" href="javascript:;" data-auth="{{ $companyInfo->mobile_audit }}">@if(!$companyInfo->mobile_audit)立即认证 @else 修改 @endif</a></div>
- <div class="clear"></div>
- </div>
- <div class="safety J_hoverbut link_blue">
- <div class="td1 t3">邮箱</div>
- <div id="J_emailWrap" class="td2">{{ $companyInfo->email or "Email未填写" }}<span>(认证后用于登录账号、找回密码)</span></div>
- <div id="J_emailStatus" class="td3">
- @if(!$companyInfo->email_audit)
- <div class="no">未认证</div>
- @else
- <div class="yes"> 已认证</div>
- @endif
- </div>
- <div class="td4">
- <a id="J_auth_email" href="javascript:;" data-auth="{{ $companyInfo->email_audit }}">@if(!$companyInfo->email_audit) 立即认证 @else 修改 @endif </a>
- </div>
- <div class="clear"></div>
- </div>
- <div class="safety_btit">账号绑定<span>(授权绑定后,可使用第三方账号快速登录)</span></div>
- <div class="safety_binding">
- @if(config('aix.system.oauth.qq.is_open_qq') == 1)
- <div class="td1">
- <div class="qq @if($qq) ok @endif">腾讯QQ</div>
- @if($qq)
- <div class="txt link_blue "><a class="J_unlogin" name="腾讯QQ" url="{{ route('unbindThird',['alias'=>'qq']) }}" href="javascript:;" >解除绑定</a></div>
- @else
- <div class="txt link_blue"><a id="J_bind_qq">立即绑定</a></div>
- @endif
- </div>
- @endif
- @if(config('aix.system.oauth.wechat_open.is_open') == 1)
- <div class="td1">
- <div class="weixin @if($weixin) ok @endif">微信</div>
- @if($weixin)
- <div class="txt link_blue "><a class="J_unlogin" name="微信" url="{{ route('unbindThird',['alias'=>'weixin']) }}" href="javascript:;" >解除绑定</a></div>
- @else
- <div class="txt link_blue"><a id="J_bind_weixin">立即绑定</a></div>
- @endif
- </div>
- @endif
- <div class="clear"></div>
- </div>
- </div>
- <div class="clear"></div>
- </div>
- @endsection
- @section('script')
- <script type="text/javascript" src="{{ theme_asset('app/js/regular.js') }}"></script>
- <script type="text/javascript" src="{{ theme_asset('app/js/jquery.disappear.tooltip.js') }}"></script>
- <script type="text/javascript" src="{{ theme_asset('app/js/jquery.validate.js') }}"></script>
- @include('module.widgets.thirdlogin_bind', ['redirect_url'=>route('com.security'), 'redirect_name'=>"账号安全"])
- <script type="text/javascript">
- $('#J_edit_password').click(function(){
- var qsDialog = $(this).dialog({
- title: '修改密码',
- loading: true,
- showFooter: false,
- yes: function() {
- var options = {};
- options['oldpassword'] = $('#J_passwordWrap').find('input[name="oldpassword"]').val();
- options['password'] = $('#J_passwordWrap').find('input[name="password"]').val();
- options['password1'] = $('#J_passwordWrap').find('input[name="password1"]').val();
- options['_token'] = "{{csrf_token()}}";
- $.ajax({
- method: 'post',
- url: '{{ route('savePwd') }}',
- data: options,
- beforeSend:function () {
- },
- complete:function() {
- },
- success: function (data) {
- disapperTooltip('success',data.data);
- location.reload();
- },
- error: function (errorData) {
- if (errorData.status==422) {//验证错误
- // console.log(errorData.errors);return ;
- $.each(errorData.responseJSON.errors,function (key,val) {
- disapperTooltip("remind", val[0]);
- });
- }
- else if(errorData.status==400) {//业务错误
- disapperTooltip("remind", errorData.responseJSON.message);
- }
- },
- });
- }
- });
- $.get("{{route('modifyPwd')}}",function(result){
- qsDialog.setCloseDialog(false);
- qsDialog.setContent(result);
- qsDialog.showFooter(true);
- });
- });
- var regularUsername = /^(?=[\u4e00-\u9fa5a-zA-Z])(?!\d+)[\u4e00-\u9fa5\w.]{6,20}$/;
- $('#J_edit_uname').click(function(){
- var qsDialog = $(this).dialog({
- title: '修改用户名',
- loading: true,
- showFooter: false,
- yes: function() {
- var username = $.trim($('#J_usernameInput').val());
- if (!username.length) {
- disapperTooltip("remind", '请填写新用户名');
- $('#J_usernameInput').focus();
- return false;
- }
- if (username.length && !regularUsername.test(username)) {
- disapperTooltip("remind", "用户名中英文开头6-20位,无特殊符号");
- $('#J_usernameInput').focus();
- return false;
- }
- $.ajax({
- method: 'post',
- url: '{{ route('saveUsername') }}',
- data: {username:username,_token:"{{csrf_token()}}"},
- beforeSend:function () {
- },
- complete:function() {
- },
- success: function (data) {
- disapperTooltip('success',data.data);
- location.reload();
- },
- error: function (errorData) {
- if (errorData.status==422) {//验证错误
- // console.log(errorData.errors);return ;
- $.each(errorData.responseJSON.errors,function (key,val) {
- disapperTooltip("remind", val[0]);
- });
- }
- else if(errorData.status==400) {//业务错误
- disapperTooltip("remind", errorData.message);
- }
- },
- });
- }
- });
- $.get("{{ route('modifyUsername') }}",function(result){
- // if(result.status == 1){
- qsDialog.setCloseDialog(false);
- qsDialog.setContent(result);
- qsDialog.showFooter(true);
- // }else{
- // qsDialog.setContent('<div class="confirm">' + result.msg + '</div>');
- // }
- });
- });
- $('#J_auth_email').click(function(){
- var f = $(this);
- var auth = $(this).data('auth');
- var title = '认证邮箱';
- if(auth == 1){
- title = '修改已认证邮箱';
- }
- var qsDialog = $(this).dialog({
- title: title,
- loading: true,
- border: false,
- footer: false
- });
- $.get("{{ route('authEmail') }}",function(result){
- if(result.status) {
- qsDialog.hide();
- var qsDialogSon = $(this).dialog({
- title: title,
- border: false,
- content: result.data,
- footer: false
- });
- } else {
- qsDialog.hide();
- disapperTooltip('remind',result.msg);
- }
- });
- });
- $('#J_bind_weixin').click(function(){
- location.href=wechat_bind_url;
- });
- $('#J_bind_qq').click(function(){
- location.href=qq_bind_url;
- });
- $('.J_unlogin').click(function(){
- var url = $(this).attr('url'),
- name = $(this).attr('name'),
- qsDialog=$(this).dialog({
- title: '取消绑定',
- loading: false,
- border: false,
- content : '当前账号已绑定<'+name+'><br/>确定解绑吗?',
- yes: function() {
- $.get(url,function (res) {
- if(res.status) {
- disapperTooltip('success',res.msg);
- } else {
- disapperTooltip('remind',res.msg);
- }
- setTimeout(function () {
- window.location.reload();
- },2000)
- })
- }
- });
- });
- $('#J_auth_mobile').click(function(){
- var f = $(this);
- var auth = f.data('auth');
- var title = '认证手机';
- if(auth == 1){
- title = '修改已认证手机';
- }
- var qsDialog = $(this).dialog({
- title: title,
- loading: true,
- border: false,
- footer: false
- });
- $.get("{{ route('authMobile')}}",function(result){
- qsDialog.hide();
- var qsDialogSon = $(this).dialog({
- title: title,
- border: false,
- content: result,
- yes: function() {
- var mobile = $.trim($('#J_mobileWrap input[name="mobile"]').val());
- if(mobile == ''){
- $('#J_mobileWrap .J_errbox').text('手机号不能不空!').show();
- return false;
- }
- if (mobile != "" && !regularMobile.test(mobile)) {
- $('#J_mobileWrap .J_errbox').text('手机号码格式不正确!').show();
- return false;
- }
- var verifycode = $.trim($('#J_mobileWrap input[name="verifycode"]').val());
- if(!verifycode){
- $('#J_mobileWrap .J_errbox').text('请填写验证码!').show();
- return false;
- }
- var postData = {mobile:mobile,id:"{{auth('web-company')->user()->id}}",verifycode:verifycode,_token:'{{csrf_token()}}'}
- $.post("{{ route('mobile.audit') }}",postData,function(result){
- if(result.status == 1){
- qsDialogSon.hide();
- f.text('修改');
- $('#J_mobileStatus').html('<div class="yes">已认证</div>');
- $('#J_mobileWrap').html(result.data.mobile+'<span>(认证后可使用该手机登录账号、找回密码)</span>');
- if(result.data.points){
- disapperTooltip("goldremind", '验证手机号增加'+result.data.points+'积分<span class="point">+'+result.data.points+'</span>');
- }else{
- disapperTooltip('success',result.msg);
- }
- } else {
- $('#J_mobileWrap .J_errbox').text(result.msg).show();
- }
- },'json');
- }
- });
- qsDialogSon.setCloseDialog(false);
- });
- });
- </script>
- @endsection
|