refine imports and styles
This commit is contained in:
1 parent
f538780b91
commit
c9010effbb
47 files changed
+303
-337
No files matched your search
+112
-5
@@ -1,6 +1,113 @@
|
|||||||
node_modules
|
# Logs
|
||||||
.DS_Store
|
logs
|
||||||
|
*.log
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
lerna-debug.log*
|
||||||
|
|
||||||
|
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||||
|
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||||
|
|
||||||
|
# Runtime data
|
||||||
|
pids
|
||||||
|
*.pid
|
||||||
|
*.seed
|
||||||
|
*.pid.lock
|
||||||
|
|
||||||
|
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||||
|
lib-cov
|
||||||
|
|
||||||
|
# Coverage directory used by tools like istanbul
|
||||||
|
coverage
|
||||||
|
*.lcov
|
||||||
|
|
||||||
|
# nyc test coverage
|
||||||
|
.nyc_output
|
||||||
|
|
||||||
|
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
||||||
|
.grunt
|
||||||
|
|
||||||
|
# Bower dependency directory (https://bower.io/)
|
||||||
|
bower_components
|
||||||
|
|
||||||
|
# node-waf configuration
|
||||||
|
.lock-wscript
|
||||||
|
|
||||||
|
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
||||||
|
build/Release
|
||||||
|
|
||||||
|
# Dependency directories
|
||||||
|
node_modules/
|
||||||
|
jspm_packages/
|
||||||
|
|
||||||
|
# TypeScript v1 declaration files
|
||||||
|
typings/
|
||||||
|
|
||||||
|
# TypeScript cache
|
||||||
|
*.tsbuildinfo
|
||||||
|
|
||||||
|
# Optional npm cache directory
|
||||||
|
.npm
|
||||||
|
|
||||||
|
# Optional eslint cache
|
||||||
|
.eslintcache
|
||||||
|
|
||||||
|
# Microbundle cache
|
||||||
|
.rpt2_cache/
|
||||||
|
.rts2_cache_cjs/
|
||||||
|
.rts2_cache_es/
|
||||||
|
.rts2_cache_umd/
|
||||||
|
|
||||||
|
# Optional REPL history
|
||||||
|
.node_repl_history
|
||||||
|
|
||||||
|
# Output of 'npm pack'
|
||||||
|
*.tgz
|
||||||
|
|
||||||
|
# Yarn Integrity file
|
||||||
|
.yarn-integrity
|
||||||
|
|
||||||
|
# dotenv environment variables file
|
||||||
|
.env
|
||||||
|
.env.local
|
||||||
|
.env.test
|
||||||
|
.env.production
|
||||||
|
|
||||||
|
# parcel-bundler cache (https://parceljs.org/)
|
||||||
|
.cache
|
||||||
|
|
||||||
|
# Next.js build output
|
||||||
|
.next
|
||||||
|
|
||||||
|
# Nuxt.js build / generate output
|
||||||
|
.nuxt
|
||||||
dist
|
dist
|
||||||
dist-ssr
|
|
||||||
*.local
|
# Gatsby files
|
||||||
yarn-error.log
|
.cache/
|
||||||
|
# Comment in the public line in if your project uses Gatsby and *not* Next.js
|
||||||
|
# https://nextjs.org/blog/next-9-1#public-directory-support
|
||||||
|
# public
|
||||||
|
|
||||||
|
# vuepress build output
|
||||||
|
.vuepress/dist
|
||||||
|
|
||||||
|
# Serverless directories
|
||||||
|
.serverless/
|
||||||
|
|
||||||
|
# FuseBox cache
|
||||||
|
.fusebox/
|
||||||
|
|
||||||
|
# DynamoDB Local files
|
||||||
|
.dynamodb/
|
||||||
|
|
||||||
|
# TernJS port file
|
||||||
|
.tern-port
|
||||||
|
|
||||||
|
.idea
|
||||||
|
.DS_Store
|
||||||
|
package-lock.json
|
||||||
|
|
||||||
|
launch.json
|
||||||
|
temp
|
||||||
-10
@@ -2,16 +2,6 @@ server {
|
|||||||
listen 80;
|
listen 80;
|
||||||
server_name localhost;
|
server_name localhost;
|
||||||
|
|
||||||
location /api/v1/me {
|
|
||||||
proxy_pass https://auth.test.zhishuyun.com/api/v1/me;
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /api/v1/token {
|
|
||||||
proxy_pass https://auth.test.zhishuyun.com/api/v1/token;
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /api/ {
|
location /api/ {
|
||||||
proxy_pass http://data-backend:8000/api/;
|
proxy_pass http://data-backend:8000/api/;
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
|
|||||||
+2
-2
@@ -2,11 +2,11 @@
|
|||||||
"name": "zhishuyun-data",
|
"name": "zhishuyun-data",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "cross-env NODE_ENV=$npm_config_env vite --host",
|
"start": "cross-env VITE_APP_ENV=$npm_config_env NODE_ENV=$npm_config_env vite --host",
|
||||||
"start:local": "npm run start --env=local",
|
"start:local": "npm run start --env=local",
|
||||||
"start:test": "npm run start --env=test",
|
"start:test": "npm run start --env=test",
|
||||||
"start:production": "npm run start --env=production",
|
"start:production": "npm run start --env=production",
|
||||||
"build": "cross-env NODE_ENV=$npm_config_env vue-tsc --noEmit --skipLibCheck && vite build",
|
"build": "cross-env VITE_APP_ENV=$npm_config_env NODE_ENV=$npm_config_env vue-tsc --noEmit --skipLibCheck && vite build",
|
||||||
"build:local": "npm run build --env=local",
|
"build:local": "npm run build --env=local",
|
||||||
"build:test": "npm run build --env=test",
|
"build:test": "npm run build --env=test",
|
||||||
"build:production": "npm run build --env=production",
|
"build:production": "npm run build --env=production",
|
||||||
|
|||||||
@@ -17,9 +17,6 @@ export default defineComponent({
|
|||||||
return {
|
return {
|
||||||
locale: zhCn
|
locale: zhCn
|
||||||
};
|
};
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.$store.dispatch('getMe');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@@ -36,8 +36,6 @@ import javaTemplate from '@/assets/templates/java.tpl';
|
|||||||
import CodeSnippet from '../common/CodeSnippet.vue';
|
import CodeSnippet from '../common/CodeSnippet.vue';
|
||||||
import queryString from 'query-string';
|
import queryString from 'query-string';
|
||||||
|
|
||||||
console.log('pythonTemplate', pythonTemplate);
|
|
||||||
|
|
||||||
interface IOption {
|
interface IOption {
|
||||||
name: ILang;
|
name: ILang;
|
||||||
icon: string;
|
icon: string;
|
||||||
|
|||||||
@@ -84,7 +84,7 @@
|
|||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import { ISchema } from '@/operators/api/models';
|
import { ISchema } from '@/operators/api/models';
|
||||||
import { IService } from '@/operators/service/models';
|
import { IService } from '@/operators/service/models';
|
||||||
import { applicationOperator, IApplication, IApplicationListResponse } from '@/operators';
|
import { IApplication } from '@/operators';
|
||||||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
||||||
|
|
||||||
interface IData {
|
interface IData {
|
||||||
@@ -140,7 +140,6 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onChange(key: string, val: string) {
|
onChange(key: string, val: string) {
|
||||||
console.log('key', key, val);
|
|
||||||
this.value[key] = val;
|
this.value[key] = val;
|
||||||
},
|
},
|
||||||
onRefreshApplications() {
|
onRefreshApplications() {
|
||||||
|
|||||||
@@ -71,14 +71,11 @@ export default defineComponent({
|
|||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// emits: ['change'],
|
|
||||||
data(): IData {
|
data(): IData {
|
||||||
return {
|
return {
|
||||||
value: {}
|
value: {}
|
||||||
};
|
};
|
||||||
},
|
}
|
||||||
watch: {},
|
|
||||||
methods: {}
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,6 @@ export default defineComponent({
|
|||||||
params: { ...this.form.queries },
|
params: { ...this.form.queries },
|
||||||
data: { ...this.form.body }
|
data: { ...this.form.body }
|
||||||
};
|
};
|
||||||
console.debug('config of testing', config);
|
|
||||||
axios(config)
|
axios(config)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
|||||||
@@ -59,7 +59,6 @@ import ApiResult from './Result.vue';
|
|||||||
import urlJoin from 'url-join';
|
import urlJoin from 'url-join';
|
||||||
import { applicationOperator } from '@/operators/application/operator';
|
import { applicationOperator } from '@/operators/application/operator';
|
||||||
import { IApplication, IApplicationListResponse } from '@/operators/application/models';
|
import { IApplication, IApplicationListResponse } from '@/operators/application/models';
|
||||||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
|
||||||
|
|
||||||
export interface IData {
|
export interface IData {
|
||||||
formValue: IForm;
|
formValue: IForm;
|
||||||
|
|||||||
@@ -1,182 +0,0 @@
|
|||||||
<template>
|
|
||||||
<el-card v-if="application && service" shadow="hover" class="card">
|
|
||||||
<div class="item">
|
|
||||||
<div class="icon">
|
|
||||||
<font-awesome-icon v-if="service.icon" :icon="service.icon" />
|
|
||||||
</div>
|
|
||||||
<div class="main">
|
|
||||||
<div class="title">
|
|
||||||
<router-link
|
|
||||||
:to="{
|
|
||||||
name: 'service-detail',
|
|
||||||
params: {
|
|
||||||
id: service.id
|
|
||||||
}
|
|
||||||
}"
|
|
||||||
>
|
|
||||||
{{ service.title }}
|
|
||||||
</router-link>
|
|
||||||
</div>
|
|
||||||
<div class="key">
|
|
||||||
<span class="label">{{ $t('application.field.apiKey') }}</span>
|
|
||||||
<span class="value">{{ application.api_key }}</span>
|
|
||||||
<span class="copy">
|
|
||||||
<font-awesome-icon icon="fa-regular fa-copy" />
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class="remaining-count">
|
|
||||||
<span class="label">{{ $t('application.field.remainingCount') }}</span>
|
|
||||||
<span class="value">{{ application.remaining_count }}</span>
|
|
||||||
</div>
|
|
||||||
<div class="links">
|
|
||||||
<div class="link">
|
|
||||||
<font-awesome-icon icon="fa-regular fa-file-lines" class="label" />
|
|
||||||
<span class="text">{{ $t('application.button.document') }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="operations">
|
|
||||||
<div class="operation">
|
|
||||||
<router-link
|
|
||||||
:to="{
|
|
||||||
name: 'service-detail',
|
|
||||||
params: {
|
|
||||||
id: service.id
|
|
||||||
}
|
|
||||||
}"
|
|
||||||
>
|
|
||||||
<el-button type="danger">
|
|
||||||
{{ $t('application.button.buyMore') }}
|
|
||||||
</el-button>
|
|
||||||
</router-link>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts">
|
|
||||||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
|
||||||
import {
|
|
||||||
applicationOperator,
|
|
||||||
IApplication,
|
|
||||||
IApplicationDetailResponse,
|
|
||||||
IService,
|
|
||||||
IServiceDetailResponse,
|
|
||||||
serviceOperator
|
|
||||||
} from '@/operators';
|
|
||||||
import { defineComponent } from 'vue';
|
|
||||||
|
|
||||||
interface IData {
|
|
||||||
loading: boolean;
|
|
||||||
service: IService | undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default defineComponent({
|
|
||||||
name: 'ApplicationPreviewCard',
|
|
||||||
components: {
|
|
||||||
FontAwesomeIcon
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
application: {
|
|
||||||
type: Object as () => IApplication,
|
|
||||||
required: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data(): IData {
|
|
||||||
return {
|
|
||||||
loading: false,
|
|
||||||
service: undefined
|
|
||||||
};
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
if (this.application?.service_id)
|
|
||||||
serviceOperator.get(this.application.service_id).then(({ data: data }: { data: IServiceDetailResponse }) => {
|
|
||||||
this.service = data;
|
|
||||||
this.loading = false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
methods: {}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.card {
|
|
||||||
margin-bottom: 20px;
|
|
||||||
.item {
|
|
||||||
height: 200px;
|
|
||||||
display: flex;
|
|
||||||
$icon-size: 150px;
|
|
||||||
$icon-font-size: 50px;
|
|
||||||
.icon {
|
|
||||||
width: $icon-size;
|
|
||||||
height: $icon-size;
|
|
||||||
line-height: $icon-size;
|
|
||||||
font-size: $icon-font-size;
|
|
||||||
text-align: center;
|
|
||||||
margin: auto 0;
|
|
||||||
color: var(--el-color-primary);
|
|
||||||
}
|
|
||||||
.main {
|
|
||||||
padding: 0 15px;
|
|
||||||
position: relative;
|
|
||||||
flex-grow: 1;
|
|
||||||
.title {
|
|
||||||
font-size: 20px;
|
|
||||||
font-weight: 500;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
.key {
|
|
||||||
font-size: 14px;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
.label {
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
.value {
|
|
||||||
display: inline-block;
|
|
||||||
margin-left: 5px;
|
|
||||||
}
|
|
||||||
.copy {
|
|
||||||
display: inline-block;
|
|
||||||
margin-left: 5px;
|
|
||||||
color: #666;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.remaining-count {
|
|
||||||
font-size: 14px;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
.label {
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
.value {
|
|
||||||
display: inline-block;
|
|
||||||
margin-left: 5px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.links {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 5px;
|
|
||||||
left: 20px;
|
|
||||||
.link {
|
|
||||||
color: #666;
|
|
||||||
.label {
|
|
||||||
color: var(--el-color-primary);
|
|
||||||
}
|
|
||||||
.text {
|
|
||||||
cursor: pointer;
|
|
||||||
display: inline-block;
|
|
||||||
margin-left: 5px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.operations {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -18,6 +18,7 @@ export default defineComponent({
|
|||||||
default: ''
|
default: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
emits: ['update:show'],
|
||||||
watch: {
|
watch: {
|
||||||
show(val, oldVal) {
|
show(val, oldVal) {
|
||||||
if (val) {
|
if (val) {
|
||||||
|
|||||||
@@ -17,12 +17,14 @@
|
|||||||
$t('common.button.login')
|
$t('common.button.login')
|
||||||
}}</el-button>
|
}}</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="mt-3 pr-10 float-right">
|
<div v-else class="float-right">
|
||||||
|
<div class="console" @click="onConsole">
|
||||||
|
{{ $t('common.button.console') }}
|
||||||
|
</div>
|
||||||
<el-dropdown trigger="click">
|
<el-dropdown trigger="click">
|
||||||
<img :src="user?.avatar || defaultAvatar" class="avatar" />
|
<img :src="user?.avatar || defaultAvatar" class="avatar" />
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<el-dropdown-menu>
|
<el-dropdown-menu>
|
||||||
<el-dropdown-item @click="onConsole">{{ $t('common.button.console') }}</el-dropdown-item>
|
|
||||||
<el-dropdown-item @click="onProfile">{{ $t('common.button.profile') }}</el-dropdown-item>
|
<el-dropdown-item @click="onProfile">{{ $t('common.button.profile') }}</el-dropdown-item>
|
||||||
<el-dropdown-item @click="onVerify">{{ $t('common.button.verify') }}</el-dropdown-item>
|
<el-dropdown-item @click="onVerify">{{ $t('common.button.verify') }}</el-dropdown-item>
|
||||||
<el-dropdown-item @click="onLogout">{{ $t('common.button.logout') }}</el-dropdown-item>
|
<el-dropdown-item @click="onLogout">{{ $t('common.button.logout') }}</el-dropdown-item>
|
||||||
@@ -39,6 +41,9 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import defaultAvatar from '@/assets/images/avatar.png';
|
import defaultAvatar from '@/assets/images/avatar.png';
|
||||||
|
import { getAuthBaseUrl } from '@/utils';
|
||||||
|
import { ROUTE_AUTH_LOGIN, ROUTE_CONSOLE_ROOT, ROUTE_INDEX } from '@/router';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'TopHeader',
|
name: 'TopHeader',
|
||||||
data() {
|
data() {
|
||||||
@@ -61,28 +66,32 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
onHome() {
|
onHome() {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: 'home'
|
name: ROUTE_INDEX
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onLogin() {
|
onLogin() {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: 'login'
|
name: ROUTE_AUTH_LOGIN
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onProfile() {
|
onProfile() {
|
||||||
window.location.href = 'https://auth.test.zhishuyun.com/user/profile';
|
const authBaseUrl = getAuthBaseUrl();
|
||||||
|
window.open(`${authBaseUrl}/user/profile`, '_blank');
|
||||||
},
|
},
|
||||||
onVerify() {
|
onVerify() {
|
||||||
window.location.href = 'https://auth.test.zhishuyun.com/user/verify';
|
const authBaseUrl = getAuthBaseUrl();
|
||||||
|
window.open(`${authBaseUrl}/user/verify`, '_blank');
|
||||||
},
|
},
|
||||||
onConsole() {
|
onConsole() {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: 'console-application-list'
|
name: ROUTE_CONSOLE_ROOT
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onLogout() {
|
onLogout() {
|
||||||
this.$store.dispatch('resetAuth');
|
this.$store.dispatch('resetAuth');
|
||||||
this.$router.push('/');
|
this.$router.push({
|
||||||
|
name: ROUTE_INDEX
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -123,6 +132,18 @@ $height: 60px;
|
|||||||
height: 40px;
|
height: 40px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
margin-top: 10px;
|
||||||
|
margin-right: 20px;
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
.console {
|
||||||
|
color: white;
|
||||||
|
height: 60px;
|
||||||
|
line-height: 60px;
|
||||||
|
margin: 0 10px;
|
||||||
|
font-size: 14px;
|
||||||
|
display: inline-block;
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -6,6 +6,7 @@
|
|||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import { ElMessageBox } from 'element-plus';
|
import { ElMessageBox } from 'element-plus';
|
||||||
import { authOperator, ITokenResponse } from '@/operators';
|
import { authOperator, ITokenResponse } from '@/operators';
|
||||||
|
import { getAuthBaseUrl } from '@/utils';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'VerificationAlert',
|
name: 'VerificationAlert',
|
||||||
@@ -53,7 +54,8 @@ export default defineComponent({
|
|||||||
closeOnHashChange: false
|
closeOnHashChange: false
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
window.open('https://auth.test.zhishuyun.com/user/verify?redirect=' + window.location.href + '?refresh=1');
|
const authBaseUrl = getAuthBaseUrl();
|
||||||
|
window.open(`${authBaseUrl}/user/verify?redirect=` + window.location.href + '?refresh=1');
|
||||||
})
|
})
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { PropType } from 'vue';
|
import type { PropType } from 'vue';
|
||||||
import { defineComponent, computed, h } from 'vue';
|
import { defineComponent, computed, h } from 'vue';
|
||||||
|
|
||||||
import MarkdownIt, { Options as MarkdownItOptions } from 'markdown-it';
|
import MarkdownIt, { Options as MarkdownItOptions } from 'markdown-it';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
@@ -19,7 +18,6 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
setup(props, { attrs }) {
|
setup(props, { attrs }) {
|
||||||
const md = new MarkdownIt(props.options);
|
const md = new MarkdownIt(props.options);
|
||||||
|
|
||||||
const content = computed(() => {
|
const content = computed(() => {
|
||||||
const src = props.source;
|
const src = props.source;
|
||||||
return md?.render(src);
|
return md?.render(src);
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
import TopHeader from './TopHeader.vue';
|
|
||||||
import Breadcrumb from './Breadcrumb.vue';
|
|
||||||
import SuccessInfo from './SuccessInfo.vue';
|
|
||||||
import Pagination from './Pagination.vue';
|
|
||||||
export { TopHeader, Breadcrumb, SuccessInfo, Pagination };
|
|
||||||
@@ -33,6 +33,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import { Clock, User, Postcard } from '@element-plus/icons-vue';
|
import { Clock, User, Postcard } from '@element-plus/icons-vue';
|
||||||
|
import { ROUTE_CONSOLE_APPLICATION_LIST, ROUTE_CONSOLE_ORDER_LIST, ROUTE_INDEX } from '@/router';
|
||||||
|
|
||||||
interface ILink {
|
interface ILink {
|
||||||
key: string;
|
key: string;
|
||||||
@@ -58,13 +59,13 @@ export default defineComponent({
|
|||||||
{
|
{
|
||||||
key: 'profile',
|
key: 'profile',
|
||||||
text: this.$t('console.menu.orderList'),
|
text: this.$t('console.menu.orderList'),
|
||||||
name: 'console-order-list',
|
name: ROUTE_CONSOLE_ORDER_LIST,
|
||||||
icon: 'user'
|
icon: 'user'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'verify',
|
key: 'verify',
|
||||||
text: this.$t('console.menu.applicationList'),
|
text: this.$t('console.menu.applicationList'),
|
||||||
name: 'console-application-list',
|
name: ROUTE_CONSOLE_APPLICATION_LIST,
|
||||||
icon: 'postcard'
|
icon: 'postcard'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -79,7 +80,7 @@ export default defineComponent({
|
|||||||
methods: {
|
methods: {
|
||||||
onHome() {
|
onHome() {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: 'home'
|
name: ROUTE_INDEX
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<el-link type="primary" class="link" :underline="false">
|
<el-link type="primary" class="link" :underline="false">
|
||||||
<span class="name">{{ document?.api?.title }}</span>
|
<span class="name">{{ document?.api?.title }}</span>
|
||||||
</el-link>
|
</el-link>
|
||||||
<el-tag v-if="document?.api?.request?.method" type="primary" class="request-method" effect="dark">
|
<el-tag v-if="document?.api?.request?.method" type="primary" class="method" effect="dark">
|
||||||
{{ document?.api?.request?.method }}
|
{{ document?.api?.request?.method }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</div>
|
</div>
|
||||||
@@ -17,6 +17,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import { IDocument } from '@/operators/document/models';
|
import { IDocument } from '@/operators/document/models';
|
||||||
|
import { ROUTE_DOCUMENT_DETAIL } from '@/router';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'ApiListItem',
|
name: 'ApiListItem',
|
||||||
@@ -29,7 +30,7 @@ export default defineComponent({
|
|||||||
methods: {
|
methods: {
|
||||||
onClick() {
|
onClick() {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: 'document-detail',
|
name: ROUTE_DOCUMENT_DETAIL,
|
||||||
params: {
|
params: {
|
||||||
id: this.document.id
|
id: this.document.id
|
||||||
}
|
}
|
||||||
@@ -60,7 +61,7 @@ $height: 35px;
|
|||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.request-method {
|
.method {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 10px;
|
right: 10px;
|
||||||
top: 5px;
|
top: 5px;
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
import { IApplication, IOrderDetailResponse, orderOperator } from '@/operators';
|
import { IApplication, IOrderDetailResponse, orderOperator } from '@/operators';
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import { ElMessage } from 'element-plus';
|
import { ElMessage } from 'element-plus';
|
||||||
|
import { ROUTE_CONSOLE_ORDER_DETAIL } from '@/router';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'CreateOrderDialog',
|
name: 'CreateOrderDialog',
|
||||||
@@ -66,7 +67,7 @@ export default defineComponent({
|
|||||||
this.creating = false;
|
this.creating = false;
|
||||||
const order = data;
|
const order = data;
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: 'console-order-detail',
|
name: ROUTE_CONSOLE_ORDER_DETAIL,
|
||||||
params: {
|
params: {
|
||||||
id: order.id
|
id: order.id
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,5 +8,6 @@ export default {
|
|||||||
course: '课程',
|
course: '课程',
|
||||||
category: '分类',
|
category: '分类',
|
||||||
service: '服务',
|
service: '服务',
|
||||||
document: '文档'
|
document: '文档',
|
||||||
|
console: '控制台'
|
||||||
};
|
};
|
||||||
@@ -8,13 +8,7 @@
|
|||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'LayoutAuth',
|
name: 'LayoutAuth'
|
||||||
components: {},
|
|
||||||
data() {
|
|
||||||
return {};
|
|
||||||
},
|
|
||||||
computed: {},
|
|
||||||
methods: {}
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -15,18 +15,15 @@ export default defineComponent({
|
|||||||
name: 'LayoutConsole',
|
name: 'LayoutConsole',
|
||||||
components: {
|
components: {
|
||||||
Navigator
|
Navigator
|
||||||
},
|
}
|
||||||
data() {
|
|
||||||
return {};
|
|
||||||
},
|
|
||||||
computed: {},
|
|
||||||
methods: {}
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.container {
|
.container {
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
|
width: 100%;
|
||||||
|
max-width: initial;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header {
|
.header {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { TopHeader } from '@/components/common/index';
|
import TopHeader from '@/components/common/TopHeader.vue';
|
||||||
import BottomFooter from '@/components/common/BottomFooter.vue';
|
import BottomFooter from '@/components/common/BottomFooter.vue';
|
||||||
import DocumentList from '@/components/document/List.vue';
|
import DocumentList from '@/components/document/List.vue';
|
||||||
|
|
||||||
|
|||||||
@@ -11,10 +11,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { TopHeader } from '@/components/common/index';
|
import TopHeader from '@/components/common/TopHeader.vue';
|
||||||
import BottomFooter from '@/components/common/BottomFooter.vue';
|
import BottomFooter from '@/components/common/BottomFooter.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'LayoutCourse',
|
name: 'LayoutService',
|
||||||
components: {
|
components: {
|
||||||
TopHeader,
|
TopHeader,
|
||||||
BottomFooter
|
BottomFooter
|
||||||
|
|||||||
+2
-1
@@ -11,6 +11,8 @@ import './plugins/font-awesome';
|
|||||||
|
|
||||||
const app = createApp(App);
|
const app = createApp(App);
|
||||||
|
|
||||||
|
const env = import.meta.env.VITE_APP_ENV;
|
||||||
|
console.log('env', env);
|
||||||
app.use(router);
|
app.use(router);
|
||||||
app.use(store);
|
app.use(store);
|
||||||
app.use(ElementPlus);
|
app.use(ElementPlus);
|
||||||
@@ -18,5 +20,4 @@ app.use(i18n);
|
|||||||
app.use(dayjs, {
|
app.use(dayjs, {
|
||||||
formatString: 'YYYY-MM-DD HH:mm:ss'
|
formatString: 'YYYY-MM-DD HH:mm:ss'
|
||||||
});
|
});
|
||||||
// app.mixin(constants);
|
|
||||||
app.mount('#app');
|
app.mount('#app');
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import router from '@/router';
|
import router, { ROUTE_INDEX } from '@/router';
|
||||||
import store from '@/store';
|
import store from '@/store';
|
||||||
import axios, { AxiosInstance } from 'axios';
|
import axios, { AxiosInstance } from 'axios';
|
||||||
import { getCookie } from 'typescript-cookie';
|
import { getCookie } from 'typescript-cookie';
|
||||||
@@ -26,7 +26,11 @@ httpClient.interceptors.response.use(
|
|||||||
(error) => {
|
(error) => {
|
||||||
if (error?.response?.status === 401) {
|
if (error?.response?.status === 401) {
|
||||||
store.dispatch('resetAuth');
|
store.dispatch('resetAuth');
|
||||||
router.push('/');
|
setTimeout(() => {
|
||||||
|
router.push({
|
||||||
|
name: ROUTE_INDEX
|
||||||
|
});
|
||||||
|
}, 1000);
|
||||||
}
|
}
|
||||||
return Promise.reject(error);
|
return Promise.reject(error);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
<template>
|
|
||||||
<div></div>
|
|
||||||
</template>
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import { getCookie } from 'typescript-cookie';
|
import { getCookie } from 'typescript-cookie';
|
||||||
|
import { getAuthBaseUrl, getDataBaseUrl } from '@/utils';
|
||||||
|
|
||||||
interface IData {
|
interface IData {
|
||||||
accessToken: string | undefined;
|
accessToken: string | undefined;
|
||||||
@@ -12,7 +10,7 @@ interface IData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'Login',
|
name: 'AuthCallback',
|
||||||
data(): IData {
|
data(): IData {
|
||||||
return {
|
return {
|
||||||
accessToken: undefined,
|
accessToken: undefined,
|
||||||
@@ -30,15 +28,16 @@ export default defineComponent({
|
|||||||
this.$router.push(this.redirect);
|
this.$router.push(this.redirect);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const host = window.location.host;
|
console.debug('access token and refresh token not found, try to re-auth again');
|
||||||
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`
|
// 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}`;
|
||||||
const targetUrl = `https://auth.${subDomain}?redirect=${callbackUrl}`;
|
// redirect to auth service to get access token then redirect back
|
||||||
|
const targetUrl = `${authBaseUrl}?redirect=${callbackUrl}`;
|
||||||
window.location.href = targetUrl;
|
window.location.href = targetUrl;
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
methods: {}
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
<template>
|
|
||||||
<div></div>
|
|
||||||
</template>
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { getAuthBaseUrl, getDataBaseUrl } from '@/utils';
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
|
|
||||||
interface IData {
|
interface IData {
|
||||||
@@ -9,30 +7,21 @@ interface IData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'Login',
|
name: 'AuthLogin',
|
||||||
data(): IData {
|
data(): IData {
|
||||||
return {
|
return {
|
||||||
redirect: this.$route.query.redirect?.toString()
|
redirect: this.$route.query.redirect?.toString()
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
async mounted() {
|
async mounted() {
|
||||||
const host = window.location.host;
|
const dataBaseUrl = getDataBaseUrl();
|
||||||
const subDomain = import.meta.env.DEV ? 'test.zhishuyun.com' : host.substring(host.indexOf('.') + 1);
|
const authBaseUrl = getAuthBaseUrl();
|
||||||
// callback url used to init access token and then redirect back of `redirect`
|
// 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
|
// 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;
|
window.location.href = targetUrl;
|
||||||
},
|
},
|
||||||
methods: {}
|
methods: {}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.panel {
|
|
||||||
.title {
|
|
||||||
text-align: center;
|
|
||||||
font-size: 22px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
width="100px"
|
width="100px"
|
||||||
class-name="text-center"
|
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">
|
<template #default="scope">
|
||||||
<span class="key">{{ scope.row.api_key }}</span>
|
<span class="key">{{ scope.row.api_key }}</span>
|
||||||
<span class="copy">
|
<span class="copy">
|
||||||
@@ -88,7 +88,7 @@ interface IData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'ApplicationList',
|
name: 'ConsoleApplicationList',
|
||||||
components: {
|
components: {
|
||||||
FontAwesomeIcon,
|
FontAwesomeIcon,
|
||||||
Pagination,
|
Pagination,
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<el-skeleton />
|
<el-skeleton />
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="order">
|
<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.id')">{{ order?.id }}</el-descriptions-item>
|
||||||
<el-descriptions-item :label="$t('order.field.description')">
|
<el-descriptions-item :label="$t('order.field.description')">
|
||||||
{{ order?.description }}
|
{{ order?.description }}
|
||||||
@@ -184,6 +184,7 @@ export default defineComponent({
|
|||||||
min-height: 500px;
|
min-height: 500px;
|
||||||
}
|
}
|
||||||
.order {
|
.order {
|
||||||
|
padding-top: 50px;
|
||||||
.price {
|
.price {
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
|||||||
@@ -99,7 +99,7 @@
|
|||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from 'vue';
|
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 Pagination from '@/components/common/Pagination.vue';
|
||||||
import CopyToClipboard from '@/components/common/CopyToClipboard.vue';
|
import CopyToClipboard from '@/components/common/CopyToClipboard.vue';
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ export interface IData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
|
name: 'DocumentDetail',
|
||||||
components: {
|
components: {
|
||||||
ApiUsage,
|
ApiUsage,
|
||||||
ApiTry,
|
ApiTry,
|
||||||
|
|||||||
@@ -9,19 +9,19 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { IDocument, IDocumentListResponse } from '@/operators/document/models';
|
import { IDocument, IDocumentListResponse } from '@/operators/document/models';
|
||||||
import { documentOperator } from '@/operators/document/operator';
|
import { documentOperator } from '@/operators/document/operator';
|
||||||
|
import { ROUTE_DOCUMENT_DETAIL } from '@/router';
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
|
|
||||||
interface IData {
|
interface IData {
|
||||||
documents: IDocument[];
|
documents: IDocument[];
|
||||||
}
|
}
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: {},
|
name: 'DocumentIndex',
|
||||||
data(): IData {
|
data(): IData {
|
||||||
return {
|
return {
|
||||||
documents: []
|
documents: []
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {},
|
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getDocuments(0, 1);
|
this.getDocuments(0, 1);
|
||||||
},
|
},
|
||||||
@@ -38,7 +38,7 @@ export default defineComponent({
|
|||||||
if (this.documents.length > 0) {
|
if (this.documents.length > 0) {
|
||||||
const firstDocument = this.documents[0];
|
const firstDocument = this.documents[0];
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: 'document-detail',
|
name: ROUTE_DOCUMENT_DETAIL,
|
||||||
params: {
|
params: {
|
||||||
id: firstDocument.id
|
id: firstDocument.id
|
||||||
}
|
}
|
||||||
@@ -59,6 +59,7 @@ import { ElMessage } from 'element-plus';
|
|||||||
import { apiOperator } from '@/operators/api/operator';
|
import { apiOperator } from '@/operators/api/operator';
|
||||||
import { IApi, IApiListResponse } from '@/operators/api/models';
|
import { IApi, IApiListResponse } from '@/operators/api/models';
|
||||||
import MarkdownRenderer from '@/components/common/MarkdownRenderer.vue';
|
import MarkdownRenderer from '@/components/common/MarkdownRenderer.vue';
|
||||||
|
import { ROUTE_CONSOLE_APPLICATION_LIST } from '@/router';
|
||||||
|
|
||||||
interface IData {
|
interface IData {
|
||||||
service: IService | undefined;
|
service: IService | undefined;
|
||||||
@@ -115,7 +116,7 @@ export default defineComponent({
|
|||||||
ElMessage.success(this.$t('application.message.applySuccessfully'));
|
ElMessage.success(this.$t('application.message.applySuccessfully'));
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: 'console-application-list'
|
name: ROUTE_CONSOLE_APPLICATION_LIST
|
||||||
});
|
});
|
||||||
}, 2000);
|
}, 2000);
|
||||||
})
|
})
|
||||||
|
|||||||
+3
-13
@@ -1,27 +1,17 @@
|
|||||||
import { t } from '../i18n';
|
import { ROUTE_AUTH_CALLBACK, ROUTE_AUTH_LOGIN } from './constants';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
path: '/auth',
|
path: '/auth',
|
||||||
name: 'auth',
|
|
||||||
meta: {
|
|
||||||
title: t('common.nav.content')
|
|
||||||
},
|
|
||||||
component: () => import('@/layouts/Auth.vue'),
|
component: () => import('@/layouts/Auth.vue'),
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: 'login',
|
path: 'login',
|
||||||
name: 'auth-login',
|
name: ROUTE_AUTH_LOGIN,
|
||||||
meta: {
|
|
||||||
title: t('common.nav.article')
|
|
||||||
},
|
|
||||||
component: () => import('@/pages/auth/Login.vue')
|
component: () => import('@/pages/auth/Login.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'callback',
|
path: 'callback',
|
||||||
name: 'auth-callback',
|
name: ROUTE_AUTH_CALLBACK,
|
||||||
meta: {
|
|
||||||
title: t('common.nav.article')
|
|
||||||
},
|
|
||||||
component: () => import('@/pages/auth/Callback.vue')
|
component: () => import('@/pages/auth/Callback.vue')
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
+17
-4
@@ -1,24 +1,37 @@
|
|||||||
|
import {
|
||||||
|
ROUTE_CONSOLE_APPLICATION_LIST,
|
||||||
|
ROUTE_CONSOLE_ORDER_DETAIL,
|
||||||
|
ROUTE_CONSOLE_ORDER_LIST,
|
||||||
|
ROUTE_CONSOLE_ROOT
|
||||||
|
} from './constants';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
path: '/console',
|
path: '/console',
|
||||||
name: 'console',
|
|
||||||
meta: {
|
meta: {
|
||||||
auth: true
|
auth: true
|
||||||
},
|
},
|
||||||
component: () => import('@/layouts/Console.vue'),
|
component: () => import('@/layouts/Console.vue'),
|
||||||
children: [
|
children: [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
name: ROUTE_CONSOLE_ROOT,
|
||||||
|
redirect: {
|
||||||
|
name: ROUTE_CONSOLE_APPLICATION_LIST
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: 'orders',
|
path: 'orders',
|
||||||
name: 'console-order-list',
|
name: ROUTE_CONSOLE_ORDER_LIST,
|
||||||
component: () => import('@/pages/console/order/List.vue')
|
component: () => import('@/pages/console/order/List.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'orders/:id',
|
path: 'orders/:id',
|
||||||
name: 'console-order-detail',
|
name: ROUTE_CONSOLE_ORDER_DETAIL,
|
||||||
component: () => import('@/pages/console/order/Detail.vue')
|
component: () => import('@/pages/console/order/Detail.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'applications',
|
path: 'applications',
|
||||||
name: 'console-application-list',
|
name: ROUTE_CONSOLE_APPLICATION_LIST,
|
||||||
component: () => import('@/pages/console/application/List.vue')
|
component: () => import('@/pages/console/application/List.vue')
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
export const ROUTE_INDEX = 'ROUTE_INDEX';
|
||||||
|
|
||||||
|
export const ROUTE_AUTH_LOGIN = 'auth-login';
|
||||||
|
export const ROUTE_AUTH_CALLBACK = 'auth-callback';
|
||||||
|
|
||||||
|
export const ROUTE_CONSOLE_ROOT = 'console-root';
|
||||||
|
export const ROUTE_CONSOLE_ORDER_LIST = 'console-order-list';
|
||||||
|
export const ROUTE_CONSOLE_ORDER_DETAIL = 'console-order-detail';
|
||||||
|
export const ROUTE_CONSOLE_APPLICATION_LIST = 'console-application-list';
|
||||||
|
|
||||||
|
export const ROUTE_DOCUMENT_LIST = 'document-list';
|
||||||
|
export const ROUTE_DOCUMENT_DETAIL = 'document-detail';
|
||||||
|
|
||||||
|
export const ROUTE_SERVICE_LIST = 'service-list';
|
||||||
|
export const ROUTE_SERVICE_DETAIL = 'service-detail';
|
||||||
@@ -1,19 +1,17 @@
|
|||||||
|
import { ROUTE_DOCUMENT_DETAIL, ROUTE_DOCUMENT_LIST } from './constants';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
path: '/documents',
|
path: '/documents',
|
||||||
name: 'documents',
|
|
||||||
meta: {
|
|
||||||
auth: true
|
|
||||||
},
|
|
||||||
component: () => import('@/layouts/Document.vue'),
|
component: () => import('@/layouts/Document.vue'),
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
name: 'document-index',
|
name: ROUTE_DOCUMENT_LIST,
|
||||||
component: () => import('@/pages/document/Index.vue')
|
component: () => import('@/pages/document/List.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: ':id',
|
path: ':id',
|
||||||
name: 'document-detail',
|
name: ROUTE_DOCUMENT_DETAIL,
|
||||||
component: () => import('@/pages/document/Detail.vue')
|
component: () => import('@/pages/document/Detail.vue')
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
+9
-5
@@ -1,15 +1,18 @@
|
|||||||
import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router';
|
import { createRouter, createWebHistory } from 'vue-router';
|
||||||
import service from './service';
|
import service from './service';
|
||||||
import auth from './auth';
|
import auth from './auth';
|
||||||
import console from './console';
|
import console from './console';
|
||||||
import document from './document';
|
import document from './document';
|
||||||
import store from '@/store';
|
import store from '@/store';
|
||||||
|
import { ROUTE_AUTH_LOGIN, ROUTE_INDEX, ROUTE_SERVICE_LIST } from './constants';
|
||||||
|
|
||||||
const routes = [
|
const routes = [
|
||||||
{
|
{
|
||||||
path: '/',
|
path: '/',
|
||||||
name: 'home',
|
name: ROUTE_INDEX,
|
||||||
redirect: '/services'
|
redirect: {
|
||||||
|
name: ROUTE_SERVICE_LIST
|
||||||
|
}
|
||||||
},
|
},
|
||||||
service,
|
service,
|
||||||
auth,
|
auth,
|
||||||
@@ -19,7 +22,6 @@ const routes = [
|
|||||||
|
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
history: createWebHistory(),
|
history: createWebHistory(),
|
||||||
// history: createWebHashHistory(),
|
|
||||||
routes
|
routes
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -27,7 +29,7 @@ router.beforeEach((to, from, next) => {
|
|||||||
if (to.matched.some((record) => record.meta.auth)) {
|
if (to.matched.some((record) => record.meta.auth)) {
|
||||||
if (!store.getters.authenticated) {
|
if (!store.getters.authenticated) {
|
||||||
next({
|
next({
|
||||||
name: 'auth-login',
|
name: ROUTE_AUTH_LOGIN,
|
||||||
query: { redirect: to.fullPath }
|
query: { redirect: to.fullPath }
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@@ -39,3 +41,5 @@ router.beforeEach((to, from, next) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
export default router;
|
export default router;
|
||||||
|
|
||||||
|
export * from './constants';
|
||||||
@@ -1,19 +1,17 @@
|
|||||||
|
import { ROUTE_SERVICE_DETAIL, ROUTE_SERVICE_LIST, ROUTE_SERVICE_ROOT } from './constants';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
path: '/services',
|
path: '/services',
|
||||||
name: 'services',
|
|
||||||
meta: {
|
|
||||||
auth: true
|
|
||||||
},
|
|
||||||
component: () => import('@/layouts/Service.vue'),
|
component: () => import('@/layouts/Service.vue'),
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
name: 'service-list',
|
name: ROUTE_SERVICE_LIST,
|
||||||
component: () => import('@/pages/service/List.vue')
|
component: () => import('@/pages/service/List.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: ':id',
|
path: ':id',
|
||||||
name: 'service-detail',
|
name: ROUTE_SERVICE_DETAIL,
|
||||||
component: () => import('@/pages/service/Detail.vue')
|
component: () => import('@/pages/service/Detail.vue')
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
+1
-2
@@ -1,7 +1,6 @@
|
|||||||
import { createStore, ActionContext } from 'vuex';
|
import { createStore, ActionContext } from 'vuex';
|
||||||
import { IUser } from '@/operators/user/models';
|
|
||||||
import createPersistedState from 'vuex-persistedstate';
|
import createPersistedState from 'vuex-persistedstate';
|
||||||
import { userOperator } from '@/operators';
|
import { userOperator, IUser } from '@/operators';
|
||||||
|
|
||||||
export interface IState {
|
export interface IState {
|
||||||
accessToken: string | undefined;
|
accessToken: string | undefined;
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
import { getEnv } from './env';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get base url of app
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export const getDataBaseUrl = () => {
|
||||||
|
const env = getEnv();
|
||||||
|
if (env === 'local') {
|
||||||
|
return 'https://data.local.zhishuyun.com';
|
||||||
|
} else if (env === 'test') {
|
||||||
|
return 'https://data.test.zhishuyun.com';
|
||||||
|
} else {
|
||||||
|
return 'https://data.zhishuyun.com';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getAuthBaseUrl = () => {
|
||||||
|
const env = getEnv();
|
||||||
|
if (env === 'local') {
|
||||||
|
return 'https://auth.test.zhishuyun.com';
|
||||||
|
} else if (env === 'test') {
|
||||||
|
return 'https://auth.test.zhishuyun.com';
|
||||||
|
} else {
|
||||||
|
return 'https://auth.zhishuyun.com';
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
/**
|
||||||
|
* Get env of App, return local, test, production
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export const getEnv = () => {
|
||||||
|
return import.meta.env.VITE_APP_ENV;
|
||||||
|
};
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
export * from './baseUrl';
|
||||||
|
export * from './env';
|
||||||
|
export * from './mode';
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
/**
|
||||||
|
* Get mode of App, return development or production
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export const getMode = () => {
|
||||||
|
return import.meta.env.MODE;
|
||||||
|
};
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
docker-compose build
|
|
||||||
docker-compose push
|
|
||||||
cat deploy/test/deployment.yaml | sed 's/\${TAG}/'"$BUILD_NUMBER"'/g' | kubectl apply -f - || true
|
|
||||||
+1
-6
@@ -54,17 +54,12 @@ export default defineConfig({
|
|||||||
target: getDataEndpoint(),
|
target: getDataEndpoint(),
|
||||||
changeOrigin: true
|
changeOrigin: true
|
||||||
}
|
}
|
||||||
// '/ws': {
|
|
||||||
// target: 'ws://localhost:8000',
|
|
||||||
// changeOrigin: true,
|
|
||||||
// ws: true
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
vue(),
|
vue(),
|
||||||
string({
|
string({
|
||||||
include: ['**/*.md', '**/*.tpl', '**/*.theme', 'highlight.js/styles/*.css']
|
include: ['**/*.md', '**/*.tpl', '**/*.theme']
|
||||||
}),
|
}),
|
||||||
replace({
|
replace({
|
||||||
preventAssignment: true
|
preventAssignment: true
|
||||||
|
|||||||
Reference in new issue
Block a user