refine imports and styles
This commit is contained in:
1 parent
f538780b91
commit
c9010effbb
47 files changed
+303
-337
No files matched your search
@@ -1,9 +1,7 @@
|
||||
<template>
|
||||
<div></div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import { getCookie } from 'typescript-cookie';
|
||||
import { getAuthBaseUrl, getDataBaseUrl } from '@/utils';
|
||||
|
||||
interface IData {
|
||||
accessToken: string | undefined;
|
||||
@@ -12,7 +10,7 @@ interface IData {
|
||||
}
|
||||
|
||||
export default defineComponent({
|
||||
name: 'Login',
|
||||
name: 'AuthCallback',
|
||||
data(): IData {
|
||||
return {
|
||||
accessToken: undefined,
|
||||
@@ -30,15 +28,16 @@ export default defineComponent({
|
||||
this.$router.push(this.redirect);
|
||||
}
|
||||
} else {
|
||||
const host = window.location.host;
|
||||
const subDomain = import.meta.env.DEV ? 'test.zhishuyun.com' : host.substring(host.indexOf('.') + 1);
|
||||
console.debug('access token and refresh token not found, try to re-auth again');
|
||||
const dataBaseUrl = getDataBaseUrl();
|
||||
const authBaseUrl = getAuthBaseUrl();
|
||||
// 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}`;
|
||||
const callbackUrl = `${dataBaseUrl}/auth/callback?redirect=${this.redirect}`;
|
||||
// redirect to auth service to get access token then redirect back
|
||||
const targetUrl = `${authBaseUrl}?redirect=${callbackUrl}`;
|
||||
window.location.href = targetUrl;
|
||||
}
|
||||
},
|
||||
methods: {}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<template>
|
||||
<div></div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { getAuthBaseUrl, getDataBaseUrl } from '@/utils';
|
||||
import { defineComponent } from 'vue';
|
||||
|
||||
interface IData {
|
||||
@@ -9,30 +7,21 @@ interface IData {
|
||||
}
|
||||
|
||||
export default defineComponent({
|
||||
name: 'Login',
|
||||
name: 'AuthLogin',
|
||||
data(): IData {
|
||||
return {
|
||||
redirect: this.$route.query.redirect?.toString()
|
||||
};
|
||||
},
|
||||
async mounted() {
|
||||
const host = window.location.host;
|
||||
const subDomain = import.meta.env.DEV ? 'test.zhishuyun.com' : host.substring(host.indexOf('.') + 1);
|
||||
const dataBaseUrl = getDataBaseUrl();
|
||||
const authBaseUrl = getAuthBaseUrl();
|
||||
// callback url used to init access token and then redirect back of `redirect`
|
||||
const callbackUrl = `https://${host}/auth/callback?redirect=${this.redirect}`;
|
||||
const callbackUrl = `${dataBaseUrl}/auth/callback?redirect=${this.redirect}`;
|
||||
// redirect to auth service to get access token then redirect back
|
||||
const targetUrl = `https://auth.${subDomain}?redirect=${callbackUrl}`;
|
||||
const targetUrl = `${authBaseUrl}?redirect=${callbackUrl}`;
|
||||
window.location.href = targetUrl;
|
||||
},
|
||||
methods: {}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.panel {
|
||||
.title {
|
||||
text-align: center;
|
||||
font-size: 22px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -28,7 +28,7 @@
|
||||
width="100px"
|
||||
class-name="text-center"
|
||||
/>
|
||||
<el-table-column :label="$t('application.field.apiKey')" class-name="api-key">
|
||||
<el-table-column :label="$t('application.field.apiKey')" class-name="api-key" width="320px">
|
||||
<template #default="scope">
|
||||
<span class="key">{{ scope.row.api_key }}</span>
|
||||
<span class="copy">
|
||||
@@ -88,7 +88,7 @@ interface IData {
|
||||
}
|
||||
|
||||
export default defineComponent({
|
||||
name: 'ApplicationList',
|
||||
name: 'ConsoleApplicationList',
|
||||
components: {
|
||||
FontAwesomeIcon,
|
||||
Pagination,
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<el-skeleton />
|
||||
</div>
|
||||
<div v-else class="order">
|
||||
<el-descriptions :title="$t('order.title.info')" :column="1">
|
||||
<el-descriptions :column="1">
|
||||
<el-descriptions-item :label="$t('order.field.id')">{{ order?.id }}</el-descriptions-item>
|
||||
<el-descriptions-item :label="$t('order.field.description')">
|
||||
{{ order?.description }}
|
||||
@@ -184,6 +184,7 @@ export default defineComponent({
|
||||
min-height: 500px;
|
||||
}
|
||||
.order {
|
||||
padding-top: 50px;
|
||||
.price {
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import { IOrder, IOrderListResponse, IOrderDetailResponse, orderOperator, OrderState } from '@/operators/order';
|
||||
import { IOrder, IOrderListResponse, orderOperator, OrderState } from '@/operators/order';
|
||||
import Pagination from '@/components/common/Pagination.vue';
|
||||
import CopyToClipboard from '@/components/common/CopyToClipboard.vue';
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ export interface IData {
|
||||
}
|
||||
|
||||
export default defineComponent({
|
||||
name: 'DocumentDetail',
|
||||
components: {
|
||||
ApiUsage,
|
||||
ApiTry,
|
||||
|
||||
@@ -9,19 +9,19 @@
|
||||
<script lang="ts">
|
||||
import { IDocument, IDocumentListResponse } from '@/operators/document/models';
|
||||
import { documentOperator } from '@/operators/document/operator';
|
||||
import { ROUTE_DOCUMENT_DETAIL } from '@/router';
|
||||
import { defineComponent } from 'vue';
|
||||
|
||||
interface IData {
|
||||
documents: IDocument[];
|
||||
}
|
||||
export default defineComponent({
|
||||
components: {},
|
||||
name: 'DocumentIndex',
|
||||
data(): IData {
|
||||
return {
|
||||
documents: []
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
mounted() {
|
||||
this.getDocuments(0, 1);
|
||||
},
|
||||
@@ -38,7 +38,7 @@ export default defineComponent({
|
||||
if (this.documents.length > 0) {
|
||||
const firstDocument = this.documents[0];
|
||||
this.$router.push({
|
||||
name: 'document-detail',
|
||||
name: ROUTE_DOCUMENT_DETAIL,
|
||||
params: {
|
||||
id: firstDocument.id
|
||||
}
|
||||
@@ -59,6 +59,7 @@ import { ElMessage } from 'element-plus';
|
||||
import { apiOperator } from '@/operators/api/operator';
|
||||
import { IApi, IApiListResponse } from '@/operators/api/models';
|
||||
import MarkdownRenderer from '@/components/common/MarkdownRenderer.vue';
|
||||
import { ROUTE_CONSOLE_APPLICATION_LIST } from '@/router';
|
||||
|
||||
interface IData {
|
||||
service: IService | undefined;
|
||||
@@ -115,7 +116,7 @@ export default defineComponent({
|
||||
ElMessage.success(this.$t('application.message.applySuccessfully'));
|
||||
setTimeout(() => {
|
||||
this.$router.push({
|
||||
name: 'console-application-list'
|
||||
name: ROUTE_CONSOLE_APPLICATION_LIST
|
||||
});
|
||||
}, 2000);
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user