:add GCAuth

This commit is contained in:
wmn 2022-05-15 20:30:27 +08:00
parent a543f53122
commit 5e06dea4a3
6 changed files with 96 additions and 5 deletions

5
src/components.d.ts vendored
View File

@ -9,12 +9,15 @@ declare module '@vue/runtime-core' {
ACascader: typeof import('@arco-design/web-vue')['Cascader']
ADescriptions: typeof import('@arco-design/web-vue')['Descriptions']
ADrawer: typeof import('@arco-design/web-vue')['Drawer']
AForm: typeof import('@arco-design/web-vue')['Form']
AFormItem: typeof import('@arco-design/web-vue')['FormItem']
AInput: typeof import('@arco-design/web-vue')['Input']
AInputGroup: typeof import('@arco-design/web-vue')['InputGroup']
AInputNumber: typeof import('@arco-design/web-vue')['InputNumber']
AInputPassword: typeof import('@arco-design/web-vue')['InputPassword']
ALink: typeof import('@arco-design/web-vue')['Link']
AMenu: typeof import('@arco-design/web-vue')['Menu']
AMenuItem: typeof import('@arco-design/web-vue')['MenuItem']
ASelect: typeof import('@arco-design/web-vue')['Select']
ASpace: typeof import('@arco-design/web-vue')['Space']
ASubMenu: typeof import('@arco-design/web-vue')['SubMenu']
ATable: typeof import('@arco-design/web-vue')['Table']

View File

@ -0,0 +1,61 @@
<template>
<div :style="{ height: '20px' }"></div>
<a-form :model="form" :style="{ width: '600px' }" @submit="handleSubmit">
<a-form-item field="ip" label="地址">
<a-input-group>
<a-input :style="{ width: '80px' }" placeholder="" v-model="form.ssl" />
<a-input :style="{ width: '160px' }" placeholder="" v-model="form.ip" />
<a-input :style="{ width: '160px' }" placeholder="" v-model="form.path" />
</a-input-group>
</a-form-item>
<a-form-item field="username" label="用户名">
<a-input v-model="form.username" placeholder="please enter your username..." />
</a-form-item>
<a-form-item field="password" label="密码">
<a-input-password v-model="form.password" placeholder="Please enter something" allow-clear />
</a-form-item>
<a-form-item>
<a-space>
<a-button html-type="submit">提交</a-button>
<a-button @copyTocken="copyTocken">复制Tocken</a-button>
</a-space>
</a-form-item>
</a-form>
<!-- {{ form }} -->
</template>
<script setup lang="ts">
import { reactive, ref, computed } from 'vue'
import { Message } from '@arco-design/web-vue'
import axios from 'axios';
const form = reactive({
ssl: "https://",
ip: '',
path: "/authentication/login",
username: '',
password: '',
})
const handleSubmit = () => {
console.log(form)
var Url = `${form.ssl}${form.ip}${form.path}`
var data = {
username: form.username,
password: form.password,
}
axios.post(Url, data).then(res => {
console.log(res);
},
err => {
Message.error(err.message)
console.log(err);
}
)
}
const copyTocken = () => {
console.log(1);
}
</script>

View File

View File

@ -22,11 +22,17 @@ const datav = reactive([
])
const datav2 = reactive([
{ name: 'WSS连接', path: "/start/login" },
{ name: 'WSS连接', path: "/start/wss" },
{ name: '控制台', path: "/start/consoled" },
{ name: '在线人员', path: "/start/personnel" },
])
const datav3 = reactive([
{ name: '登录获取Tocken', path: "/start/login" },
{ name: '注册', path: "/start/register" },
{ name: '修改密码', path: "/start/changepassword" },
])
const GMTitle = ref("GM控制面板")
@ -64,7 +70,7 @@ watch(
</script>
<template>
<div class="nav ">
<a-menu showCollapseButton :default-open-keys="['0', '1']" :selected-keys="selectedKey">
<a-menu showCollapseButton :default-open-keys="['0', '1', '2']" :selected-keys="selectedKey">
<a-sub-menu key="0">
<template #icon>
<IconApps></IconApps>
@ -83,6 +89,15 @@ watch(
{{ item.name }}
</a-menu-item>
</a-sub-menu>
<a-sub-menu key="2">
<template #icon>
<IconApps></IconApps>
</template>
<template #title>GCAuth</template>
<a-menu-item v-for="(item, index) in datav3" :key="item.path" @click="topath(item.path)">
{{ item.name }}
</a-menu-item>
</a-sub-menu>
</a-menu>
</div>
</template>

View File

@ -40,7 +40,7 @@ let constantRoutes = [
component: () => import('@/pages/start/components/weapon.vue'),
},
{
path: "/start/login",
path: "/start/wss",
component: () => import('@/pages/login/index.vue'),
},
{
@ -50,6 +50,18 @@ let constantRoutes = [
{
path: "/start/personnel",
component: () => import('@/pages/start/components/personnel.vue'),
},
{
path: "/start/login",
component: () => import('@/pages/start/GCAuth/login.vue'),
},
{
path: "/start/register",
component: () => import('@/pages/start/GCAuth/register.vue'),
},
{
path: "/start/changepassword",
component: () => import('@/pages/start/GCAuth/changepassword.vue'),
}
]
}