首页 > 其他分享 >ssts-hospital-web-master项目实战记录三十:项目迁移-Hook实现(useSystemService)

ssts-hospital-web-master项目实战记录三十:项目迁移-Hook实现(useSystemService)

时间:2024-02-29 16:36:52浏览次数:34  
标签:serveWebApi web const string ssts hospital ret Trade terminalNo

记录时间:2024-02-29

一、useSystemService模块实现

service/system-service/useTerminalService.ts

import hydate from '@/utils/date-format' import { LogInfo } from '@/framework/utils/log-local' import { Device } from '@/types/device' import { Receipt } from '@/types/receipt' import { useSystemStore } from '@/store/useSystemStore'
const systemStore = useSystemStore()
const getServiceStatus = (terminalIp: string) => {   console.log('getServiceStatus:', terminalIp) }
const getServiceTime = (terminalGroupId: string, terminalNo: string) => {   console.log('getServcieTime:', terminalGroupId, terminalNo) }
const getServiceTimeSpan = (   AMStartTime: string,   AMEndTime: string,   PMStartTime: string,   PMEndTime: string,   NightStartTime: string,   NightEndTime: string ) => {   console.log(     'getServcieTimeSpan:',     AMStartTime,     AMEndTime,     PMStartTime,     PMEndTime,     NightStartTime,     NightEndTime   ) }
const getServiceTimeConfig = (serviceTimeConfig: string) => {   console.log('getServcieTimeConfig:', serviceTimeConfig) }
const getDeviceStatusDescription = (deviceName: string, statusId: string) => {   console.log('getDeviceStatusDescription:', deviceName, statusId) }
const checkDeviceStatus = (deviceList: Array<Device>) => {   console.log('checkDeviceStatus:', deviceList) }
const getMenus = (terminalGroupId: string, parentMenuId: string) => {   console.log('getMenus:', terminalGroupId, parentMenuId) }
const receiptPrintRawData = (   terminalIp: string,   terminalNo: string,   businessTrace: string,   receiptPageName: string,   customCardNo: string,   customName: string,   formName: string,   values: string,   index: string ) => {   console.log(     'receiptPrintRawData:',     terminalIp,     terminalNo,     businessTrace,     receiptPageName,     customCardNo,     customName,     formName,     values,     index   ) }
const receiptPrintRawDataHtml = (   terminalIp: string,   terminalNo: string,   businessTrace: string,   receiptPageName: string,   customCardNo: string,   customName: string,   formName: string,   values: string,   index: string ) => {   console.log(     'receiptPrintRawDataHtml:',     terminalIp,     terminalNo,     businessTrace,     receiptPageName,     customCardNo,     customName,     formName,     values,     index   ) }
// 添加凭条数据 const addReceiptData = (formName: string, jsonPrint: object) => {   const jsonPrintStr = JSON.stringify(jsonPrint)   const receipt = {} as Receipt   receipt.formName = formName   receipt.jsonPrint = jsonPrintStr   receipt.pageName = window.location.href
  systemStore.addToDictReceiptList(receipt)
  const now = new Date()   const folder = `D:\\LogInfo\\LogReceiptData\\${hydate(now).format('YYYY-MM')}\\`   const fileName = `${folder}LogReceipt${hydate(now).format('YYYY-MM-DD')}.txt`   LogInfo(folder, fileName, eval("'" + jsonPrintStr + "'") + ',') }
export {   getServiceStatus,   getServiceTime,   getServiceTimeSpan,   getServiceTimeConfig,   getDeviceStatusDescription,   checkDeviceStatus,   getMenus,   receiptPrintRawData,   receiptPrintRawDataHtml,   addReceiptData }

 

service/system-service/useLogService.ts

