diff --git a/src/renderer/index.html b/src/renderer/index.html index bec0a9f..9208158 100644 --- a/src/renderer/index.html +++ b/src/renderer/index.html @@ -8,7 +8,7 @@ http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:" /> --> - + diff --git a/src/renderer/src/components/choose-textbook/index.vue b/src/renderer/src/components/choose-textbook/index.vue index b0f04f0..9a86e68 100644 --- a/src/renderer/src/components/choose-textbook/index.vue +++ b/src/renderer/src/components/choose-textbook/index.vue @@ -30,7 +30,7 @@
- + {{ item.itemtitle }}
@@ -43,6 +43,7 @@ import { onMounted, ref, nextTick, toRaw } from 'vue'; import useUserStore from '@/store/modules/user' import { listEvaluation } from '@/api/subject' +const BaseUrl = 'https://prev.ysaix.com:7868/' // 定义要发送的emit事件 const emit = defineEmits(['nodeClick', 'changeBook']) // store @@ -269,9 +270,16 @@ const handleNodeClick = (data, node) => { } emit('nodeClick', curData) - } +// const getImageUrl = (url)=> { +// return new URL(replaceAll(url,'/src','@'), import.meta.url).href +// } +// const replaceAll = (str, find, replace)=> { +// return str.replace(new RegExp(find, 'g'), replace); +// } + + onMounted(() => { getSubjectContent() }) diff --git a/src/renderer/src/views/login/index.vue b/src/renderer/src/views/login/index.vue index aed6dab..9478a18 100644 --- a/src/renderer/src/views/login/index.vue +++ b/src/renderer/src/views/login/index.vue @@ -75,14 +75,15 @@ const submitForm = async (formEl) => { btnLoading.value = true // 勾选了需要记住密码设置在 cookie 中设置记住用户名和密码 if (loginForm.rememberMe) { - Cookies.set('username', loginForm.username, { expires: 30 }) - Cookies.set('password', encrypt(loginForm.password), { expires: 30 }) - Cookies.set('rememberMe', loginForm.rememberMe, { expires: 30 }) + localStorage.setItem('username', loginForm.username) + localStorage.setItem('password', encrypt(loginForm.password)) + localStorage.setItem('rememberMe', loginForm.rememberMe) + } else { // 否则移除 - Cookies.remove('username') - Cookies.remove('password') - Cookies.remove('rememberMe') + localStorage.removeItem('username') + localStorage.removeItem('password') + localStorage.removeItem('rememberMe') } try{ await userStore.login(loginForm) @@ -110,9 +111,9 @@ const successEditSubject = ()=>{ } const getCookie = () => { - const username = Cookies.get('username') - const password = Cookies.get('password') - const rememberMe = Cookies.get('rememberMe') + const username = localStorage.getItem('username') + const password = localStorage.getItem('password') + const rememberMe = localStorage.getItem('rememberMe') loginForm.username = username ? username : loginForm.username loginForm.password = password ? decrypt(password) : loginForm.password loginForm.rememberMe = rememberMe ? Boolean(rememberMe) : false diff --git a/src/renderer/src/views/resource/container/resoure-list.vue b/src/renderer/src/views/resource/container/resoure-list.vue index 10b7f04..35780ee 100644 --- a/src/renderer/src/views/resource/container/resoure-list.vue +++ b/src/renderer/src/views/resource/container/resoure-list.vue @@ -143,7 +143,6 @@ const addLesson = ({ id }) => { sourceStore.loading = false } } - // const handleRow = () =>{ ElMessage.warning('请先加入备课,在备课里面进行预览!')