Skip to content

Commit

Permalink
fix: kms check function
Browse files Browse the repository at this point in the history
  • Loading branch information
ikxin committed Aug 14, 2024
1 parent 6439f9f commit 0cb4d53
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion service/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const runVlmcs = ({
execFile(
`./service/binaries/vlmcs-${platform()}-${arch()}`,
[`${host}:${port}`, `-${protocol}`, `-l ${app}`],
{ timeout: 5 * 1000 },
{ timeout: 10 * 1000 },
(err, stdout) => {
resolve({
host,
Expand Down
13 changes: 7 additions & 6 deletions src/views/tools.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import { useAxios } from '@vueuse/integrations/useAxios'
const { t } = useI18n()
const formData = ref({
domain: 'kms.ikxin.com',
host: 'kms.8b5.cn',
port: '1688',
protocol: '6',
software: '1',
})
const formRules = computed((): Record<string, FieldRule | FieldRule[]> => {
return {
domain: {
host: {
required: true,
message: t('placeholder.domain'),
},
Expand Down Expand Up @@ -49,12 +49,13 @@ const handleSubmit = async data => {
if (data.errors === undefined) {
resultInfo.loading = true
try {
const { data } = await useAxios('http://localhost:3000/api/check', {
const { data } = await useAxios('/api/check', {
method: 'post',
data: formData.value,
headers: { 'Content-Type': 'multipart/form-data' },
})
Object.assign(resultInfo, data.value)
resultInfo.message = data.value.content
resultInfo.type = data.value.status ? 'success' : 'error'
resultInfo.visible = true
resultInfo.loading = false
} catch ({ code, message }) {
Expand All @@ -79,8 +80,8 @@ const handleSubmit = async data => {
@submit="handleSubmit"
auto-label-width
>
<AFormItem :label="t('label.domain')" field="domain">
<AInput v-model="formData.domain"></AInput>
<AFormItem :label="t('label.domain')" field="host">
<AInput v-model="formData.host"></AInput>
</AFormItem>
<AFormItem :label="t('label.port')" field="port">
<AInput v-model="formData.port"></AInput>
Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default defineConfig({
server: {
proxy: {
'/api': {
target: 'http://localhost:3000/',
target: 'https://kmstools.ikxin.com/',
changeOrigin: true,
},
},
Expand Down

0 comments on commit 0cb4d53

Please sign in to comment.