Merge pull request 'lyc-dev' (#44) from lyc-dev into main
This commit is contained in:
commit
0228bc3084
|
@ -8,7 +8,7 @@
|
||||||
http-equiv="Content-Security-Policy"
|
http-equiv="Content-Security-Policy"
|
||||||
content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:"
|
content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:"
|
||||||
/> -->
|
/> -->
|
||||||
<meta http-equiv="Content-Security-Policy" content="connect-src *; default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob:" />
|
<meta http-equiv="Content-Security-Policy" content="connect-src *; default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src * 'self' data: blob:" />
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
<el-scrollbar height="450px">
|
<el-scrollbar height="450px">
|
||||||
<div class="textbook-item flex" v-for="item in subjectList" :class="curBookId == item.id ? 'active-item' : ''"
|
<div class="textbook-item flex" v-for="item in subjectList" :class="curBookId == item.id ? 'active-item' : ''"
|
||||||
:key="item.id" @click="changeBook(item)">
|
:key="item.id" @click="changeBook(item)">
|
||||||
<img :src="item.avartar" class="textbook-img" alt="">
|
<img :src="BaseUrl + item.avartar" class="textbook-img" alt="">
|
||||||
<span class="book-name">{{ item.itemtitle }}</span>
|
<span class="book-name">{{ item.itemtitle }}</span>
|
||||||
</div>
|
</div>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
|
@ -43,6 +43,7 @@ import { onMounted, ref, nextTick, toRaw } from 'vue';
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
import { listEvaluation } from '@/api/subject'
|
import { listEvaluation } from '@/api/subject'
|
||||||
|
|
||||||
|
const BaseUrl = 'https://prev.ysaix.com:7868/'
|
||||||
// 定义要发送的emit事件
|
// 定义要发送的emit事件
|
||||||
const emit = defineEmits(['nodeClick', 'changeBook'])
|
const emit = defineEmits(['nodeClick', 'changeBook'])
|
||||||
// store
|
// store
|
||||||
|
@ -269,9 +270,16 @@ const handleNodeClick = (data, node) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
emit('nodeClick', curData)
|
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(() => {
|
onMounted(() => {
|
||||||
getSubjectContent()
|
getSubjectContent()
|
||||||
})
|
})
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
<div class="avatar-container">
|
<div class="avatar-container">
|
||||||
<el-dropdown @command="handleCommand" class="right-menu-item hover-effect" trigger="click">
|
<el-dropdown @command="handleCommand" class="right-menu-item hover-effect" trigger="click">
|
||||||
<div class="avatar-wrapper">
|
<div class="avatar-wrapper">
|
||||||
<img :src="userImg" class="user-avatar" style="float: left;" />
|
<img :src="userStore.user.avatar" class="user-avatar" style="float: left;" />
|
||||||
<div style="margin-top: 18px; font-size: 0.8em;"> {{ userStore.user.nickName }}</div>
|
<div style="margin-top: 18px; font-size: 0.8em;"> {{ userStore.user.nickName }}</div>
|
||||||
</div>
|
</div>
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
|
@ -53,7 +53,6 @@ const { ipcRenderer } = window.electron || {}
|
||||||
const isMaxSize = ref(false)
|
const isMaxSize = ref(false)
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const currentRoute = ref('')
|
const currentRoute = ref('')
|
||||||
const userImg = ref(new URL(userStore.user.avatar, import.meta.url))
|
|
||||||
|
|
||||||
const menus = ref([
|
const menus = ref([
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,20 +4,18 @@ import { createApp } from 'vue'
|
||||||
|
|
||||||
import ElementPlus from 'element-plus'
|
import ElementPlus from 'element-plus'
|
||||||
import zhLocale from 'element-plus/es/locale/lang/zh-cn'
|
import zhLocale from 'element-plus/es/locale/lang/zh-cn'
|
||||||
import './utils/messageConfig'
|
|
||||||
import 'element-plus/dist/index.css'
|
import 'element-plus/dist/index.css'
|
||||||
import './assets/iconfont/iconfont.css'
|
import './assets/iconfont/iconfont.css'
|
||||||
import './assets/iconfont/iconfont'
|
import './assets/iconfont/iconfont'
|
||||||
|
|
||||||
import 'virtual:windi.css'
|
import 'virtual:windi.css'
|
||||||
|
|
||||||
import { store } from '@/store'
|
import { store } from '@/store'
|
||||||
import App from './App.vue'
|
import App from './App.vue'
|
||||||
|
|
||||||
import router from './router'
|
import router from './router'
|
||||||
|
|
||||||
const app = createApp(App)
|
const app = createApp(App)
|
||||||
|
|
||||||
|
|
||||||
app.use(router)
|
app.use(router)
|
||||||
.use(store)
|
.use(store)
|
||||||
.use(ElementPlus, { locale: zhLocale }).mount('#app')
|
.use(ElementPlus, { locale: zhLocale }).mount('#app')
|
|
@ -1,6 +0,0 @@
|
||||||
|
|
||||||
import { ElMessage } from 'element-plus';
|
|
||||||
|
|
||||||
ElMessage.defaultOptions = {
|
|
||||||
plain : true
|
|
||||||
}
|
|
|
@ -75,14 +75,15 @@ const submitForm = async (formEl) => {
|
||||||
btnLoading.value = true
|
btnLoading.value = true
|
||||||
// 勾选了需要记住密码设置在 cookie 中设置记住用户名和密码
|
// 勾选了需要记住密码设置在 cookie 中设置记住用户名和密码
|
||||||
if (loginForm.rememberMe) {
|
if (loginForm.rememberMe) {
|
||||||
Cookies.set('username', loginForm.username, { expires: 30 })
|
localStorage.setItem('username', loginForm.username)
|
||||||
Cookies.set('password', encrypt(loginForm.password), { expires: 30 })
|
localStorage.setItem('password', encrypt(loginForm.password))
|
||||||
Cookies.set('rememberMe', loginForm.rememberMe, { expires: 30 })
|
localStorage.setItem('rememberMe', loginForm.rememberMe)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// 否则移除
|
// 否则移除
|
||||||
Cookies.remove('username')
|
localStorage.removeItem('username')
|
||||||
Cookies.remove('password')
|
localStorage.removeItem('password')
|
||||||
Cookies.remove('rememberMe')
|
localStorage.removeItem('rememberMe')
|
||||||
}
|
}
|
||||||
try{
|
try{
|
||||||
await userStore.login(loginForm)
|
await userStore.login(loginForm)
|
||||||
|
@ -110,9 +111,9 @@ const successEditSubject = ()=>{
|
||||||
}
|
}
|
||||||
|
|
||||||
const getCookie = () => {
|
const getCookie = () => {
|
||||||
const username = Cookies.get('username')
|
const username = localStorage.getItem('username')
|
||||||
const password = Cookies.get('password')
|
const password = localStorage.getItem('password')
|
||||||
const rememberMe = Cookies.get('rememberMe')
|
const rememberMe = localStorage.getItem('rememberMe')
|
||||||
loginForm.username = username ? username : loginForm.username
|
loginForm.username = username ? username : loginForm.username
|
||||||
loginForm.password = password ? decrypt(password) : loginForm.password
|
loginForm.password = password ? decrypt(password) : loginForm.password
|
||||||
loginForm.rememberMe = rememberMe ? Boolean(rememberMe) : false
|
loginForm.rememberMe = rememberMe ? Boolean(rememberMe) : false
|
||||||
|
|
|
@ -143,7 +143,6 @@ const addLesson = ({ id }) => {
|
||||||
sourceStore.loading = false
|
sourceStore.loading = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
const handleRow = () =>{
|
const handleRow = () =>{
|
||||||
ElMessage.warning('请先加入备课,在备课里面进行预览!')
|
ElMessage.warning('请先加入备课,在备课里面进行预览!')
|
||||||
|
|
Loading…
Reference in New Issue