2021-10-07

苹果CMS V10:js处理会员登录状态

 

 

<div>
    <div class="nologin mac_user">登录</div>
    <div class="logined" style="display:none;">已登录---用户名:[<span class="user-name"></span>],会员组:[<span class="group-name"></span>]</div>
</div>
<script>
    $(function(){
        if(MAC.User.UserId !=''){ //已登录状态
            $('.nologin').hide();
            $('.logined').show();
            $('.user-name').html(MAC.User.UserName); //用户名
            $('.group-name').html(MAC.User.GroupName); //会员组名
        }
        else{

        }
    });
</script>

 

打赏

好文章,更需要你的鼓励

本文由 氢设计 创作,除注明转载/出处外,均为本站原创,转载前请务必署名

最后编辑时间为:2021-11-23 10:21:01

本文链接:https://www.h2sheji.com/show-55.html