环境配置

This commit is contained in:
Leo_Ding 2025-09-30 09:55:13 +08:00
parent 44f1742797
commit 2d9558e5e6
17 changed files with 154 additions and 79 deletions

View File

@ -2,7 +2,7 @@
NODE_ENV=development
# app
VITE_TITLE=GuXuan-Admin
VITE_TITLE=HaHa-Admin
VITE_PUBLIC_PATH=/
VITE_OUT_DIR=dist
VITE_PERMISSION=false
@ -12,7 +12,7 @@ VITE_ROUTER_BASE=/
VITE_ROUTER_HISTORY=hash
# api
VITE_API_BASIC=
VITE_API_BASIC='http://10.10.1.6:8040'
VITE_API_HTTP=/api/v1/
# storage
VITE_STORAGE_NAMESPACE = gin-admin_local_

View File

@ -2,9 +2,9 @@
NODE_ENV=production
# app
VITE_TITLE=GuXuan-Admin
VITE_TITLE=HaHa-Admin
VITE_PUBLIC_PATH=/
VITE_OUT_DIR=dist
VITE_OUT_DIR=index
VITE_PERMISSION=true
# router

1
.gitignore vendored
View File

@ -9,6 +9,7 @@ lerna-debug.log*
node_modules
dist
index
dist-ssr
*.local
*/.vitepress/cache/**/*

View File

