| | |
| | | <!--#include virtual="/inc/chkadmin.gds"-->
|
| | | <!--#include virtual="/inc/function.gds"-->
|
| | | <%
|
| | |
|
| | | searchTXT=SafeRequest(trim(Request("searchTXT")))
|
| | | searchTXTMore=SafeRequest(Request("searchTXTMore"))
|
| | | If InStr(searchTXT,",")>0 Then
|
| | |
| | | If CoopUnitID<>"" Then page_URL=page_URL&"&CoopUnitID="&CoopUnitID
|
| | |
|
| | | %>
|
| | |
|
| | |
|
| | | <%
|
| | | ' 记录管理员操作日志,谁访问了这个页面,写在了logs/目录下面
|
| | | Dim adminName
|
| | | adminName = Session("adminName")
|
| | |
|
| | | ' 检查 adminName 是否为空
|
| | | If adminName = "" Then
|
| | | Response.Write("管理员名称未设置!")
|
| | | Response.End()
|
| | | End If
|
| | |
|
| | | ' 获取当前日期并格式化为 YYYY-MM-DD
|
| | | Dim currentDate
|
| | | currentDate = Year(Now()) & "-" & Right("0" & Month(Now()), 2) & "-" & Right("0" & Day(Now()), 2)
|
| | |
|
| | | ' 定义文件路径和文件名
|
| | | Dim fileName, filePath
|
| | | fileName = "log_" & currentDate & ".txt" ' 例如:log_2023-10-05.txt
|
| | | filePath = Server.MapPath("logs/" & fileName)
|
| | |
|
| | | ' 创建文件系统对象
|
| | | Dim fs, f
|
| | | Set fs = Server.CreateObject("Scripting.FileSystemObject")
|
| | |
|
| | | ' 检查 logs 目录是否存在,如果不存在则创建
|
| | | Dim logsFolderPath
|
| | | logsFolderPath = Server.MapPath("logs")
|
| | | If Not fs.FolderExists(logsFolderPath) Then
|
| | | fs.CreateFolder(logsFolderPath)
|
| | | End If
|
| | |
|
| | | ' 检查文件是否存在,如果不存在则创建
|
| | | If Not fs.FileExists(filePath) Then
|
| | | Set f = fs.CreateTextFile(filePath, True)
|
| | | f.Close
|
| | | End If
|
| | |
|
| | |
|
| | | Dim isDepartmentStr
|
| | |
|
| | | if isDepartment("020114")=1 Then
|
| | | isDepartmentStr="查看全部订单权限"
|
| | | ElseIf isDepartment("020103")=1 Or isDepartment("020115")=1 Then
|
| | | isDepartmentStr="服务单查询权限"
|
| | | Else |
| | | isDepartmentStr="无权限"
|
| | | End If
|
| | |
|
| | |
|
| | | ' 打开文件并写入内容
|
| | | On Error Resume Next ' 启用错误处理
|
| | | Set f = fs.OpenTextFile(filePath, 8, True) ' 8 表示追加模式
|
| | | If Err.Number = 0 Then ' 如果未发生错误
|
| | | f.WriteLine(Now() & " - " & adminName & " - 访问了[ServiceOrder_List 页面] - 用户权限:" & isDepartmentStr) ' 写入当前时间和管理员名称
|
| | | f.Close
|
| | | Else
|
| | | ' 如果打开文件失败,忽略错误
|
| | | End If
|
| | | ' 释放对象
|
| | | Set f = Nothing
|
| | | Set fs = Nothing
|
| | |
|
| | | On Error GoTo 0 ' 关闭错误处理
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | '如果isDepartmentStr="无权限"
|
| | | If isDepartmentStr = "无权限" Then
|
| | | ' 打开文件并写入内容
|
| | | On Error Resume Next ' 启用错误处理
|
| | | Set f = fs.OpenTextFile(filePath, 8, True) ' 8 表示追加模式
|
| | | If Err.Number = 0 Then ' 如果未发生错误
|
| | | f.WriteLine(Now() & " - " & adminName & " - 尝试访问[ServiceOrder_List 页面] - " & isDepartmentStr) ' 写入当前时间和管理员名称
|
| | | f.Close
|
| | | Else
|
| | | ' 如果打开文件失败,忽略错误
|
| | | End If
|
| | |
|
| | | ' 释放对象
|
| | | Set f = Nothing
|
| | | Set fs = Nothing
|
| | |
|
| | | On Error GoTo 0 ' 关闭错误处理
|
| | |
|
| | | Response.Write("Access not allowed, no permission!")
|
| | | Response.End()
|
| | | End If
|
| | | %>
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
| | | <html xmlns="http://www.w3.org/1999/xhtml">
|
| | | <head>
|