Commit f306dd354fe5d3e7e7b29f1eb710faa005e70c96

Authored by sqy
1 parent 67e1cea4

'fix:修复通知不能正常跳转,和通知人显示不正确,feat:新增记住密码功能,隐藏二维码'

@@ -69,6 +69,7 @@ export default { @@ -69,6 +69,7 @@ export default {
69 backSignIn: 'Back sign in', 69 backSignIn: 'Back sign in',
70 mobileSignInFormTitle: 'Mobile sign in', 70 mobileSignInFormTitle: 'Mobile sign in',
71 qrSignInFormTitle: 'Qr code sign in', 71 qrSignInFormTitle: 'Qr code sign in',
  72 + userNameInFormTitle: 'userName sign in',
72 signInFormTitle: 'Sign in', 73 signInFormTitle: 'Sign in',
73 signUpFormTitle: 'Sign up', 74 signUpFormTitle: 'Sign up',
74 forgetFormTitle: 'Reset password', 75 forgetFormTitle: 'Reset password',
@@ -65,7 +65,7 @@ export default { @@ -65,7 +65,7 @@ export default {
65 qrSignInFormTitle: '二维码登录', 65 qrSignInFormTitle: '二维码登录',
66 signUpFormTitle: '注册', 66 signUpFormTitle: '注册',
67 forgetFormTitle: '重置密码', 67 forgetFormTitle: '重置密码',
68 - 68 + userNameInFormTitle: '账号登录',
69 signInTitle: '物联网平台', 69 signInTitle: '物联网平台',
70 signInDesc: '输入您的个人详细信息开始使用!', 70 signInDesc: '输入您的个人详细信息开始使用!',
71 policy: '我同意xxx隐私政策', 71 policy: '我同意xxx隐私政策',
1 import '/@/design/index.less'; 1 import '/@/design/index.less';
2 -  
3 // Register windi 2 // Register windi
4 import 'virtual:windi.css'; 3 import 'virtual:windi.css';
5 // Register icon sprite 4 // Register icon sprite
@@ -19,10 +18,6 @@ if (import.meta.env.DEV) { @@ -19,10 +18,6 @@ if (import.meta.env.DEV) {
19 } 18 }
20 async function bootstrap() { 19 async function bootstrap() {
21 const app = createApp(App); 20 const app = createApp(App);
22 -  
23 - // app.use(VueBaidu, {  
24 - // ak: '7uOPPyAHn2Y2ZryeQqHtcRqtIY374vKa',  
25 - // });  
26 // Configure store 21 // Configure store
27 setupStore(app); 22 setupStore(app);
28 23
@@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
15 > 15 >
16 <List item-layout="horizontal" :dataSource="dataSource"> 16 <List item-layout="horizontal" :dataSource="dataSource">
17 <template #renderItem="{ item }"> 17 <template #renderItem="{ item }">
18 - <ListItem> 18 + <ListItem @click="go('/notice/myNotices')" class="cursor-pointer">
19 <ListItemMeta> 19 <ListItemMeta>
20 <template #avatar> 20 <template #avatar>
21 <Avatar 21 <Avatar
@@ -24,11 +24,7 @@ @@ -24,11 +24,7 @@
24 /> 24 />
25 </template> 25 </template>
26 <template #description> 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 </template> 28 </template>
33 <template #title> 29 <template #title>
34 <span>{{ item.sysNotice.senderName }}</span> 30 <span>{{ item.sysNotice.senderName }}</span>
@@ -57,7 +57,7 @@ export const columns: BasicColumn[] = [ @@ -57,7 +57,7 @@ export const columns: BasicColumn[] = [
57 const enable = status === '已发布' ? '已发布' : status === '草稿' ? '草稿' : '其他'; 57 const enable = status === '已发布' ? '已发布' : status === '草稿' ? '草稿' : '其他';
58 const color = enable === '已发布' ? 'green' : enable === '草稿' ? 'yellow' : 'red'; 58 const color = enable === '已发布' ? 'green' : enable === '草稿' ? 'yellow' : 'red';
59 const text = enable === '已发布' ? '已发布' : enable === '草稿' ? '草稿' : '其他'; 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,7 +172,7 @@ export const searchFormSchema: FormSchema[] = [
172 export const detailColumns: BasicColumn[] = [ 172 export const detailColumns: BasicColumn[] = [
173 { 173 {
174 title: '接收者', 174 title: '接收者',
175 - dataIndex: 'user.realName', 175 + dataIndex: 'receiverName',
176 width: 200, 176 width: 200,
177 }, 177 },
178 { 178 {
@@ -38,7 +38,6 @@ @@ -38,7 +38,6 @@
38 <ForgetPasswordForm /> 38 <ForgetPasswordForm />
39 <RegisterForm /> 39 <RegisterForm />
40 <MobileForm /> 40 <MobileForm />
41 - <QrCodeForm />  
42 </div> 41 </div>
43 </div> 42 </div>
44 </div> 43 </div>
@@ -46,14 +45,13 @@ @@ -46,14 +45,13 @@
46 </div> 45 </div>
47 </template> 46 </template>
48 <script lang="ts" setup> 47 <script lang="ts" setup>
49 - import { computed, ref } from 'vue'; 48 + import { computed } from 'vue';
50 import { AppLogo } from '/@/components/Application'; 49 import { AppLogo } from '/@/components/Application';
51 import { AppLocalePicker, AppDarkModeToggle } from '/@/components/Application'; 50 import { AppLocalePicker, AppDarkModeToggle } from '/@/components/Application';
52 import LoginForm from './LoginForm.vue'; 51 import LoginForm from './LoginForm.vue';
53 import ForgetPasswordForm from './ForgetPasswordForm.vue'; 52 import ForgetPasswordForm from './ForgetPasswordForm.vue';
54 import RegisterForm from './RegisterForm.vue'; 53 import RegisterForm from './RegisterForm.vue';
55 import MobileForm from './MobileForm.vue'; 54 import MobileForm from './MobileForm.vue';
56 - import QrCodeForm from './QrCodeForm.vue';  
57 import { useGlobSetting } from '/@/hooks/setting'; 55 import { useGlobSetting } from '/@/hooks/setting';
58 import { useI18n } from '/@/hooks/web/useI18n'; 56 import { useI18n } from '/@/hooks/web/useI18n';
59 import { useDesign } from '/@/hooks/web/useDesign'; 57 import { useDesign } from '/@/hooks/web/useDesign';
@@ -49,13 +49,13 @@ @@ -49,13 +49,13 @@
49 </FormItem> 49 </FormItem>
50 <ARow class="enter-x flex justify-between"> 50 <ARow class="enter-x flex justify-between">
51 <ACol :md="11" :xs="24"> 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 </Button> 54 </Button>
55 </ACol> 55 </ACol>
56 <ACol :md="11" :xs="24"> 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 </Button> 59 </Button>
60 </ACol> 60 </ACol>
61 </ARow> 61 </ARow>
@@ -90,10 +90,10 @@ @@ -90,10 +90,10 @@
90 const formRef = ref(); 90 const formRef = ref();
91 const loading = ref(false); 91 const loading = ref(false);
92 const rememberMe = ref(false); 92 const rememberMe = ref(false);
93 - 93 + const userInfo = JSON.parse(localStorage.getItem('userInfo'));
94 const formData = reactive({ 94 const formData = reactive({
95 - account: '',  
96 - password: '', 95 + account: userInfo?.account ?? '',
  96 + password: userInfo?.password ?? '',
97 }); 97 });
98 98
99 const { validForm } = useFormValid(formRef); 99 const { validForm } = useFormValid(formRef);
@@ -103,6 +103,11 @@ @@ -103,6 +103,11 @@
103 async function handleLogin() { 103 async function handleLogin() {
104 const data = await validForm(); 104 const data = await validForm();
105 if (!data) return; 105 if (!data) return;
  106 + if (unref(rememberMe)) {
  107 + localStorage.setItem('userInfo', JSON.stringify(formData));
  108 + } else {
  109 + localStorage.setItem('userInfo', null);
  110 + }
106 try { 111 try {
107 loading.value = true; 112 loading.value = true;
108 const userInfo = await userStore.login({ 113 const userInfo = await userStore.login({