Skip to content

Commit

Permalink
Merge pull request #9 from besscroft/dev
Browse files Browse the repository at this point in the history
🐛修复 bug
  • Loading branch information
besscroft authored Sep 13, 2023
2 parents 3320b78 + 76061ca commit 59e2ecf
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ public void choice(DictChoiceParam param) {
this.updateById(dict);
}
}
redisTemplate.delete(CacheConstants.USER_BOOK_DICT + userId);
redisTemplate.delete(CacheConstants.USER_WRONG_WORK + userId);
}

@Override
Expand Down
4 changes: 3 additions & 1 deletion heming-web/layouts/admin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ const drawer = ref(null)
<v-app-bar dark>
<v-app-bar-nav-icon @click="drawer = !drawer"></v-app-bar-nav-icon>

<v-app-bar-title>嗯学英语</v-app-bar-title>
<v-app-bar-title>
<a font-ark cursor-pointer href="https://github.com/besscroft/enstudy" target="_blank">嗯学英语</a>
</v-app-bar-title>

<DarkToggle mr-4 />
</v-app-bar>
Expand Down
27 changes: 26 additions & 1 deletion heming-web/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,32 @@ definePageMeta({
<div font-ark mt-24 text-xl text-lime-400 cursor-pointer @click="router.push('/learn')">开始</div>
<div flex space-x-2 mt-24>
<DarkToggle />
<a i-carbon-logo-github href="https://github.com/besscroft" target="_blank" />
<ClientOnly>
<button flex items-center justify-center w-20 h-8 of-hidden rounded-3xl border-dashed border border-gray-400>
<a href="https://github.com/besscroft/enstudy" target="_blank" flex justify-center items-center>
<small class="text-[#d23669]">Star</small>
<span i-carbon-logo-github class="ml-2 !text-[22px]" />
</a>
</button>
</ClientOnly>
</div>
</div>
</template>

<style scoped>
button {
transition: all 0.25s;
div {
position: absolute;
transition: transform 0.35s;
}
div:nth-child(2) {
transform: translateY(35px);
}
}
button:hover {
border-style: solid;
border-color: #a0a0a0;
transition: all 0.25s;
}
</style>
4 changes: 4 additions & 0 deletions heming-web/pages/learn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ const getWord = async () => {
wordInfo.value = json.data
if (json.data?.content?.word?.content?.phrase?.phrases) {
phrases.value = json.data.content.word.content.phrase.phrases
} else {
phrases.value = []
}
if (json.data?.content?.word?.content?.exam) {
exam.value = json.data.content.word.content.exam
} else {
exam.value = []
}
} else {
console.log(json.message)
Expand Down
5 changes: 4 additions & 1 deletion heming-web/pages/practise.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,15 @@ const getWorkWord = async () => {
const json = await nuxtApp.$api.get('/@api/book/getWorkWord').json();
if (json.code === 200) {
wordInfo.value = json.data
console.log(json.data)
if (json.data?.content?.word?.content?.phrase?.phrases) {
phrases.value = json.data.content.word.content.phrase.phrases
} else {
phrases.value = []
}
if (json.data?.content?.word?.content?.exam) {
exam.value = json.data.content.word.content.exam
} else {
exam.value = []
}
} else {
console.log(json.message)
Expand Down
2 changes: 0 additions & 2 deletions heming-web/plugins/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export default defineNuxtPlugin((nuxtApp) => {
const app = nuxtApp.vueApp
const userStore = useUserStore(app.$pinia)
const router = useRouter()
const toast = useToast()

const apiFetch = ky.extend({
timeout: 600000,
Expand All @@ -20,7 +19,6 @@ export default defineNuxtPlugin((nuxtApp) => {
const {response} = error
console.log(response.status);
if (response.status === 401) {
toast.add({ title: '登录已失效!', timeout: 2000, ui: { width: 'w-full sm:w-96' }})
router.push('/login')
}
return error
Expand Down

0 comments on commit 59e2ecf

Please sign in to comment.