import hydate from '@/utils/date-format' import { LogInfo } from '@/framework/utils/log-local' import { serveWebApi } from '@/service' import { useSystemStore } from '@/store/useSystemStore'
const systemStore = useSystemStore()
// 记录业务流水日志 const logBusinessTrace = function (   businessTrace: string,   businessName: string,   terminalIp: string,   orgId: string,   terminalNo: string,   iDCardNo: string,   customCardNo: string,   bankCardNo: string,   customId: string,   customName: string,   telephone: string ) {   serveWebApi(     '/api/System/AddLogBusinessTrace',     JSON.stringify({       businessTrace: businessTrace,       businessName: businessName,       terminalIp: terminalIp,       orgId: orgId,       terminalNo: terminalNo,       iDCardNo: iDCardNo,       customCardNo: customCardNo,       bankCardNo: bankCardNo,       customId: customId,       customName: customName,       telephone: telephone     })   ) }
// 记录业务流水结果 const logBusinessResult = function (   businessTrace: string,   terminalNo: string,   patientName: string,   trace: string,   tradeAmt: string,   tradeResult: string,   tradeResultMsg: string,   flag: string,   handleInfo: string ) {   const tradeInfo = `${patientName},${systemStore.dictFlowKey},${2}`   const tradePageInfo = window.location.href
  serveWebApi(     '/api/System/AddLogBusinessResult',     JSON.stringify({       businessTrace: businessTrace,       terminalNo: terminalNo,       trace: trace,       tradeAmt: tradeAmt,       tradeInfo: tradeInfo,       tradeResult: tradeResult,       tradeResultMsg: tradeResultMsg,       tradePageInfo: tradePageInfo,       flag: flag,       handleInfo: handleInfo     })   ) }
// 记录业务消息 const logBusinessMsg = function (   businessTrace: string,   msgValue: string,   msgInfo: string ) {   const msgPageName = systemStore.dict.currentPage.value   const msgScope = ''
  serveWebApi(     '/api/System/AddLogBusinessMsg',     JSON.stringify({       businessTrace: businessTrace,       msgPageName: msgPageName,       msgScope: msgScope,       msgValue: msgValue,       msgInfo: msgInfo     })   ) }
// 记录卡片明细 const logCardDetail = function (   terminalNo: string,   businessTrace: string,   changeCount: string,   idCardNo: string,   customName: string,   telephone: string,   customCardNo: string,   description: string ) {   const jsonStr = JSON.stringify({     terminalNo: terminalNo,     businessTrace: businessTrace,     changeCount: changeCount,     idCardNo: idCardNo,     customName: customName,     telephone: telephone,     customCardNo: customCardNo,     description: description   })
  const now = new Date()   const folder = `D:\\LogInfo\\LogCardDetail\\${hydate(now).format('YYYY-MM')}\\`   const fileName = `LogCardDetail${hydate(now).format('YYYY-MM-DD')}.txt'`   LogInfo(folder, fileName, eval("'" + jsonStr + "'") + ',')
  serveWebApi('/api/System/AddCardDetail', jsonStr) }
// 记录现金明细 const logCashDetail = function (   terminalNo: string,   businessTrace: string,   trace: string,   denomination: string,   idCardNo: string,   customName: string,   telephone: string,   customCardNo: string,   customId: string ) {   const jsonStr = JSON.stringify({     terminalNo: terminalNo,     businessTrace: businessTrace,     trace: trace,     denomination: denomination,     idCardNo: idCardNo,     customName: customName,     telephone: telephone,     customCardNo: customCardNo,     customId: customId   })
  const now = new Date()   const folder = `D:\\LogInfo\\LogCashDetail\\${hydate(now).format('YYYY-MM')}\\`   const fileName = `LogCashDetail${hydate(now).format('YYYY-MM-DD')}.txt`   LogInfo(folder, fileName, eval("'" + jsonStr + "'") + ',')
  serveWebApi('/api/System/AddCashDetail', jsonStr) }
