update preview

This commit is contained in:
AceDataCloud committed 2022-04-03 09:13:04 +08:00
1 parent 1eb713aaf4
commit 304201ef80
10 files changed
+83 -17

No files matched your search

+12 -1
View File
@@ -1,6 +1,16 @@
<template>
<div class="card">
<div class="left">
<div
class="left"
@click="
$router.push({
name: 'course-detail',
params: {
id: $route.params.courseId
}
})
"
>
<img :src="course.thumbnail" class="thumbnail" />
</div>
<div class="right">
@@ -37,6 +47,7 @@ export default defineComponent({
text-align: center;
width: 64px;
height: 64px;
cursor: pointer;
}
}
.right {
+5 -2
View File
@@ -30,8 +30,11 @@ export default defineComponent({
this.$router.push(this.redirect);
}
} else {
const currentUrl = window.location.href;
const targetUrl = `https://auth.zhishuyun.com?redirect=${currentUrl}`;
const host = window.location.host;
const subDomain = import.meta.env.DEV ? 'test.zhishuyun.com' : host.substring(host.indexOf('.') + 1);
// callback url used to init access token and then redirect back of `redirect`
const callbackUrl = `https://${host}/auth/callback?redirect=${this.redirect}`;
const targetUrl = `https://auth.${subDomain}?redirect=${callbackUrl}`;
window.location.href = targetUrl;
}
},
+1 -1
View File
@@ -17,7 +17,7 @@ export default defineComponent({
},
async mounted() {
const host = window.location.host;
const subDomain = host.substring(host.indexOf('.') + 1);
const subDomain = import.meta.env.DEV ? 'test.zhishuyun.com' : host.substring(host.indexOf('.') + 1);
// callback url used to init access token and then redirect back of `redirect`
const callbackUrl = `https://${host}/auth/callback?redirect=${this.redirect}`;
// redirect to auth service to get access token then redirect back
+2 -2
View File
@@ -16,8 +16,8 @@ const routes = [
];
const router = createRouter({
// history: createWebHistory(),
history: createWebHashHistory(),
history: createWebHistory(),
// history: createWebHashHistory(),
routes
});
+1 -2
View File
@@ -11,8 +11,7 @@ export interface IState {
const store = createStore({
state(): IState {
return {
accessToken:
'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjQ4ODUxMDc2LCJqdGkiOiI0ZGZkMjEzMzNmODY0MTEzYTRjZWZmMzI5NzAyMWFiZiIsInVzZXJfaWQiOjMsInBlcm1pc3Npb25zIjpbInZpZXdfYWNhZGVteV9jb3Vyc2UiXSwiaXNfc3VwZXJ1c2VyIjpmYWxzZX0.ZVEeeU-vZBGSQf4s-RJhnNItZHUmSw0MnsDp4Bgh9RI',
accessToken: undefined,
refreshToken: undefined,
user: undefined
};