fix(): 增加登录

master
DongZeLiang 2024-09-13 16:34:35 +08:00
parent 3d99f27ca0
commit ebb12f9686
3 changed files with 15 additions and 10 deletions

View File

@ -54,11 +54,11 @@ service.interceptors.response.use(
})
// 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired;
if (res.code === 50008 || res.code === 50012 || res.code === 50014) {
if (res.code === 501 || res.code === 502 || res.code === 503) {
// to re-login
MessageBox.confirm('You have been logged out, you can cancel to stay on this page, or log in again', 'Confirm logout', {
confirmButtonText: 'Re-Login',
cancelButtonText: 'Cancel',
MessageBox.confirm('您已经注销,您可以取消以保留在此页面上,或再次登录', '确认注销', {
confirmButtonText: '重新登录',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
store.dispatch('user/resetToken').then(() => {

View File

@ -37,7 +37,8 @@
/>
</el-form-item>
<el-button :loading="loading" type="primary" style="width:100%;margin-bottom:30px;" @click.native.prevent="handleLogin">进入</el-button>
<el-button :loading="loading" type="primary" style="width:48%;margin-bottom:30px;" @click.native.prevent="handleLogin">登录系统</el-button>
<el-button :loading="loading" type="primary" style="width:48%;margin-bottom:30px; margin-left: 4%" @click.native.prevent="handleLogin">注册系统</el-button>
</el-form>
</div>

View File

@ -1,10 +1,14 @@
<template>
<template xmlns:el-col="http://www.w3.org/1999/html">
<div class="app-container">
<el-row :gutter="10" style="margin-bottom: 10px;padding: 0 10px">
<el-col :span="24">
<el-col style="padding-left: 0" :span="2">
<el-button @click="addVehicleDrawer = true">添加车辆</el-button>
</el-col>
<el-col :span="2">
<el-button type="primary" @click="genVehicleDialog = true">生成车辆</el-button>
</el-col>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="10">
@ -36,7 +40,7 @@
</el-row>
<div class="grid-content bg-purple" :style="{'height': contentHeight - 150 +'px'}">
<el-row :gutter="10">
<el-col v-for="vehicle in vehiclePage.rows" :span="12" style="margin: 0 0 10px 0;">
<el-col v-for="vehicle in vehiclePage.rows" :span="24" style="margin: 0 0 10px 0;">
<el-card class="box-card">
<div slot="header" class="clearfix">
<el-tag :type="!vehicle.online ? 'info' : 'success'" style="padding-left: 0; padding-right: 0">
@ -208,7 +212,7 @@
<h3 style="color: red">一行一个VIN多VIN进行换行</h3>
<el-form ref="form" :model="addForm" label-position="top" label-width="80px">
<el-form-item label="车辆VIN">
<el-input v-model="addForm.vinStr" type="textarea" :rows="35" />
<el-input v-model="addForm.vinStr" type="textarea" :rows="20" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="vehicleCreate"></el-button>