(filePath: string)
| 99 | * @author: 白雾茫茫丶 |
| 100 | */ |
| 101 | export const checkDirAndCreate = (filePath: string): void => { |
| 102 | const pathArr = filePath.split('/'); |
| 103 | let checkPath = '.'; |
| 104 | let item: string; |
| 105 | for (item of pathArr) { |
| 106 | checkPath += `/${item}`; |
| 107 | if (!fs.existsSync(checkPath)) { |
| 108 | fs.mkdirSync(checkPath); |
| 109 | } |
| 110 | } |
| 111 | }; |
| 112 | |
| 113 | /** |
| 114 | * @description: 获取客户端真实 IP |