// 记录账户明细 const logAccountDetail = function (   businessTrace: string,   terminalNo: string,   trace: string,   modeType: string,   tradeType: string,   iSEmpNo: string,   tradeAmt: string,   customCardNo: string,   customId: string,   customName: string,   bankPosId: string,   bankCardNo: string,   bankTrace: string,   bankReferenceNo: string,   bankDate: string,   bankTime: string,   bankTradeDate: string ) {   const jsonStr = JSON.stringify({     businessTrace: businessTrace,     terminalNo: terminalNo,     trace: trace,     modeType: modeType,     tradeType: tradeType,     iSEmpNo: iSEmpNo,     tradeAmt: tradeAmt,     customCardNo: customCardNo,     customId: customId,     customName: customName,     bankPosId: bankPosId,     bankCardNo: bankCardNo,     bankTrace: bankTrace,     bankReferenceNo: bankReferenceNo,     bankDate: bankDate,     bankTime: bankTime,     bankTradeDate: bankTradeDate   })
  const now = new Date()   const folder = `D:\\LogInfo\\LogAccountDetail\\${hydate(now).format('YYYY-MM')}\\`   const fileName = `LogAccountDetail${hydate(now).format('YYYY-MM-DD')}.txt`   LogInfo(folder, fileName, eval("'" + jsonStr + "'") + ',')
  serveWebApi('/api/System/AddAccountDetail', jsonStr) }
// 记录账户明细结果 const logAccountDetailResult = function (   trace: string,   tradeResult: string,   iSTrace: string,   iSTradeDate: string ) {   serveWebApi(     '/api/System/AddAccountDetailResult',     JSON.stringify({       trace: trace,       tradeResult: tradeResult,       iSTrace: iSTrace,       iSTradeDate: iSTradeDate     })   ) }
export {   logBusinessTrace,   logBusinessResult,   logBusinessMsg,   logCardDetail,   logCashDetail,   logAccountDetail,   logAccountDetailResult }  

service/system-service/useTradeServcie.ts

