vue2server7 7.0.104 → 7.0.106

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2server7",
3
- "version": "7.0.104",
3
+ "version": "7.0.106",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "dev": "nodemon --watch src --ext ts --exec \"ts-node src/app.ts\"",
package/test/231231 ADDED
@@ -0,0 +1,128 @@
1
+ <template>
2
+ <div class="error-page">
3
+ <div class="error-content">
4
+ <div class="illustration">
5
+ <svg viewBox="0 0 420 260" fill="none" xmlns="http://www.w3.org/2000/svg">
6
+ <path d="M120 75H310L292 155H95L120 75Z" stroke="#5B83F7" stroke-width="2" />
7
+ <path d="M135 90H290" stroke="#5B83F7" stroke-width="14" />
8
+ <path d="M104 110H150" stroke="#5B83F7" stroke-width="14" />
9
+ <path d="M292 110H345" stroke="#5B83F7" stroke-width="8" />
10
+ <path d="M306 135H335" stroke="#5B83F7" stroke-width="5" />
11
+ <path d="M260 175H355" stroke="#5B83F7" stroke-width="14" />
12
+ <path d="M85 168H250" stroke="#5B83F7" stroke-width="2" />
13
+ <circle cx="245" cy="122" r="43" fill="#6B8DFF" />
14
+ <path d="M230 107L260 137M260 107L230 137" stroke="white" stroke-width="10" stroke-linecap="round" />
15
+ <circle cx="65" cy="155" r="24" stroke="#5B83F7" stroke-width="2" />
16
+ <circle cx="95" cy="158" r="34" stroke="#5B83F7" stroke-width="2" />
17
+ <circle cx="95" cy="158" r="22" fill="#87A4FF" />
18
+ <path d="M48 155C20 150 25 130 50 132C74 134 85 143 92 154" stroke="#5B83F7" stroke-width="2" />
19
+ <path d="M30 185H118C124 185 129 190 129 196C129 202 124 207 118 207H82C76 207 71 212 71 218C71 224 76 229 82 229H52" stroke="#5B83F7" stroke-width="2" />
20
+ <path d="M40 196H155" stroke="#5B83F7" stroke-width="18" stroke-linecap="round" />
21
+ <path d="M92 190V222" stroke="#5B83F7" stroke-width="18" stroke-linecap="round" />
22
+ <path d="M58 223H115" stroke="#5B83F7" stroke-width="16" stroke-linecap="round" />
23
+ <path d="M270 223H330" stroke="#5B83F7" stroke-width="2" />
24
+ <path d="M280 210H310C318 210 325 217 325 225H275C275 217 276 210 280 210Z" fill="#5B83F7" />
25
+ <path d="M318 210H333" stroke="#5B83F7" stroke-width="2" />
26
+ <path d="M130 62L140 30H315L300 75" stroke="#5B83F7" stroke-width="2" />
27
+ <path d="M320 40L305 100" stroke="#5B83F7" stroke-width="2" />
28
+ <path d="M115 112L92 175" stroke="#5B83F7" stroke-width="2" />
29
+ <path d="M305 78H340" stroke="#476AD7" stroke-width="8" />
30
+ <circle cx="148" cy="48" r="3" fill="#5B83F7" />
31
+ <circle cx="162" cy="48" r="3" fill="#5B83F7" />
32
+ </svg>
33
+ </div>
34
+
35
+ <div class="text-box">
36
+ <h2>抱歉,服务器出错了</h2>
37
+ <el-button type="primary" class="back-btn" @click="goHome">
38
+ 返回首页
39
+ </el-button>
40
+ </div>
41
+ </div>
42
+ </div>
43
+ </template>
44
+
45
+ <script setup lang="ts">
46
+ import { useRouter } from 'vue-router'
47
+
48
+ const router = useRouter()
49
+
50
+ const goHome = (): void => {
51
+ router.push('/')
52
+ }
53
+ </script>
54
+
55
+ <style scoped>
56
+ .error-page {
57
+ width: 100%;
58
+ min-height: 100vh;
59
+ background: #f7f8fa;
60
+ display: flex;
61
+ align-items: center;
62
+ justify-content: center;
63
+ }
64
+
65
+ .error-content {
66
+ display: flex;
67
+ align-items: center;
68
+ gap: 110px;
69
+ transform: translateY(-20px);
70
+ }
71
+
72
+ .illustration {
73
+ width: 420px;
74
+ height: 260px;
75
+ }
76
+
77
+ .illustration svg {
78
+ width: 100%;
79
+ height: 100%;
80
+ display: block;
81
+ }
82
+
83
+ .text-box {
84
+ padding-top: 10px;
85
+ }
86
+
87
+ .text-box h2 {
88
+ margin: 0 0 28px;
89
+ font-size: 26px;
90
+ font-weight: 600;
91
+ color: #71809a;
92
+ letter-spacing: 1px;
93
+ }
94
+
95
+ .back-btn {
96
+ width: 118px;
97
+ height: 48px;
98
+ border-radius: 6px;
99
+ font-size: 16px;
100
+ background: #5b83f7;
101
+ border-color: #5b83f7;
102
+ }
103
+
104
+ .back-btn:hover,
105
+ .back-btn:focus {
106
+ background: #6b8dff;
107
+ border-color: #6b8dff;
108
+ }
109
+
110
+ @media (max-width: 768px) {
111
+ .error-content {
112
+ flex-direction: column;
113
+ gap: 24px;
114
+ }
115
+
116
+ .illustration {
117
+ width: 320px;
118
+ }
119
+
120
+ .text-box {
121
+ text-align: center;
122
+ }
123
+
124
+ .text-box h2 {
125
+ font-size: 22px;
126
+ }
127
+ }
128
+ </style>
@@ -0,0 +1,5 @@
1
+ <svg
2
+ viewBox="0 0 400 300"
3
+ fill="none"
4
+ xmlns="http://www.w3.org/2000/svg"
5
+ ><mask id="a" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="47" y="38" width="307" height="224"><path d="M353.3 38H47.5v223.8h305.8V38Z" fill="#fff"/></mask><g mask="url(#a)"><path fill-rule="evenodd" clip-rule="evenodd" d="M299.2 200.6H61.6v5.1h240.3l-2.7-5.1Z" fill="#C7DEFF"/><path d="m308.9 185.8-6.5 20H183.7M332.3 127.6h10.6l-5 16.7-14.8-.1-7.2 21.1M328.8 127.4l13.6-39.6M307.6 166 337 84.7H180.6l-9.8 26.9h-10.5M296.6 196l4.3-11.8M157.2 149.2l6.4-17.7" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M324.8 93.1H188.5l-34.8 95.8h136.4l34.7-95.8ZM169.9 166.2l5-13.6-5 13.6Z" fill="#fff"/><path d="m169.9 166.2 5-13.6" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M324.8 93.1H188.5l-4 11.7h135.8l4.5-11.7Z" fill="#006EFF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M102.6 159.5h38.3l2.7 36.6h-38.4c-10.1 0-20.9-8.2-20.9-18.3 0-10.1 8.2-18.3 18.3-18.3Z" fill="#DEEBFC"/><path fill-rule="evenodd" clip-rule="evenodd" d="M84.3 174.102c2.5 3.4 10 5 17.9 2.8 16.6-6.5 23.8-3.9 23.8-3.9s.5-3.4 1.3-5c-5.8-3-15.4.3-26.1 3.1-10.7 2.8-15.8-2.5-15.8-2.5-.4 0-1.1 2.8-1.1 5.5Z" fill="#fff"/><path d="M96.5 194.2c-7.2-3.3-12.2-10.5-12.2-19m0 0c0-11.5 9.3-20.8 20.8-20.8h29.4" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M140.3 195.1c-8.4-2.7-14.5-10.6-14.5-19.8l14.5 19.8Zm-14.5-19.8c0-11.5 9.3-20.8 20.8-20.8l-20.8 20.8Zm20.8-20.8c11.5 0 20.8 9.3 20.8 20.8l-20.8-20.8Zm20.8 20.8c0 8.4-5 15.6-12.1 18.9l12.1-18.9Z" fill="#fff"/><path d="M140.3 195.1c-8.4-2.7-14.5-10.6-14.5-19.8m0 0c0-11.5 9.3-20.8 20.8-20.8m0 0c11.5 0 20.8 9.3 20.8 20.8m0 0c0 8.4-5 15.6-12.1 18.9" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M161.5 177.2c0-7.7-6.3-14-14-14s-14 6.3-14 14c0 5.8 3.5 10.8 8.6 12.9.1 0 5.8 1.6 10.7 0 5.3-1.7 8.7-7.1 8.7-12.9Z" fill="#00E4E5"/><path d="M140.5 190.1c-5.8-2.4-9.9-8.2-9.9-14.9 0-8.9 7.2-16.1 16.1-16.1 8.9 0 16.1 7.2 16.1 16.1 0 6.8-4.2 12.5-10.1 14.9M88.4 170.604c2.9 1.3 7.7 2.6 13.6.3 14.7-5.7 22.3-4.3 24.6-3.5M84.5 174.599s5.9 6.5 19 1.7c9.2-3.4 15.3-3.9 18.8-3.8" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M340.6 112.3h-55.2l-2.7 6.2H338l2.6-6.2Z" fill="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M236.8 117.9c-16.13 0-29.2 13.07-29.2 29.2s13.07 29.2 29.2 29.2 29.2-13.07 29.2-29.2-13.07-29.2-29.2-29.2Z" fill="#00E4E5"/><path d="M265 123.3c13.1 13.1 13.1 34.4 0 47.6M306 205.9h19.2M61.7 205.9h32.9M181.2 196.2h115.2M47.5 205.9h10v-9.7h73.8" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M146.7 179.2c-2.49 0-4.5 2.01-4.5 4.5s2.01 4.5 4.5 4.5 4.5-2.01 4.5-4.5-2.01-4.5-4.5-4.5Z" fill="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M169.5 196.2c3.9 0 7.1 3.2 7.1 7.1 0 3.9-3.2 7.1-7.1 7.1H144c-2.1 0-3.9 1.7-3.9 3.9v1c0 2.1 1.7 3.9 3.9 3.9h48c5.1 0 9.2 4.1 9.2 9.2s-4.1 9.3-9.2 9.2h-33.8c-2.3 0-4.1 1.8-4.1 4.1s1.8 4.1 4.1 4.1h4.2c4.4 0 8 3.6 8 8s-3.6 8-8 8H111c-3.7 0-6.8-3-6.8-6.8 0-3.7 3-6.8 6.8-6.8h.3c2.3 0 4.1-1.8 4.1-4.1s-1.8-4.1-4.1-4.1H79c-4.5 0-8.1-3.6-8.1-8.1s3.6-8.1 8.1-8.1h37.7c2.1 0 3.9-1.7 3.9-3.9 0-2.1-1.7-3.9-3.9-3.9h-7.9c-4.4 0-7.9-3.5-7.9-7.9s3.5-7.9 7.9-7.9h30.4c2.2 0 3.9-1.8 3.9-3.9V187c0-1.9 1.6-3.5 3.5-3.5s3.5 1.6 3.5 3.5v5.3c0 2.2 1.8 3.9 3.9 3.9h15.5Z" fill="#006EFF"/><path d="m227.8 138.5 18.7 18.7M227.8 157.2l18.7-18.7" stroke="#fff" stroke-width="6"/><path fill-rule="evenodd" clip-rule="evenodd" d="M194.8 96.9c-.99 0-1.8.81-1.8 1.8s.81 1.8 1.8 1.8 1.8-.81 1.8-1.8-.81-1.8-1.8-1.8ZM202.9 96.9c-.99 0-1.8.81-1.8 1.8s.81 1.8 1.8 1.8 1.8-.81 1.8-1.8-.81-1.8-1.8-1.8Z" fill="#fff"/><path d="m291.7 184.3-1.6 4.6h-121M298.1 166.7l22.5-61.9" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="m193 134.1 2.2-5.1h-19.4l-2.3 5.1H193ZM313.2 123.5l2.2-5.1h-24.5l-2.3 5.1h24.6Z" fill="#DEEBFC"/><path d="m164.5 159.2 19.8-54.6" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M199.6 119.8h-53.2l-4.4 9.3h53.2l4.4-9.3Z" fill="#00E4E5"/><path d="M151.3 129.1H142l4.4-9.3h16.9" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M353.3 169.4h-67.4l-4.8 12.2h67.3l4.9-12.2Z" fill="#006EFF"/><path d="M332.4 169.4h20.9l-4.9 12.2h-39.7M242.7 235.5v-4.8c0-3.8 3.1-7 7-7h20.2c3.8 0 7 3.1 7 7" stroke="#071F4D"/><path d="M261.1 235.5v-4.8c0-3.8 3.1-7 7-7h13.7c3.8 0 7 3.1 7 7v4.8M242.6 230.7h13.7M235.2 237.7h63.3M224 237.7h6.7" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M324.1 141.3H335l3.3-10.7h-10.2l-4 10.7Z" fill="#C7DEFF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M288.3 230.4c0-3.6-2.9-6.5-6.5-6.5h-14.2c-3.6 0-6.5 2.9-6.5 6.5v5.3h27.2v-5.3Z" fill="#071F4D"/><path d="M80.4 228.5H83M87.7 228.5h19.2M146.3 195.8v2c0 3.6-2.9 6.6-6.6 6.6H138M133.4 204.3h1.5M154 249.9h9.4" stroke="#DEEBFC"/><path d="m299.4 141.9 5.1-13.9" stroke="#071F4D"/></g></svg>
@@ -0,0 +1,16 @@
1
+ <!-- 500页面 -->
2
+ <template>
3
+ <ArtException
4
+ :data="{
5
+ title: '500',
6
+ desc: $t('exceptionPage.500'),
7
+ btnText: $t('exceptionPage.gohome'),
8
+ imgUrl
9
+ }"
10
+ />
11
+ </template>
12
+
13
+ <script setup lang="ts">
14
+ import imgUrl from '@imgs/svg/500.svg'
15
+ defineOptions({ name: 'Exception500' })
16
+ </script>
@@ -0,0 +1,58 @@
1
+ function formatDate(input, format = 'YYYY-MM-DD HH:mm:ss') {
2
+ if (!input) return ''
3
+
4
+ let date
5
+
6
+ // Date对象
7
+ if (input instanceof Date) {
8
+ date = input
9
+ }
10
+ // 时间戳
11
+ else if (typeof input === 'number') {
12
+ // 秒级时间戳自动转毫秒
13
+ date = new Date(
14
+ input.toString().length === 10
15
+ ? input * 1000
16
+ : input
17
+ )
18
+ }
19
+ // 字符串
20
+ else if (typeof input === 'string') {
21
+ const value = input.trim()
22
+
23
+ // 纯数字字符串时间戳
24
+ if (/^\d+$/.test(value)) {
25
+ date = new Date(
26
+ value.length === 10
27
+ ? Number(value) * 1000
28
+ : Number(value)
29
+ )
30
+ } else {
31
+ // 兼容 Safari
32
+ date = new Date(
33
+ value.replace(/-/g, '/')
34
+ )
35
+ }
36
+ } else {
37
+ return ''
38
+ }
39
+
40
+ // 无效日期
41
+ if (isNaN(date.getTime())) {
42
+ return ''
43
+ }
44
+
45
+ const map = {
46
+ YYYY: date.getFullYear(),
47
+ MM: String(date.getMonth() + 1).padStart(2, '0'),
48
+ DD: String(date.getDate()).padStart(2, '0'),
49
+ HH: String(date.getHours()).padStart(2, '0'),
50
+ mm: String(date.getMinutes()).padStart(2, '0'),
51
+ ss: String(date.getSeconds()).padStart(2, '0')
52
+ }
53
+
54
+ return format.replace(
55
+ /YYYY|MM|DD|HH|mm|ss/g,
56
+ key => map[key]
57
+ )
58
+ }