Skip to content

Commit 3916001

Browse files
committed
fix: login错误处理与eslint配置
1 parent 7c89ded commit 3916001

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

.eslintrc.cjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ module.exports = {
3131
'error',
3232
{
3333
html: {
34-
void: 'never',
34+
void: 'any',
3535
normal: 'always',
3636
component: 'always'
3737
},

index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
</head>
99
<body>
1010
<div id="app"></div>
11-
<script type="module" src="/src/main.ts"></script>
11+
<script type="module" src="./src/main.ts"></script>
1212
</body>
1313
</html>

src/views/user/login/LoginView.vue

+5-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ const state = reactive<ILoginForm>({
1313
})
1414
const src = ref()
1515
const onFinish = async (values: ILoginForm) => {
16-
Object.values(values).length === 3 ? await user.login(values) : await registerApi(values)
16+
try {
17+
Object.values(values).length === 3 ? await user.login(values) : await registerApi(values)
18+
} catch (error) {
19+
await getImg()
20+
}
1721
}
1822
1923
function transformArrayBufferToBase64(buffer: any) {

0 commit comments

Comments
 (0)