From 5bcbc8e9af6e0e59f5665efa7e8d9111864a7d4a Mon Sep 17 00:00:00 2001
From: jackchenyang <874821510@qq.com>
Date: Mon, 20 May 2024 11:09:31 +0800
Subject: [PATCH 1/3] 12
---
FCL/FineUIPro.Web/FineUIPro.Web.csproj | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/FCL/FineUIPro.Web/FineUIPro.Web.csproj b/FCL/FineUIPro.Web/FineUIPro.Web.csproj
index 42d069b..5bafc10 100644
--- a/FCL/FineUIPro.Web/FineUIPro.Web.csproj
+++ b/FCL/FineUIPro.Web/FineUIPro.Web.csproj
@@ -3565,7 +3565,7 @@
-
+
From d38dc202afede1a5f89a628e37ae2be6493df8bf Mon Sep 17 00:00:00 2001
From: jackchenyang <874821510@qq.com>
Date: Mon, 3 Jun 2024 14:52:50 +0800
Subject: [PATCH 2/3] 1212
---
FCL/BLL/Common/HttpHelper.cs | 4 +-
FCL/FineUIPro.Web/FineUIPro.Web.csproj | 90 --------------------------
FCL/FineUIPro.Web/Global.asax.cs | 9 +--
FCL/FineUIPro.Web/Login.aspx | 2 +-
FCL/FineUIPro.Web/Web.config | 2 +-
FCL/FineUIPro.Web/ssocallback.aspx.cs | 56 +++++++++++++---
FCL/WebApi/Web.config | 2 +-
7 files changed, 52 insertions(+), 113 deletions(-)
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/FineUIPro.Web.csproj b/FCL/FineUIPro.Web/FineUIPro.Web.csproj
index 5bafc10..f91eb81 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 @@
-
@@ -2567,7 +2557,6 @@
-
@@ -2596,17 +2585,6 @@
-
- FCLDS.xsd
-
-
- Designer
- MSDataSetGenerator
- FCLDS.Designer.cs
-
-
- FCLDS.xsd
-
@@ -3060,55 +3038,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
@@ -3152,22 +3081,6 @@
OperationError.aspx
-
- FCLDS.xsd
-
-
- True
- True
- FCLDS.xsd
-
-
- ReportPrint.aspx
- ASPXCodeBehind
-
-
- ReportPrint.aspx
-
-
index.aspx
ASPXCodeBehind
@@ -3558,9 +3471,6 @@
Lan.en-US.designer.cs
-
-
-
diff --git a/FCL/FineUIPro.Web/Global.asax.cs b/FCL/FineUIPro.Web/Global.asax.cs
index 17f9ff2..c67b37c 100644
--- a/FCL/FineUIPro.Web/Global.asax.cs
+++ b/FCL/FineUIPro.Web/Global.asax.cs
@@ -1584,14 +1584,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 @@
-
+
From 42d2d79ec98eed4ba7c73a453b2450274517efa4 Mon Sep 17 00:00:00 2001
From: jackchenyang <874821510@qq.com>
Date: Mon, 3 Jun 2024 18:43:21 +0800
Subject: [PATCH 3/3] 1212
---
.../Evaluation/EvaluationNew.aspx | 40 +++++++++++++++++--
.../Evaluation/EvaluationNew.aspx.designer.cs | 18 +++++++++
2 files changed, 54 insertions(+), 4 deletions(-)
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);
+ }
});
});
+