Commit 17ded7a76abd2d50703ee04110c06c87101b54c8
Merge branch 'sqy_dev' into 'main'
'fix:修复通知不能正常跳转,和通知人显示不正确,feat:新增记住密码功能,隐藏二维码' See merge request huang/yun-teng-iot-front!144
Showing
7 changed files
with
19 additions
and
24 deletions
| ... | ... | @@ -69,6 +69,7 @@ export default { |
| 69 | 69 | backSignIn: 'Back sign in', |
| 70 | 70 | mobileSignInFormTitle: 'Mobile sign in', |
| 71 | 71 | qrSignInFormTitle: 'Qr code sign in', |
| 72 | + userNameInFormTitle: 'userName sign in', | |
| 72 | 73 | signInFormTitle: 'Sign in', |
| 73 | 74 | signUpFormTitle: 'Sign up', |
| 74 | 75 | forgetFormTitle: 'Reset password', | ... | ... |
| 1 | 1 | import '/@/design/index.less'; |
| 2 | - | |
| 3 | 2 | // Register windi |
| 4 | 3 | import 'virtual:windi.css'; |
| 5 | 4 | // Register icon sprite |
| ... | ... | @@ -19,10 +18,6 @@ if (import.meta.env.DEV) { |
| 19 | 18 | } |
| 20 | 19 | async function bootstrap() { |
| 21 | 20 | const app = createApp(App); |
| 22 | - | |
| 23 | - // app.use(VueBaidu, { | |
| 24 | - // ak: '7uOPPyAHn2Y2ZryeQqHtcRqtIY374vKa', | |
| 25 | - // }); | |
| 26 | 21 | // Configure store |
| 27 | 22 | setupStore(app); |
| 28 | 23 | ... | ... |
| ... | ... | @@ -15,7 +15,7 @@ |
| 15 | 15 | > |
| 16 | 16 | <List item-layout="horizontal" :dataSource="dataSource"> |
| 17 | 17 | <template #renderItem="{ item }"> |
| 18 | - <ListItem> | |
| 18 | + <ListItem @click="go('/notice/myNotices')" class="cursor-pointer"> | |
| 19 | 19 | <ListItemMeta> |
| 20 | 20 | <template #avatar> |
| 21 | 21 | <Avatar |
| ... | ... | @@ -24,11 +24,7 @@ |
| 24 | 24 | /> |
| 25 | 25 | </template> |
| 26 | 26 | <template #description> |
| 27 | - <span | |
| 28 | - class="cursor-pointer noticeTitle" | |
| 29 | - @click="go('/stationnotification/mynotification')" | |
| 30 | - >{{ item.sysNotice.title }} | |
| 31 | - </span> | |
| 27 | + <span class="cursor-pointer noticeTitle">{{ item.sysNotice.title }} </span> | |
| 32 | 28 | </template> |
| 33 | 29 | <template #title> |
| 34 | 30 | <span>{{ item.sysNotice.senderName }}</span> | ... | ... |
| ... | ... | @@ -57,7 +57,7 @@ export const columns: BasicColumn[] = [ |
| 57 | 57 | const enable = status === '已发布' ? '已发布' : status === '草稿' ? '草稿' : '其他'; |
| 58 | 58 | const color = enable === '已发布' ? 'green' : enable === '草稿' ? 'yellow' : 'red'; |
| 59 | 59 | const text = enable === '已发布' ? '已发布' : enable === '草稿' ? '草稿' : '其他'; |
| 60 | - return h(Tag, { color: color }, () => text); | |
| 60 | + return h(Tag, { color }, () => text); | |
| 61 | 61 | }, |
| 62 | 62 | }, |
| 63 | 63 | ]; |
| ... | ... | @@ -172,7 +172,7 @@ export const searchFormSchema: FormSchema[] = [ |
| 172 | 172 | export const detailColumns: BasicColumn[] = [ |
| 173 | 173 | { |
| 174 | 174 | title: '接收者', |
| 175 | - dataIndex: 'user.realName', | |
| 175 | + dataIndex: 'receiverName', | |
| 176 | 176 | width: 200, |
| 177 | 177 | }, |
| 178 | 178 | { | ... | ... |
| ... | ... | @@ -38,7 +38,6 @@ |
| 38 | 38 | <ForgetPasswordForm /> |
| 39 | 39 | <RegisterForm /> |
| 40 | 40 | <MobileForm /> |
| 41 | - <QrCodeForm /> | |
| 42 | 41 | </div> |
| 43 | 42 | </div> |
| 44 | 43 | </div> |
| ... | ... | @@ -46,14 +45,13 @@ |
| 46 | 45 | </div> |
| 47 | 46 | </template> |
| 48 | 47 | <script lang="ts" setup> |
| 49 | - import { computed, ref } from 'vue'; | |
| 48 | + import { computed } from 'vue'; | |
| 50 | 49 | import { AppLogo } from '/@/components/Application'; |
| 51 | 50 | import { AppLocalePicker, AppDarkModeToggle } from '/@/components/Application'; |
| 52 | 51 | import LoginForm from './LoginForm.vue'; |
| 53 | 52 | import ForgetPasswordForm from './ForgetPasswordForm.vue'; |
| 54 | 53 | import RegisterForm from './RegisterForm.vue'; |
| 55 | 54 | import MobileForm from './MobileForm.vue'; |
| 56 | - import QrCodeForm from './QrCodeForm.vue'; | |
| 57 | 55 | import { useGlobSetting } from '/@/hooks/setting'; |
| 58 | 56 | import { useI18n } from '/@/hooks/web/useI18n'; |
| 59 | 57 | import { useDesign } from '/@/hooks/web/useDesign'; | ... | ... |
| ... | ... | @@ -49,13 +49,13 @@ |
| 49 | 49 | </FormItem> |
| 50 | 50 | <ARow class="enter-x flex justify-between"> |
| 51 | 51 | <ACol :md="11" :xs="24"> |
| 52 | - <Button block @click="setLoginState(LoginStateEnum.MOBILE)"> | |
| 53 | - {{ t('sys.login.mobileSignInFormTitle') }} | |
| 52 | + <Button block @click="setLoginState(LoginStateEnum.LOGIN)"> | |
| 53 | + {{ t('sys.login.userNameInFormTitle') }} | |
| 54 | 54 | </Button> |
| 55 | 55 | </ACol> |
| 56 | 56 | <ACol :md="11" :xs="24"> |
| 57 | - <Button block @click="setLoginState(LoginStateEnum.QR_CODE)"> | |
| 58 | - {{ t('sys.login.qrSignInFormTitle') }} | |
| 57 | + <Button block @click="setLoginState(LoginStateEnum.MOBILE)"> | |
| 58 | + {{ t('sys.login.mobileSignInFormTitle') }} | |
| 59 | 59 | </Button> |
| 60 | 60 | </ACol> |
| 61 | 61 | </ARow> |
| ... | ... | @@ -90,10 +90,10 @@ |
| 90 | 90 | const formRef = ref(); |
| 91 | 91 | const loading = ref(false); |
| 92 | 92 | const rememberMe = ref(false); |
| 93 | - | |
| 93 | + const userInfo = JSON.parse(localStorage.getItem('userInfo')); | |
| 94 | 94 | const formData = reactive({ |
| 95 | - account: '', | |
| 96 | - password: '', | |
| 95 | + account: userInfo?.account ?? '', | |
| 96 | + password: userInfo?.password ?? '', | |
| 97 | 97 | }); |
| 98 | 98 | |
| 99 | 99 | const { validForm } = useFormValid(formRef); |
| ... | ... | @@ -103,6 +103,11 @@ |
| 103 | 103 | async function handleLogin() { |
| 104 | 104 | const data = await validForm(); |
| 105 | 105 | if (!data) return; |
| 106 | + if (unref(rememberMe)) { | |
| 107 | + localStorage.setItem('userInfo', JSON.stringify(formData)); | |
| 108 | + } else { | |
| 109 | + localStorage.setItem('userInfo', null); | |
| 110 | + } | |
| 106 | 111 | try { |
| 107 | 112 | loading.value = true; |
| 108 | 113 | const userInfo = await userStore.login({ | ... | ... |