@ -1,8 +1,8 @@
# GuXuan-Admin-Template
# HaHa-Admin-Template
> GIN-Admin-vue is a frontend project for [gin-admin](https://github.com/LyricTian/gin-admin) base on Ant Design React.
![guxuan-admin-template](./demo.png)
![HaHa-Admin-template](./demo.png)
- [Preview](http://101.42.232.163:8040)
- Username: admin

View File

@ -4,7 +4,7 @@
<head>
<meta charset="UTF-8" />
<link rel="icon"
href="/favicon.ico" />
href="/logo-hahayun.png" />
<meta name="viewport"
content="width=device-width, initial-scale=1.0" />
<title></title>

4
package-lock.json generated
View File

@ -1,11 +1,11 @@
{
"name": "gin-admin",
"name": "HaHa-Admin",
"version": "1.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "gin-admin",
"name": "HaHa-Admin",
"version": "1.0.0",
"dependencies": {
"@ant-design/colors": "^7.0.0",

View File

@ -1,5 +1,5 @@
{
"name": "guxuan-admin",
"name": "HaHa-Admin",
"private": true,
"version": "1.0.0",
"scripts": {

BIN
public/logo-hahayun.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
src/assets/img2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

BIN
src/assets/imgs/tel.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

BIN
src/assets/imgs/yunying.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

BIN
src/assets/ylimg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

View File

@ -7,8 +7,8 @@
<div class="aside-body">
<img
alt=""
:src="assets('logos.png')" />
<h3>{{ $t('pages.layouts.userLayout.title') }}</h3>
:src="assets('ylimg.png')" />
<!-- <h3>{{ $t('pages.layouts.userLayout.title') }}</h3> -->
<!-- <p>Vue3 + Ant Design Vue + vite</p>-->
</div>
<div class="aside-footer">
@ -17,10 +17,9 @@
</div>
<div class="user-layout-main">
<div class="user-layout-content">
<div class="user-layout-top">
<!-- <div class="user-layout-top">
<div class="user-layout-header">{{ $t('login') }}</div>
<!-- <div class="user-layout-desc">欢迎使用{{ title }}</div>-->
</div>
</div> -->
<div class="user-layout-form">
<router-view></router-view>
</div>
@ -130,7 +129,7 @@ function handleLang(lang) {
&-body {
flex: 1;
text-align: center;
padding: 48px 0 0;
padding: 60px 0 0;
img {
width: 80%;
@ -162,7 +161,7 @@ function handleLang(lang) {
}
&-content {
width: 368px;
// width: 368px;
height: 440px;
}

View File

@ -3,7 +3,7 @@ import * as layouts from '@/layouts'
* 白名单
* @type {string[]}
*/
export const whiteList = ['login', 'logout', '404', 'users']
export const whiteList = ['login', 'logout', '404', 'users','plateform']
/**
* 未找到页面路由
@ -41,6 +41,14 @@ export const constantRoutes = [
title: '登录',
},
},
{
path: '/plateform',
name: 'plateform',
component: () => import('@/views/login/platForm.vue'),
meta: {
title: '平台选择',
},
},
],
},
{

View File

@ -1,69 +1,46 @@
<template>
<div>
<a-tabs>
<!-- 账号登录 -->
<a-tab-pane
key="account"
:tab="$t('pages.login.accountLogin.tab')">
<a-form
:model="formData"
:rules="formRules"
ref="formRef">
<a-form-item name="username">
<a-input
:placeholder="$t('pages.login.username.placeholder')"
v-model:value="formData.username"
size="large">
<template #prefix>
<user-outlined></user-outlined>
</template>
</a-input>
</a-form-item>
<a-form-item name="password">
<a-input
v-model:value="formData.password"
size="large"
type="password"
:placeholder="$t('pages.login.password.placeholder')"
@pressEnter="handleLogin">
<template #prefix>
<lock-outlined></lock-outlined>
</template>
</a-input>
</a-form-item>
<a-form-item name="captcha_code">
<a-space>
<a-input
v-model:value="formData.captcha_code"
size="large"
type="text"
:placeholder="$t('pages.login.captcha.placeholder')"
@pressEnter="handleLogin">
<div class="user-layout-header" style="font-size: 30px;font-weight: 500;">{{ $t('login') }}</div>
<a-tabs>
<!-- 账号登录 -->
<a-tab-pane key="account" :tab="$t('pages.login.accountLogin.tab')">
<a-form :model="formData" :rules="formRules" ref="formRef">
<a-form-item name="username">
<a-input :placeholder="$t('pages.login.username.placeholder')"
v-model:value="formData.username" size="large">
<template #prefix>
<safety-outlined />
<user-outlined></user-outlined>
</template>
</a-input>
<a-image
@click="getCaptcha"
:preview="false"
:width="140"
:height="42"
:src="captcha_img" />
</a-space>
</a-form-item>
<a-form-item>
<a-button
type="primary"
size="large"
block
:loading="loading"
@click="handleLogin"
>{{ $t('pages.login.submit') }}
</a-button>
</a-form-item>
</a-form>
</a-tab-pane>
</a-tabs>
</a-form-item>
<a-form-item name="password">
<a-input v-model:value="formData.password" size="large" type="password"
:placeholder="$t('pages.login.password.placeholder')" @pressEnter="handleLogin">
<template #prefix>
<lock-outlined></lock-outlined>
</template>
</a-input>
</a-form-item>
<a-form-item name="captcha_code">
<a-space>
<a-input v-model:value="formData.captcha_code" size="large" type="text"
:placeholder="$t('pages.login.captcha.placeholder')" @pressEnter="handleLogin">
<template #prefix>
<safety-outlined />
</template>
</a-input>
<a-image @click="getCaptcha" :preview="false" :width="140" :height="42"
:src="captcha_img" />
</a-space>
</a-form-item>
<a-form-item>
<a-button type="primary" size="large" block :loading="loading" @click="handleLogin">{{
$t('pages.login.submit') }}
</a-button>
</a-form-item>
</a-form>
</a-tab-pane>
</a-tabs>
</div>
</template>
@ -76,6 +53,7 @@ import { config } from '@/config'
import { useForm } from '@/hooks'
import { useAppStore, useRouterStore, useUserStore } from '@/store'
import { timeFix } from '@/utils/util'
import apis from '@/apis'
import { md5 } from 'js-md5'
import { useI18n } from 'vue-i18n'
@ -92,6 +70,8 @@ const route = useRoute()
const loading = ref(false)
const captcha_img = ref('')
const captcha_id = ref('')
const currentStep = ref(2) //
const httpApi = import.meta.env.BASE_URL + `api/v1/captcha/image`
const redirect = computed(() => decodeURIComponent(route.query?.redirect ?? ''))
@ -188,4 +168,35 @@ function goIndex() {
:deep(.ant-tabs-tab) {
font-size: 15px;
}
.user-layout-platform {
display: flex;
justify-content: space-around;
align-items: center;
gap: 20px;
width: 100%;
.platform-item {
display: flex;
flex-direction: column;
align-items: center;
width: 200px;
flex-shrink: 0; /* 防止元素被压缩 */
background: #415172;
border-radius: 8px;
font-size: 20px;
font-weight: 600;
color: #fff;
img {
width: 80px;
height: 80px;
margin-bottom: 10px;
}
span {
font-size: 16px;
font-weight: 500;
}
}
}
</style>

View File

@ -0,0 +1,56 @@
<template>
<div class="user-layout-platform">
<div v-for="value in plateformList" :key="value.title" class="platform-item">
<img :src="value.icon" alt="" />
<span>{{ value.title }}</span>
</div>
</div>
</template>
<script setup>
import { computed, onMounted, ref } from 'vue'
import tel from '@/assets/imgs/tel.png'
import jianguan from '@/assets/imgs/jianguan.png'
import yunying from '@/assets/imgs/yunying.png'
defineOptions({
name: 'login',
})
const plateformList = ref([
{ title: '呼叫中心', icon: tel },
{ title: '监管平台', icon: jianguan },
{ title: '运营平台', icon: yunying },
])
</script>
<style lang="less" scoped>
.user-layout-platform {
margin: 0 auto;
display: flex;
justify-content: space-around;
align-items: center;
gap: 20px;
width: 100%;
.platform-item {
display: flex;
flex-direction: column;
align-items: center;
width: 200px;
flex-shrink: 0; /* 防止元素被压缩 */
background: #415172;
border-radius: 8px;
font-size: 20px;
font-weight: 600;
color: #fff;
img {
width: 80px;
height: 80px;
margin-bottom: 10px;
}
span {
font-size: 16px;
font-weight: 500;
}
}
}
</style>