import { serveWebApi } from '@/service'
// 添加/更新交易信息日志 const addOrUpdateTradeInfo = async function (   TradeID: string,   TerminalNo: string,   TerminalIP: string,   TellerNo: string,   PatientCardID: string,   PatientID: string,   PatientName: string,   TradeState: string,   IdCardNo: string,   CurrentMoney: string,   TradeMoney: string,   TradeTypeID: string,   TradeNameID: string,   ProcessKey: string,   TradeType: string,   ApiState: string,   Hospital_No: string,   BusinessOrderNo: string,   ProcessId: string ) {   const ret = await serveWebApi(     '/api/Trade/AddOrUpdateTradeInfo',     JSON.stringify({       TradeID: TradeID,       TerminalNo: TerminalNo,       TerminalIP: TerminalIP,       TellerNo: TellerNo,       PatientCardID: PatientCardID,       PatientID: PatientID,       PatientName: PatientName,       TradeState: TradeState,       IdCardNo: IdCardNo,       CurrentMoney: CurrentMoney,       TradeMoney: TradeMoney,       TradeTypeID: TradeTypeID,       TradeNameID: TradeNameID,       ProcessKey: ProcessKey,       TradeType: TradeType,       ApiState: ApiState,       Hospital_No: Hospital_No,       BusinessOrderNo: BusinessOrderNo,       ProcessId: ProcessId     })   )   return ret }
// 更新交易信息日志 const updateTradeInfo = async function (   TradeID: string,   TradeState: string,   TradeMoney: string,   BusinessOrderNo: string ) {   const ret = await serveWebApi(     '/api/Trade/UpdateTradeInfo',     JSON.stringify({       TradeID: TradeID,       TradeState: TradeState,       TradeMoney: TradeMoney,       BusinessOrderNo: BusinessOrderNo     })   )   return ret }
// 更新交易信息状态日志 const updateTradeInfoStatus = async function (   TradeID: string,   TradeState: string ) {   const ret = await serveWebApi(     '/api/Trade/UpdateTradeInfoStatus',     JSON.stringify({       TradeID: TradeID,       TradeState: TradeState     })   )   return ret }
// 添加交易明细日志 const addTradeDetail = async function (   InterfaceTypeID: string,   InterfaceNameID: string,   TraceNo: string,   TerminalNo: string,   TradeState: string,   pageName: string,   CurrentMoney: string,   TradeMoney: string,   TradeID: string,   ApiState: string,   ProcessIdDetails: string ) {   const ret = await serveWebApi(     '/api/Trade/AddTradeDetail',     JSON.stringify({       InterfaceTypeID: InterfaceTypeID,       InterfaceNameID: InterfaceNameID,       TraceNo: TraceNo,       TerminalNo: TerminalNo,       TradeState: TradeState,       pageName: pageName,       CurrentMoney: CurrentMoney,       TradeMoney: TradeMoney,       TradeID: TradeID,       ApiState: ApiState,       ProcessIdDetails: ProcessIdDetails     })   )   return ret } // 更新交易明细日志 const updateTradeDetail = async function (   TradeDetailID: string,   TradeState: string ) {   const ret = await serveWebApi(     '/api/Trade/UpdateTradeDetail',     JSON.stringify({       TradeDetailID: TradeDetailID,       TradeState: TradeState     })   )   return ret }
// 添加交易接口日志 const addLogTrade = async function (   TradeDetailID: string,   TradeCode: string,   TradeName: string,   TradeMsg: string,   MsgType: string,   LogType: string ) {   const ret = await serveWebApi(     '/api/Trade/AddLogTrade',     JSON.stringify({       TradeDetailID: TradeDetailID,       TradeCode: TradeCode,       TradeName: TradeName,       TradeMsg: TradeMsg,       MsgType: MsgType,       LogType: LogType     })   )   return ret }
// 添加交易订单日志 const addTradeOrder = async function (   Order_NO: string,   Order_Name: string,   Order_Amt: string,   Order_Desc: string,   Order_State: string,   Order_Creator: string,   Order_Plat: string,   Order_CreatorID: string,   Pay_OrderNO: string,   His_NO: string,   Account_ID: string,   Field1: string,   Field2: string ) {   const ret = await serveWebApi(     '/api/Trade/AddTradeOrder',     JSON.stringify({       Order_NO: Order_NO,       Order_Name: Order_Name,       Order_Amt: Order_Amt,       Order_Desc: Order_Desc,       Order_State: Order_State,       Order_Creator: Order_Creator,       Order_Plat: Order_Plat,       Order_CreatorID: Order_CreatorID,       Pay_OrderNO: Pay_OrderNO,       His_NO: His_NO,       Account_ID: Account_ID,       Field1: Field1,       Field2: Field2     })   )   return ret }
// 更新交易订单日志 const updateTradeOrder = async function (   Order_NO: string,   Order_State: string,   Pay_OrderNO: string,   His_NO: string,   Field1: string,   Field2: string ) {   const ret = await serveWebApi(     '/api/Trade/UpdateTradeOrder',     JSON.stringify({       Order_NO: Order_NO,       Order_State: Order_State,       Pay_OrderNO: Pay_OrderNO,       His_NO: His_NO,       Field1: Field1,       Field2: Field2     })   )   return ret } // 添加交易记录日志 const addTradeRecord = async function (   Trade_NO: string,   Business_OrderNO: string,   Pay_OrderNO: string,   His_NO: string,   Trade_IP: string,   Trade_TerminalNO: string,   Trade_Amt: string,   Trade_Type: string,   Trade_Status: string,   Trade_GoodsType: string,   Trade_GoodsName: string,   App_ID: string,   Payment_ID: string,   Payment_TypeName: string,   Trade_Plat: string,   Trade_Code: string ) {   const ret = await serveWebApi(     '/api/Trade/AddTradeRecord',     JSON.stringify({       Trade_NO: Trade_NO,       Business_OrderNO: Business_OrderNO,       Pay_OrderNO: Pay_OrderNO,       His_NO: His_NO,       Trade_IP: Trade_IP,       Trade_TerminalNO: Trade_TerminalNO,       Trade_Amt: Trade_Amt,       Trade_Type: Trade_Type,       Trade_Status: Trade_Status,       Trade_GoodsType: Trade_GoodsType,       Trade_GoodsName: Trade_GoodsName,       App_ID: App_ID,       Payment_ID: Payment_ID,       Payment_TypeName: Payment_TypeName,       Trade_Plat: Trade_Plat,       Trade_Code: Trade_Code     })   )   return ret }
// 更新交易记录日志 const updateTradeRecord = async function (   Trade_NO: string,   His_NO: string,   Trade_Status: string ) {   const ret = await serveWebApi(     '/api/Trade/UpdateTradeRecord',     JSON.stringify({       Trade_NO: Trade_NO,       His_NO: His_NO,       Trade_Status: Trade_Status     })   )   return ret }
// 添加退费记录日志 const addRefundRecord = async function (   Pay_OrderNO: string,   Refund_NO: string,   Business_OrderNO: string,   Refund_Amt: string,   Refund_Status: string,   Refund_Desc: string,   Trade_NO: string,   App_ID: string ) {   const ret = await serveWebApi(     '/api/Trade/AddRefundRecord',     JSON.stringify({       Pay_OrderNO: Pay_OrderNO,       Refund_NO: Refund_NO,       Business_OrderNO: Business_OrderNO,       Refund_Amt: Refund_Amt,       Refund_Status: Refund_Status,       Refund_Desc: Refund_Desc,       Trade_NO: Trade_NO,       App_ID: App_ID     })   )   return ret } // 更新退费记录日志 const updateRefundRecord = async function (   Refund_NO: string,   Refund_Status: string ) {   const ret = await serveWebApi(     '/api/Trade/UpdateRefundRecord',     JSON.stringify({       Refund_NO: Refund_NO,       Refund_Status: Refund_Status     })   )   return ret }
export {   addOrUpdateTradeInfo,   updateTradeInfo,   updateTradeInfoStatus,   addTradeDetail,   updateTradeDetail,   addLogTrade,   addTradeOrder,   updateTradeOrder,   addTradeRecord,   updateTradeRecord,   addRefundRecord,   updateRefundRecord }

 

