Просмотр исходного кода

新增数据库字符串加密

zhoufan лет назад: 3
Родитель
Сommit
c965dcafc1

+ 6 - 0
CallCenterApi/CallCenterApi.DB/CallCenterApi.DB.csproj

@@ -45,6 +45,12 @@
45 45
     <Compile Include="DbHelperSQL.cs" />
46 46
     <Compile Include="Properties\AssemblyInfo.cs" />
47 47
   </ItemGroup>
48
+  <ItemGroup>
49
+    <ProjectReference Include="..\..\CallCenterCommon\CallCenter.Utility\CallCenter.Utility.csproj">
50
+      <Project>{4DA219CC-911E-4C81-BB0B-DF5183FD50FF}</Project>
51
+      <Name>CallCenter.Utility</Name>
52
+    </ProjectReference>
53
+  </ItemGroup>
48 54
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
49 55
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
50 56
        Other similar extension points exist, see Microsoft.Common.targets.

+ 3 - 2
CallCenterApi/CallCenterApi.DB/DbHelperSQL.cs

@@ -1,4 +1,5 @@
1
-using System;
1
+using CallCenter.Utility;
2
+using System;
2 3
 using System.Collections;
3 4
 using System.Collections.Generic;
4 5
 using System.Configuration;
@@ -13,7 +14,7 @@ namespace CallCenterApi.DB
13 14
     public abstract class DbHelperSQL
14 15
     {
15 16
         //数据库连接字符串(web.config来配置),可以动态更改connectionString支持多数据库.		
16
-        public static string connectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
17
+        public static string connectionString = EncryptHelper.DecryptAES(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
17 18
         public DbHelperSQL() { }
18 19
 
19 20
         #region 公用方法

+ 3 - 1
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Web.config

@@ -18,7 +18,9 @@
18 18
   </appSettings>
19 19
   <connectionStrings>
20 20
     <!--<add name="ConnectionString" connectionString="Data Source=192.168.8.3;User ID=sa;pwd=800100;Initial Catalog=12345_YuCheng;"/>-->
21
-    <add name="ConnectionString" connectionString="Data Source=192.168.8.3;User ID=sa;pwd=800100;Initial Catalog=12345_MinQuan;"/>
21
+    
22
+    <add name="ConnectionString" connectionString="+W8IUPbrCEH773KLes7fVCZXGyev2Glt1NnofzL1broNji+Bk6jbD725f8xE9tHjqVfRFDjmUeBBd4XPqfkDYakeWEDHwb5BkflVIAuAg0A="/>
23
+    <!--<add name="ConnectionString" connectionString="Data Source=192.168.8.3;User ID=sa;pwd=800100;Initial Catalog=12345_MinQuan;"/>-->
22 24
     <!--<add name="ConnectionString" connectionString="Data Source=192.168.8.3;User ID=sa;pwd=800100;Initial Catalog=12345_SuiXian;"/>-->
23 25
     <!--<add name="ConnectionString" connectionString="Data Source=192.168.8.3;User ID=sa;pwd=800100;Initial Catalog=12345_YongCheng;"/>-->
24 26
     <!--<add name="ConnectionString" connectionString="Data Source=192.168.8.3;User ID=sa;pwd=800100;Initial Catalog=12345_ZheCheng;"/>-->