diff --git a/FCL/BLL/Common/HttpHelper.cs b/FCL/BLL/Common/HttpHelper.cs index ce7fd27..15c9871 100644 --- a/FCL/BLL/Common/HttpHelper.cs +++ b/FCL/BLL/Common/HttpHelper.cs @@ -15,12 +15,12 @@ namespace BLL.Common /// /// /// - public static string HttpGetRequest(string url) + public static string HttpGetRequest(string url, string token ="") { string strGetResponse = string.Empty; try { - var getRequest = CreateHttpRequest(url,"GET", ""); + var getRequest = CreateHttpRequest(url,"GET", token); var getResponse = getRequest.GetResponse() as HttpWebResponse; strGetResponse = GetHttpResponse(getResponse, "GET"); } diff --git a/FCL/FineUIPro.Web/Evaluation/EvaluationNew.aspx b/FCL/FineUIPro.Web/Evaluation/EvaluationNew.aspx index c9da7d5..6128036 100644 --- a/FCL/FineUIPro.Web/Evaluation/EvaluationNew.aspx +++ b/FCL/FineUIPro.Web/Evaluation/EvaluationNew.aspx @@ -67,6 +67,9 @@ + + + @@ -182,26 +185,55 @@ //用户评分事件 function renderRateUser(value, row) { var evaltype = row.rowValue["IsEvaluateType"]; - return F.rateHtml(value, { + var html= F.rateHtml(value, { + allowClear:true, readonly: evaltype == 1 ? true : false, allowHalf: true, textVisible: false }); + return html; } F.ready(function () { var grid1 = F(grid1ClientID); + var control1 = '<%=this.hidMaxScore1.ClientID%>'; + var control2 = '<%=this.hidMaxScore2.ClientID%>'; // 注册评分事件 F.rateEvents(grid1.el, function (event, value) { var target = $(event.target); var cellEl = target.closest('.f-grid-cell'); - var rowId = grid1.getRowId(cellEl); var columnId = grid1.getColumnId(cellEl); + var columnName = grid1.getColumn(columnId).columnId; + //获取控件值1() + var maxScore1 = grid1.getItem(control1).value; + //获取控件值2() + var maxScore2 = grid1.getItem(control2).value; - //更新单元格的值 - grid1.updateCellValue(rowId, columnId, value); + if (columnName = "Score1" && value >= parseFloat(maxScore1)) { + F.alert("最大只能评" + maxScore1 + "分"); + var html = F.rateHtml(0, { + allowClear: true, + allowHalf: true, + textVisible: false + }); + grid1.getCellEl(rowId, columnId).html(html) + } + else if (columnName == "Score2" && value >= parseFloat(maxScore2)) { + F.alert("最大只能评" + maxScore2 + "分"); + var html = F.rateHtml(0, { + allowClear: true, + allowHalf: true, + textVisible: false + }); + grid1.getCellEl(rowId, columnId).html(html) + } + else { + //更新单元格的值 + grid1.updateCellValue(rowId, columnId, value); + } }); }); + diff --git a/FCL/FineUIPro.Web/Evaluation/EvaluationNew.aspx.designer.cs b/FCL/FineUIPro.Web/Evaluation/EvaluationNew.aspx.designer.cs index 747268a..8a31f41 100644 --- a/FCL/FineUIPro.Web/Evaluation/EvaluationNew.aspx.designer.cs +++ b/FCL/FineUIPro.Web/Evaluation/EvaluationNew.aspx.designer.cs @@ -203,6 +203,24 @@ namespace FineUIPro.Web.Evaluation /// protected global::FineUIPro.HiddenField hidisDepScore6; + /// + /// hidMaxScore1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hidMaxScore1; + + /// + /// hidMaxScore2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hidMaxScore2; + /// /// lblContractor 控件。 /// diff --git a/FCL/FineUIPro.Web/FineUIPro.Web.csproj b/FCL/FineUIPro.Web/FineUIPro.Web.csproj index ffa1ef7..6dbb83b 100644 --- a/FCL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/FCL/FineUIPro.Web/FineUIPro.Web.csproj @@ -300,7 +300,6 @@ - @@ -313,14 +312,6 @@ - - - - - - - - @@ -358,7 +349,6 @@ - @@ -2568,7 +2558,6 @@ - @@ -2597,17 +2586,6 @@ - - FCLDS.xsd - - - Designer - MSDataSetGenerator - FCLDS.Designer.cs - - - FCLDS.xsd - @@ -3061,55 +3039,6 @@ SafetyEvaluation.aspx - - editCAD.aspx - ASPXCodeBehind - - - editCAD.aspx - - - EditOffice.aspx - ASPXCodeBehind - - - EditOffice.aspx - - - FileManageList.aspx - ASPXCodeBehind - - - FileManageList.aspx - - - Read.aspx - ASPXCodeBehind - - - Read.aspx - - - ReadCad.aspx - ASPXCodeBehind - - - ReadCad.aspx - - - Save.aspx - ASPXCodeBehind - - - Save.aspx - - - SaveCAD.aspx - ASPXCodeBehind - - - SaveCAD.aspx - Global.asax @@ -3153,22 +3082,6 @@ OperationError.aspx - - FCLDS.xsd - - - True - True - FCLDS.xsd - - - ReportPrint.aspx - ASPXCodeBehind - - - ReportPrint.aspx - - index.aspx ASPXCodeBehind @@ -3566,14 +3479,11 @@ Lan.en-US.designer.cs - - - - + diff --git a/FCL/FineUIPro.Web/Global.asax.cs b/FCL/FineUIPro.Web/Global.asax.cs index b217c50..3a06fd9 100644 --- a/FCL/FineUIPro.Web/Global.asax.cs +++ b/FCL/FineUIPro.Web/Global.asax.cs @@ -1587,14 +1587,7 @@ // 回收时调用接口 protected void Application_End(object sender, EventArgs e) { - //调用接口 - string baseUrl = "https://fcl-test.basf-ypc.net.cn/api/api/DataSyncUserInfo/GetHrInfoList"; - BLL.Common.HttpHelper.HttpGetRequest(baseUrl); - //var obj = JsonConvert.DeserializeObject(result); - //if (obj.code == 200) - //{ - // //成功 - //} + } } } diff --git a/FCL/FineUIPro.Web/Login.aspx b/FCL/FineUIPro.Web/Login.aspx index 3e3f74e..dd368d9 100644 --- a/FCL/FineUIPro.Web/Login.aspx +++ b/FCL/FineUIPro.Web/Login.aspx @@ -225,7 +225,7 @@ }) $("#faskloginUrl").click(function () { let url = "https://login.microsoftonline.com/ecaa386b-c8df-4ce0-ad01-740cbdb5ba55/oauth2/v2.0/authorize"; - let clientId = "a7977a3e-06b5-4dfc-bd7f-5b6825f0d846"; + let clientId = "9379ad91-eef9-4956-a1ee-8b04bb3d42c8"; let response_type = "code"; let redirect_url = encodeURIComponent("http://localhost:6166/ssocallback.aspx"); let scope = "openid profile"; diff --git a/FCL/FineUIPro.Web/Web.config b/FCL/FineUIPro.Web/Web.config index 47a5b53..0d03a60 100644 --- a/FCL/FineUIPro.Web/Web.config +++ b/FCL/FineUIPro.Web/Web.config @@ -9,7 +9,7 @@
- + diff --git a/FCL/FineUIPro.Web/ssocallback.aspx.cs b/FCL/FineUIPro.Web/ssocallback.aspx.cs index 0d93c15..c81ac9a 100644 --- a/FCL/FineUIPro.Web/ssocallback.aspx.cs +++ b/FCL/FineUIPro.Web/ssocallback.aspx.cs @@ -21,13 +21,21 @@ namespace FineUIPro.Web Response.Redirect("~/login.aspx"); return; } - GetAccessToken(this.code); + var token= GetAccessToken(this.code); + var userInfo = getUserInfo(token); + if (userInfo == null) + { + Response.Redirect("~/login.aspx"); + return; + } + + Response.Redirect("~/index.aspx"); } private AccessTokenModel GetAccessToken(string _code) { - string clientId = ""; - string clientSecret = ""; + string clientId = "9379ad91-eef9-4956-a1ee-8b04bb3d42c8"; + string clientSecret = "iLu8Q~4DRYAn~sMjvO1j.tgRERFWhILvLYRPNc9S"; string grant_type = "authorization_code"; string redirect_url = "http://localhost:6166/ssocallback.aspx"; string scope = "profile openid"; @@ -53,17 +61,45 @@ namespace FineUIPro.Web } - private void getUserInfo(string _code) + private UserTokenModel getUserInfo(AccessTokenModel token) { - var objData = GetAccessToken(_code); - if (objData == null) - { - //退出去login页面 - return; - } string baseUrl = "https://graph.microsoft.com/oidc/userinfo"; + try + { + var result = HttpHelper.HttpGetRequest(baseUrl, token.access_token); + if (result.IndexOf("sub") > -1) + { + var info = JsonConvert.DeserializeObject(result); + //写入session信息 + //写入cookie信息 + + return info; + } + + } + catch (Exception ex) + { + //这里报错了,写入日志 + BLL.ErrLogInfo.WriteLog(ex.Message); + } + return null; } } + + public class UserTokenModel + { + public string sub { get; set; } + + public string name { get; set; } + + public string family_name { get; set; } + + public string given_name { get; set; } + + public string picture { get; set; } + public string email { get; set; } + + } } \ No newline at end of file diff --git a/FCL/WebApi/Web.config b/FCL/WebApi/Web.config index 780d168..d824706 100644 --- a/FCL/WebApi/Web.config +++ b/FCL/WebApi/Web.config @@ -10,7 +10,7 @@ - +