service/system-service/useManageServcie.ts

import { serveWebApi } from '@/service' import { useSystemStore } from '@/store/useSystemStore'
const systemStore = useSystemStore()
// 获取前台管理菜单 const getManageMenus = async function (xmlFile: string) {   return await serveWebApi(     '/api/System/getManageMenus',     JSON.stringify({ xmlFile: xmlFile })   ) } // 更新终端状态 const updateTerminalStatus = async function (   status: string,   id: string,   operUserId: string ) {   const ret = await serveWebApi(     '/api/Terminal/UpdateTerminalStatus',     JSON.stringify({ status: status, id: id, operUserId: operUserId })   ).then((res) => {     if (res == true) {       systemStore.syncDictTerminal('Status', status)     }   })
  return ret }
// 更新物料用量当前数量 const changeSuppliesUsageCurrentCount = async function (   suppliesName: string,   terminalNo: string,   changeCount: string ) {   const ret = await serveWebApi(     '/api/Terminal/ChangeSuppliesUsageCurrentCount',     JSON.stringify({       suppliesName: suppliesName,       terminalNo: terminalNo,       changeCount: changeCount     })   )
  return ret } // 获取在用物料用量信息 const getSuppliesUsageInUse = async function (   suppliesName: string,   terminalNo: string ) {   const ret = await serveWebApi(     '/api/Terminal/GetSuppliesUsageInUse',     JSON.stringify({ suppliesName: suppliesName, terminalNo: terminalNo })   )
  return ret } // 更新物料用量信息 const changeSuppliesUsage = async function (   suppliesName: string,   terminalNo: string,   currentCount: string,   warningThreshold: string,   userId: string ) {   const ret = await serveWebApi(     '/api/Terminal/ChangeSuppliesUsage',     JSON.stringify({       suppliesName: suppliesName,       terminalNo: terminalNo,       currentCount: currentCount,       warningThreshold: warningThreshold,       userId: userId     })   )
  return ret } // 获取数据库数据 const getDBData = async function (   Tables: string,   PrimaryKey: string,   Fields: string,   Filter: string,   Group: string,   Sort: string ) {   const ret = await serveWebApi(     '/api/DB/GetData',     JSON.stringify({       Tables: Tables,       PrimaryKey: PrimaryKey,       Fields: Fields,       Filter: Filter,       Group: Group,       Sort: Sort     })   )
  return ret } // 获取数据库分页数据 const getDBPagingData = async function (   jsonSelectConfig: object,   pageSize: string,   pageIndex: string ) {   const ret = await serveWebApi(     '/api/DB/GetPagingData',     JSON.stringify({       jsonSelectConfig: jsonSelectConfig,       pageSize: pageSize,       pageIndex: pageIndex     })   )
  return ret } // 检查现金批次 const checkCashBatch = async function (terminalNo: string) {   const ret = await serveWebApi(     '/api/System/CheckCashBatch',     JSON.stringify({ terminalNo: terminalNo })   )
  return ret } // 现金清理 const cashClean = async function (   terminalNo: string,   userId: string,   batchId: string ) {   const ret = await serveWebApi(     '/api/System/CashClean',     JSON.stringify({ terminalNo: terminalNo, userId: userId, batchId: batchId })   )
  return ret } // 现金结账 const cashSettle = async function (terminalNo: string, userId: string) {   const ret = await serveWebApi(     '/api/System/CashSettle',     JSON.stringify({ terminalNo: terminalNo, userId: userId })   )
  return ret } // 更新业务数据处理信息 const updateLogBusinessHandleInfo = async function (   trace: string,   handleUserId: string,   handleInfo: string ) {   const ret = await serveWebApi(     '/api/System/UpdateLogBusinessHandleInfo',     JSON.stringify({       trace: trace,       handleUserId: handleUserId,       handleInfo: handleInfo     })   )
  return ret }
