<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title>账号安全-纵横公路养护造价</title>
    <link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="/web/building_saas/css/main.css">
    <link rel="stylesheet" href="/lib/font-awesome/font-awesome.min.css">
    <link rel="shortcut icon" href="/web/building_saas/css/favicon.ico">
    <link rel="icon" type="image/gif" href="/web/building_saas/css/animated_favicon1.gif">
</head>

<body>
<div class="header">
    <%include ../../common/html/header.html %>
</div>
<div class="main">
    <div class="poj-manage container-fluid">
        <div class="row">
            <div class="col-lg-2">
                <div class="mt-3">
                    <ul class="nav nav-pills flex-column">
                        <li class="nav-item">
                            <a class="nav-link" href="/user/info">企业资料</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link active" href="/user/safe">账号安全</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="/user/buy">产品激活</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="/user/preferences">登录设置</a>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="col-lg-10 side-content">
                <div class="col-lg-4">
                    <legend class="my-3">账号安全</legend>
                    <from>
                        <div class="form-group">
                            <label class="form-control-label">手机号码（登录账号）</label>
                            <p class="form-control-static mb-0"><%= userData.mobile %> <span class="badge badge-success">已验证</span></p>
                            <a class="btn btn-outline-primary btn-sm" href="https://sso.smartcost.com.cn/changeMobile" target="_blank">更换手机</a>
                        </div>
                        <div class="form-group">
                            <label class="form-control-label">邮箱地址</label>
                            <% if (userData.email !== '') { %>
                            <p class="form-control-static mb-0"><%= userData.email %><% if (userData.isUserActive === 0) { %><span
                                    class="badge badge-default">未验证</span><% } else { %><span
                                    class="badge badge-success">已验证</span><% } %></p>
                            <% if (userData.isUserActive === 0) { %><a class="btn btn-outline-primary btn-sm" target="_blank" href="https://sso.smartcost.com.cn/profile">验证邮箱</a>
                            <a class="btn btn-secondary btn-sm" target="_blank" href="https://sso.smartcost.com.cn/nactchm">更换邮箱</a>
                            <% } else { %>
                            <a class="btn btn-outline-primary btn-sm" href="https://sso.smartcost.com.cn/changeMail" target="_blank">更换邮箱</a>
                            <% } %>
                            <% } else { %>
                            <a class="btn btn-outline-primary btn-sm" href="https://sso.smartcost.com.cn/addMail" target="_blank">添加邮箱</a>
                            <% } %>
                        </div>
                        <div class="form-group">
                            <label class="form-control-label">登录密码</label>
                            <div class="form-control-static">
                                <a class="btn btn-outline-primary btn-sm" href="https://sso.smartcost.com.cn/chpasswd" target="_blank">修改密码</a>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="form-control-label">异常登录提醒</label>
                            <div class="form-control-static">
                                <div class="custom-control custom-checkbox" >
                                    <input type="checkbox" class="custom-control-input" id="isLoginValid" <% if (userData.isLoginValid === 1) { %>checked<% } %>>
                                    <label class="custom-control-label" for="isLoginValid" >开启</label>
                                </div>
                                <p class="text-muted">
                                    账号出现异常登录时将给你的手机号码发送通知。
                                </p>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="form-control-label">关闭账号登录</label>
                            <div class="form-control-static">
                                <div class="custom-control custom-checkbox" >
                                    <input type="checkbox" class="custom-control-input" id="isSmsLogin" <% if (userData.isSmsLogin === 1) { %>checked<% } %>>
                                    <label class="custom-control-label" for="isSmsLogin" >关闭</label>
                                </div>
                                <p class="text-muted">
                                    关闭账号登录后，只能通过短信验证码方式登录。
                                </p>
                            </div>
                        </div>
                    </from>
                </div>
                <div class="mt-5">
                    <legend>访问日志</legend>
                    <table class="table table-hover">
                        <thead>
                        <tr>
                            <th>系统</th>
                            <th>浏览器</th>
                            <th>访问日期</th>
                            <th>地址</th>
                        </tr>
                        </thead>
                        <tbody>
                        <% logList.forEach(function (log){ %>
                        <tr>
                            <td><%= log.message.os %></td>
                            <td><%= log.message.browser %></td>
                            <td><%= moment(log.create_time).format('YYYY-MM-DD HH:mm:ss') %></td>
                            <td><%= log.message.ip_info %>（<%= log.message.ip %>）</td>
                        </tr>
                        <% }) %>
                        </tbody>
                    </table>
                    <%include ../../common/html/page.html %>
                </div>
            </div>
        </div>
    </div>
</div>
<!--弹出异常登录提醒-->
<div class="modal fade" id="phoneTips" data-backdrop="static">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-body">
                <p>开启异常登录提醒，需要先为您的通行账号添加手机号码。</p>
                <p><a class="btn btn-primary btn-sm" href="#">去添加手机</a></p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
</body>
<script src="/web/building_saas/js/global.js"></script>
<script src="/web/users/js/user.js"></script>
<script type="text/javascript">
    autoFlashHeight();
</script>

</html>
