49
49
<div class =" section-content" >
50
50
<div class =" bg-gray-50 dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-xl p-6 shadow-sm" >
51
51
<div class =" space-y-5" >
52
- <div class =" bg-white dark:bg-gray-700 border border-gray-200 dark:border-gray-600 rounded-lg p-5 flex items-center justify-between hover:shadow-md transition-all duration-150 ease-in-out hover:-translate-y-0.5" >
52
+ <div
53
+ class =" bg-white dark:bg-gray-700 border border-gray-200 dark:border-gray-600 rounded-lg p-5 flex items-center justify-between hover:shadow-md transition-all duration-150 ease-in-out hover:-translate-y-0.5" >
53
54
<div class =" flex items-center gap-4" >
54
- <div class =" w-12 h-12 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-xl flex items-center justify-center text-red-600 dark:text-red-400 text-xl" >
55
+ <div
56
+ class =" w-12 h-12 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-xl flex items-center justify-center text-red-600 dark:text-red-400 text-xl" >
55
57
🔄
56
58
</div >
57
59
<div >
58
60
<h4 class =" text-sm font-semibold text-gray-900 dark:text-white" >重置配置</h4 >
59
61
<p class =" text-xs text-gray-500 dark:text-gray-400 mt-1" >将所有设置恢复为默认值</p >
60
62
</div >
61
63
</div >
62
- <el-button
63
- type =" danger"
64
- size =" small"
64
+ <el-button type =" danger" size =" small"
65
65
class =" rounded-lg font-medium transition-all duration-150 ease-in-out hover:-translate-y-0.5"
66
- @click =" handleResetConfig"
67
- >
66
+ @click =" handleResetConfig" >
68
67
重置配置
69
68
</el-button >
70
69
</div >
71
70
72
- <div class =" bg-white dark:bg-gray-700 border border-gray-200 dark:border-gray-600 rounded-lg p-5 flex items-center justify-between hover:shadow-md transition-all duration-150 ease-in-out hover:-translate-y-0.5" >
71
+ <div
72
+ class =" bg-white dark:bg-gray-700 border border-gray-200 dark:border-gray-600 rounded-lg p-5 flex items-center justify-between hover:shadow-md transition-all duration-150 ease-in-out hover:-translate-y-0.5" >
73
73
<div class =" flex items-center gap-4" >
74
- <div class =" w-12 h-12 bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-xl flex items-center justify-center text-blue-600 dark:text-blue-400 text-xl" >
74
+ <div
75
+ class =" w-12 h-12 bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-xl flex items-center justify-center text-blue-600 dark:text-blue-400 text-xl" >
75
76
📤
76
77
</div >
77
78
<div >
78
79
<h4 class =" text-sm font-semibold text-gray-900 dark:text-white" >导出配置</h4 >
79
80
<p class =" text-xs text-gray-500 dark:text-gray-400 mt-1" >导出当前配置为 JSON 文件</p >
80
81
</div >
81
82
</div >
82
- <el-button
83
- type =" primary"
84
- size =" small"
83
+ <el-button type =" primary" size =" small"
85
84
class =" rounded-lg font-medium transition-all duration-150 ease-in-out hover:-translate-y-0.5"
86
85
:style =" { backgroundColor: config.primaryColor, borderColor: config.primaryColor }"
87
- @click =" handleExportConfig"
88
- >
86
+ @click =" handleExportConfig" >
89
87
导出配置
90
88
</el-button >
91
89
</div >
92
90
93
- <div class =" bg-white dark:bg-gray-700 border border-gray-200 dark:border-gray-600 rounded-lg p-5 flex items-center justify-between hover:shadow-md transition-all duration-150 ease-in-out hover:-translate-y-0.5" >
91
+ <div
92
+ class =" bg-white dark:bg-gray-700 border border-gray-200 dark:border-gray-600 rounded-lg p-5 flex items-center justify-between hover:shadow-md transition-all duration-150 ease-in-out hover:-translate-y-0.5" >
94
93
<div class =" flex items-center gap-4" >
95
- <div class =" w-12 h-12 bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-xl flex items-center justify-center text-green-600 dark:text-green-400 text-xl" >
94
+ <div
95
+ class =" w-12 h-12 bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-xl flex items-center justify-center text-green-600 dark:text-green-400 text-xl" >
96
96
📥
97
97
</div >
98
98
<div >
99
99
<h4 class =" text-sm font-semibold text-gray-900 dark:text-white" >导入配置</h4 >
100
100
<p class =" text-xs text-gray-500 dark:text-gray-400 mt-1" >从 JSON 文件导入配置</p >
101
101
</div >
102
102
</div >
103
- <el-upload
104
- ref =" uploadRef"
105
- :auto-upload =" false"
106
- :show-file-list =" false"
107
- accept =" .json"
108
- @change =" handleImportConfig"
109
- >
110
- <el-button
111
- type =" success"
112
- size =" small"
113
- class =" rounded-lg font-medium transition-all duration-150 ease-in-out hover:-translate-y-0.5"
114
- >
103
+ <el-upload ref =" uploadRef" :auto-upload =" false" :show-file-list =" false" accept =" .json"
104
+ @change =" handleImportConfig" >
105
+ <el-button type =" success" size =" small"
106
+ class =" rounded-lg font-medium transition-all duration-150 ease-in-out hover:-translate-y-0.5" >
115
107
导入配置
116
108
</el-button >
117
109
</el-upload >
131
123
<div class =" section-content" >
132
124
<div class =" bg-gray-50 dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-xl p-6 shadow-sm" >
133
125
<div class =" flex items-start gap-5" >
134
- <div class =" w-16 h-16 bg-white dark:bg-gray-700 border border-gray-200 dark:border-gray-600 rounded-xl flex items-center justify-center flex-shrink-0 shadow-sm" >
135
- <img
136
- src =" /logo.png"
137
- alt =" Gin-Vue-Admin Logo"
138
- class =" w-10 h-10 object-contain"
139
- @error =" handleLogoError"
140
- />
126
+ <div
127
+ class =" w-16 h-16 bg-white dark:bg-gray-700 border border-gray-200 dark:border-gray-600 rounded-xl flex items-center justify-center flex-shrink-0 shadow-sm" >
128
+ <Logo />
141
129
</div >
142
130
<div class =" flex-1" >
143
131
<h4 class =" text-xl font-semibold text-gray-900 dark:text-white mb-3" >Gin-Vue-Admin</h4 >
144
132
<p class =" text-sm text-gray-600 dark:text-gray-400 mb-5 leading-relaxed" >
145
133
基于 Vue3 + Gin 的全栈开发基础平台,提供完整的后台管理解决方案
146
134
</p >
147
135
<div class =" flex items-center gap-3 text-sm" >
148
- <a
149
- href =" https://github.com/flipped-aurora/gin-vue-admin"
150
- target =" _blank"
136
+ <a href =" https://github.com/flipped-aurora/gin-vue-admin" target =" _blank"
151
137
class =" font-medium transition-colors duration-150 hover:underline"
152
- :style =" { color: config.primaryColor }"
153
- >
138
+ :style =" { color: config.primaryColor }" >
154
139
GitHub 仓库
155
140
</a >
156
141
<span class =" text-gray-400 dark:text-gray-500" >·</span >
157
- <a
158
- href =" https://www.gin-vue-admin.com/"
159
- target =" _blank"
142
+ <a href =" https://www.gin-vue-admin.com/" target =" _blank"
160
143
class =" font-medium transition-colors duration-150 hover:underline"
161
- :style =" { color: config.primaryColor }"
162
- >
144
+ :style =" { color: config.primaryColor }" >
163
145
官方文档
164
146
</a >
165
147
</div >
172
154
</template >
173
155
174
156
<script setup>
175
- import { ref , computed , onMounted } from ' vue'
157
+ import { ref , onMounted } from ' vue'
176
158
import { ElMessage , ElMessageBox } from ' element-plus'
177
159
import { storeToRefs } from ' pinia'
178
160
import { useAppStore } from ' @/pinia'
161
+ import Logo from ' @/components/logo/index.vue'
179
162
180
163
defineOptions ({
181
164
name: ' GeneralSettings'
@@ -187,7 +170,6 @@ const uploadRef = ref()
187
170
188
171
const browserInfo = ref (' ' )
189
172
const screenResolution = ref (' ' )
190
- const logoUrl = ref (' ' )
191
173
192
174
onMounted (() => {
193
175
const userAgent = navigator .userAgent
@@ -206,10 +188,6 @@ onMounted(() => {
206
188
screenResolution .value = ` ${ screen .width } ×${ screen .height } `
207
189
})
208
190
209
- const handleLogoError = () => {
210
- logoUrl .value = ' '
211
- }
212
-
213
191
const handleResetConfig = async () => {
214
192
try {
215
193
await ElMessageBox .confirm (
@@ -221,7 +199,7 @@ const handleResetConfig = async () => {
221
199
type: ' warning'
222
200
}
223
201
)
224
-
202
+
225
203
appStore .resetConfig ()
226
204
ElMessage .success (' 配置已重置' )
227
205
} catch {
@@ -233,15 +211,15 @@ const handleExportConfig = () => {
233
211
const configData = JSON .stringify (config .value , null , 2 )
234
212
const blob = new Blob ([configData], { type: ' application/json' })
235
213
const url = URL .createObjectURL (blob)
236
-
214
+
237
215
const link = document .createElement (' a' )
238
216
link .href = url
239
217
link .download = ` gin-vue-admin-config-${ new Date ().toISOString ().split (' T' )[0 ]} .json`
240
218
document .body .appendChild (link)
241
219
link .click ()
242
220
document .body .removeChild (link)
243
221
URL .revokeObjectURL (url)
244
-
222
+
245
223
ElMessage .success (' 配置已导出' )
246
224
}
247
225
@@ -250,13 +228,13 @@ const handleImportConfig = (file) => {
250
228
reader .onload = (e ) => {
251
229
try {
252
230
const importedConfig = JSON .parse (e .target .result )
253
-
231
+
254
232
Object .keys (importedConfig).forEach (key => {
255
233
if (key in config .value ) {
256
234
config .value [key] = importedConfig[key]
257
235
}
258
236
})
259
-
237
+
260
238
ElMessage .success (' 配置已导入' )
261
239
} catch (error) {
262
240
ElMessage .error (' 配置文件格式错误' )
@@ -280,6 +258,7 @@ const handleImportConfig = (file) => {
280
258
opacity : 0 ;
281
259
transform : translateY (12px );
282
260
}
261
+
283
262
to {
284
263
opacity : 1 ;
285
264
transform : translateY (0 );
0 commit comments