// ******用户查询操作(前台管理)****** // 验证用户名和密码 const checkUserNameAndPassword = async function (   userName: string,   password: string ) {   // / <summary>   // / 验证用户名和密码   // / </summary>   // / <returns></returns>
  return await serveWebApi(     '/api/System/CheckUserNameAndPassword',     JSON.stringify({ userName: userName, password: password })   ) } // 通过用户名获取用户信息 const getUserByUserName = async function (userName: string) {   return await serveWebApi(     '/api/System/GetUserByUserName',     JSON.stringify({ userName: userName, loginCardNo: '' })   ) } // 验证登录卡号 const checkUserLoginCardNo = async function (loginCardNo: string) {   // / <summary>   // / 验证登录卡号   // / </summary>   // / <returns></returns>
  return await serveWebApi(     '/api/System/CheckUserLoginCardNo',     JSON.stringify({ userName: '', loginCardNo: loginCardNo })   ) } // 通过登录卡号获取用户信息 const getUserByLoginCardNo = async function (loginCardNo: string) {   return await serveWebApi(     '/api/System/GetUserByLoginCardNo',     JSON.stringify({ userName: '', loginCardNo: loginCardNo })   ) }
export {   getManageMenus,   updateTerminalStatus,   changeSuppliesUsageCurrentCount,   getSuppliesUsageInUse,   changeSuppliesUsage,   getDBData,   getDBPagingData,   checkCashBatch,   cashClean,   cashSettle,   updateLogBusinessHandleInfo,   checkUserNameAndPassword,   getUserByUserName,   checkUserLoginCardNo,   getUserByLoginCardNo }

 

service/system-service/useOtherService.ts

import { serveWebApi } from '@/service'
// 获取文件内容 const getFileContent = async function (filePath: string) {   const ret = await serveWebApi(     '/api/System/GetFileContent',     JSON.stringify({       strPath: filePath     })   )   return ret }
// 银行前置服务 const bankTvm = async function (IP: string, Port: string, _inStr: string) {   const ret = await serveWebApi(     '/api/System/BankTvm',     JSON.stringify({ IP: IP, Port: Port, _inStr: _inStr })   )   return ret }
// 记录服务器日志 const writeSSTSLog = async function (   terminalIp: string,   prefix: string,   subDir: string,   log: string ) {   const ret = await serveWebApi(     '/api/System/WriteSSTSLog',     JSON.stringify({       terminalIp: terminalIp,       prefix: prefix,       subDir: subDir,       log: log     })   )   return ret }
export { getFileContent, bankTvm, writeSSTSLog }  

