@{
    TipsInfo tipsInfo = Model;
    Layout = "~/Areas/Member/Views/_LoginLayoutPage.cshtml";
    ViewBag.Title = "OAuth2.0登录";
}
<div class="login-box"  id="loginbox" v-cloak>
    <a class="login-logo" href="@ViewBag.HomeLink"><img src="/Areas/Member/Css/images/Loginlogo.png"/></a>
            <div class="login-sign">OAuth2.0授权登录</div>
            <div>
                <div class="form-group">
                    <span :style="msgStyle">{{msg}}</span>
                </div>
                <div class="form-group">
                    <div class="text-left">
                        <a href="@Url.ActionUrl("Index","Reg")" class="text-primary">注册用户</a> / <a href="@Url.ActionUrl("Index","Login")" class="text-primary">转到登录</a>
                    </div>
                </div>
            </div>
</div>
<script type="text/javascript">
    //vue实例化
    var vue = new Vue({
        el: "#loginbox",
        data: {
            state: 1,
            msg: "授权成功！"
        },
        computed: {
            msgStyle: function () {
                if (this.state == 0){
                    return { color:"#f56c6c" };
                }
                else{
                    return { color: "#67c23a" };
                }
            }
        },
        methods: {
            autoLogin: function () {
                var openId = request("openId");
                var isVirtual = request("isVirtual");//后台触发模拟登录
                var _this = this;
                vue.submit({
                    url: "@Url.ActionUrl("Auto")",
                    data: { openId: openId,isVirtual: isVirtual},
                    showFailMsg: false,
                    showSuccessMsg: false,
                    success: function (responseData) {
                        var redirectURL = request("redirectURL");
                        if (isNullOrEmpty(redirectURL)) {
                            redirectURL = "@Url.ActionUrl("Index","Default")";
                        }
                        location.href = redirectURL;
                    },
                    failCallback: function (responseData) {
                        _this.state = 0;
                       _this.msg = responseData.Msg;
                    }
                });
            },
        },
    });
    vue.autoLogin();
</script>