浏览代码

💄 style(server): fix code formatting issues

- add space after if condition in server/index.tsx
- fix optional chaining spacing in file modification date calculation
- add space around ternary operator in file path assignment
- correct variable type declaration spacing (any)
- fix indentation and whitespace issues in multiple locations

💄 style(client): remove unnecessary blank line

- clean up extra whitespace in stock_main.tsx component
yourname 4 月之前
父节点
当前提交
813f7db582
共有 2 个文件被更改,包括 11 次插入11 次删除
  1. 1 1
      src/client/mobile/components/stock/stock_main.tsx
  2. 10 10
      src/server/index.tsx

+ 1 - 1
src/client/mobile/components/stock/stock_main.tsx

@@ -92,7 +92,7 @@ export function StockMain() {
   const handleClearLines = useCallback(() => {
     chartRef.current?.clearDrawings();
   }, []);
-
+ 
   // 错误处理
   useEffect(() => {
     if (error) {

+ 10 - 10
src/server/index.tsx

@@ -24,7 +24,7 @@ app.use('*', cors(
 
 app.route('/', createApi)
 
-if(!import.meta.env.PROD){
+if (!import.meta.env.PROD) {
   app.get('/ui', swaggerUI({
     url: '/doc',
     persistAuthorization: true,
@@ -47,12 +47,12 @@ if(!import.meta.env.PROD){
   }))
 }
 
-if(import.meta.env.PROD){
+if (import.meta.env.PROD) {
   app.get('/assets/:filename', async (c) => {
     const filename = c.req.param('filename')
-    const filePath = import.meta.env.PROD? `./dist/assets/${filename}` : `./public/assets/${filename}`
+    const filePath = import.meta.env.PROD ? `./dist/assets/${filename}` : `./public/assets/${filename}`
     const content = await fs.readFile(filePath);
-    const modifyDate = (await fs.stat(filePath))?.mtime?.toUTCString()?? new Date().toUTCString();
+    const modifyDate = (await fs.stat(filePath))?.mtime?.toUTCString() ?? new Date().toUTCString();
 
 
     const fileExt = filePath.split('.').pop()?.toLowerCase()
@@ -82,28 +82,28 @@ if(import.meta.env.PROD){
 
 app.use(renderer)
 app.get('/*', (c) => {
-  
+
   return c.render(
     <>
       {!c.req.path.startsWith('/admin') && <script src="https://g.alicdn.com/apsara-media-box/imp-interaction/1.6.1/alivc-im.iife.js"></script>}
       <div id="root"></div>
     </>
   )
-}) 
+})
 
-let exportDefault:any
-if(import.meta.env.PROD){
+let exportDefault: any
+if (import.meta.env.PROD) {
   exportDefault = {
     websocket: (httpServer: ServerType) => {
       // 创建 Socket.IO 服务器并集成到主服务
       new SocketIOServer({
-        server: httpServer 
+        server: httpServer
       });
     },
     fetch: app.fetch
   }
 }else if(!import.meta.hot){
   new SocketIOServer({});
-  exportDefault = app;
+    exportDefault = app; 
 }
 export default exportDefault