二、调用示例

 

三、运行测试

 

翻译

搜索

复制

<iframe></iframe>

标签:serveWebApi,web,const,string,ssts,hospital,ret,Trade,terminalNo
From: https://www.cnblogs.com/lizhigang/p/18044654

相关文章

  • webserver服务器常见问题
    目录Reactor和Proactor的区别Reactor和Proactor的区别Reactor和Proactor都是处理并发编程中的I/O多路复用问题的设计模式。它们的主要区别在于处理I/O事件的方式。Reactor模式:Reactor模式是一种同步I/O模式,它等待文件描述符或socket为读写操作准备就绪,然后将就绪事件传递给......
  • HttpWebRequest的Request.Form接收不到数据
    最近在写接口,post请求,使用postman模拟时,使用的是raw-json,然后发现HttpContextBasecontext=(HttpContextBase)Request.Properties["MS_HttpContext"];//获取传统contextHttpRequestBaserequest=context.Request;//定义传统request对象stringdbcode=request.Form["d......
  • IIS配置Websocket
    前言作为新手小白最近有项目用了websocket,发布到iis后用其他设备连接不到,网上查询了一下,需要配置一下,记录下配置方法,防止忘记在控制面板/程序中打开启用或关闭windows功能2.启用websocket协议3.打开iis中的配置编辑器4.选择system.webserver/websocket节点......
  • 学习之Web服务器
    2.1WEB服务器Web服务器通常由硬件和软件共同构成。硬件:电脑,提供服务供其它客户电脑访问软件:电脑上安装的服务器软件,安装后能提供服务给网络中的其他计算机,将本地文件映射成一个虚拟的url地址供网络中的其他人访问。常见的JavaWeb服务器:Tomcat(Apache):当前应用最广的Ja......
  • 学习之WEB项目的标准结构
    一个标准的可以用于发布的WEB项目标准结构如下app本应用根目录static非必要目录,约定俗成的名字,一般在此处放静态资源(cssjsimg)WEB-INF必要目录,必须叫WEB-INF,受保护的资源目录,浏览器通过url不可以直接访问的目录classes必要目录,src下源代码,配置......
  • 需要在本地实现一个聊天室,多个tab页相互通信,不能用websocket,你会怎么做?
    可以考虑使用以下方法:使用LocalStorage:这个存储API可在浏览器的不同标签页之间共享数据。当一个标签页发送消息时,将消息存储在LocalStorage中。其他标签页可以监听该存储区的变化,并读取最新的消息内容来实现通信效果。//监听变化2window.addEventListener("storage",(e)=>......
  • 学习之@WebServlet
    3.1@WebServlet注解源码官方JAVAEEAPI文档下载地址JavaEE-Technologies(oracle.com)@WebServlet注解的源码阅读packagejakarta.servlet.annotation;importjava.lang.annotation.Documented;importjava.lang.annotation.ElementType;importjava.lang.ann......
  • 2.28继续javaweb
     今天继续昨天没有完成的内容@Data@AllArgsConstructor@NoArgsConstructorpublicclassPlan{privateStringname;privateintnumber;privateStringsum;privateStringidea;privateStringenglish;privateStringmath;privateLocalDateT......
  • 使用 Python 的 Django 框架开发一套 Web API 项目 All In One
    使用Python的Django框架开发一套WebAPI项目AllInOne游戏广告WebAPIDjango项目vsDjango应用程序一个Project可以包含多个Appsporject是一个可以独立运行的软件包app的运行必须依赖projectapp可以作为可以复用的功能模块使用demosDRF,DjangoR......
  • NSSRound#17 Basic web
    NSSRound#17Basicweb真签到审题一个登录界面看到页面名字Robots?转到robots.txt看到加密知识点:加密解密。解题hint解密,使用Hex加密方式解出用户名熟悉吗,新生赛可遇见过哦~.记得用户名全用小写哦~~username使用棋盘密码,解出ctfer。password使用base32和base......