using CallCenterApi.Interface.Controllers.Base;
using CallCenterAPI.WechatSDK;
using CallCenterAPI.WechatSDK.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace CallCenterApi.Interface.Controllers.weixin
{
    public class WxLoginController : BaseController
    {
        public ActionResult Login(WxLoginDto wxLoginDto)
        {
            var res = Redirect("获取微信openId", wxLoginDto.RedirectUrl);
            var temp = WxHelper.GetOpenId(wxLoginDto);
            if (string.IsNullOrWhiteSpace(temp.OpenId))
                return res;

            //openId => 用户

            //如果不存在，跳转至登录页面
            res = Redirect("绑定微信号", "");
            return res;
        }
    }
}