Compare commits
No commits in common. "42b5ce887c54ee079efca6e60d1fc00f180e7196" and "107e90cbcb7ec876a90cd090d15c1966167c2143" have entirely different histories.
42b5ce887c
...
107e90cbcb
@ -1,10 +1,10 @@
|
|||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://github.com/mizhexiaoxiao/vue-fastapi-admin">
|
<a href="https://github.com/mizhexiaoxiao/vue-fastapi-admin">
|
||||||
<!-- <img alt="Vue FastAPI Admin Logo" width="200" src="https://github.com/mizhexiaoxiao/vue-fastapi-admin/blob/main/deploy/sample-picture/logo.svg"> -->
|
<img alt="Vue FastAPI Admin Logo" width="200" src="https://github.com/mizhexiaoxiao/vue-fastapi-admin/blob/main/deploy/sample-picture/logo.svg">
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<!-- <h1 align="center">vue-fastapi-admin</h1> -->
|
<h1 align="center">vue-fastapi-admin</h1>
|
||||||
|
|
||||||
English | [简体中文](./README.md)
|
English | [简体中文](./README.md)
|
||||||
|
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://github.com/mizhexiaoxiao/vue-fastapi-admin">
|
<a href="https://github.com/mizhexiaoxiao/vue-fastapi-admin">
|
||||||
<!-- <img alt="Vue FastAPI Admin Logo" width="200" src="https://github.com/mizhexiaoxiao/vue-fastapi-admin/blob/main/deploy/sample-picture/logo.svg"> -->
|
<img alt="Vue FastAPI Admin Logo" width="200" src="https://github.com/mizhexiaoxiao/vue-fastapi-admin/blob/main/deploy/sample-picture/logo.svg">
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<!-- <h1 align="center">vue-fastapi-admin</h1> -->
|
<h1 align="center">vue-fastapi-admin</h1>
|
||||||
|
|
||||||
[English](./README-en.md) | 简体中文
|
[English](./README-en.md) | 简体中文
|
||||||
|
|
||||||
|
|||||||
@ -17,7 +17,7 @@ export const PROXY_CONFIG = {
|
|||||||
* @转发路径 http://localhost:9999/api/v1/user
|
* @转发路径 http://localhost:9999/api/v1/user
|
||||||
*/
|
*/
|
||||||
'/api/v1': {
|
'/api/v1': {
|
||||||
target: 'http://124.222.245.240:8080',
|
target: 'http://127.0.0.1:9999',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
"name": "vue-fastapi-admin-web",
|
"name": "vue-fastapi-admin-web",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
|
|||||||
@ -5,13 +5,6 @@ export default {
|
|||||||
getUserInfo: () => request.get('/base/userinfo'),
|
getUserInfo: () => request.get('/base/userinfo'),
|
||||||
getUserMenu: () => request.get('/base/usermenu'),
|
getUserMenu: () => request.get('/base/usermenu'),
|
||||||
getUserApi: () => request.get('/base/userapi'),
|
getUserApi: () => request.get('/base/userapi'),
|
||||||
// 手机号
|
|
||||||
registerPhone: (data) => request.post('/app-user/register', data, { noNeedToken: true }),
|
|
||||||
loginPhone: (data) => request.post('/app-user/login', data, { noNeedToken: true }),
|
|
||||||
// pages
|
|
||||||
getIndustryList: () => request.get('/industry/list'),
|
|
||||||
getHistoryList: (params) => request.get('/app-valuations', { params }),
|
|
||||||
valuations: (data = {}) => request.post('/app-valuations', data),
|
|
||||||
// profile
|
// profile
|
||||||
updatePassword: (data = {}) => request.post('/base/update_password', data),
|
updatePassword: (data = {}) => request.post('/base/update_password', data),
|
||||||
// users
|
// users
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.3 MiB |
|
Before Width: | Height: | Size: 98 KiB |
|
Before Width: | Height: | Size: 71 KiB |
|
Before Width: | Height: | Size: 86 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 642 B |
|
Before Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 472 B |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 1.7 MiB |
|
Before Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 662 B |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
@ -6,7 +6,7 @@ const Layout = () => import('@/layout/index.vue')
|
|||||||
export const basicRoutes = [
|
export const basicRoutes = [
|
||||||
{
|
{
|
||||||
path: '/',
|
path: '/',
|
||||||
redirect: '/pages', // 默认跳转到首页
|
redirect: '/workbench', // 默认跳转到首页
|
||||||
meta: { order: 0 },
|
meta: { order: 0 },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -95,12 +95,6 @@ export const basicRoutes = [
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: 'pages',
|
|
||||||
path: '/pages',
|
|
||||||
component: () => import('@/views/pages/index.vue'),
|
|
||||||
isHidden: true,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: '403',
|
name: '403',
|
||||||
path: '/403',
|
path: '/403',
|
||||||
|
|||||||
@ -77,13 +77,13 @@ export const usePermissionStore = defineStore('permission', {
|
|||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
async generateRoutes() {
|
async generateRoutes() {
|
||||||
// const res = await api.getUserMenu() // 调用接口获取后端传来的菜单路由
|
const res = await api.getUserMenu() // 调用接口获取后端传来的菜单路由
|
||||||
// this.accessRoutes = buildRoutes(res.data) // 处理成前端路由格式
|
this.accessRoutes = buildRoutes(res.data) // 处理成前端路由格式
|
||||||
return this.accessRoutes
|
return this.accessRoutes
|
||||||
},
|
},
|
||||||
async getAccessApis() {
|
async getAccessApis() {
|
||||||
// const res = await api.getUserApi()
|
const res = await api.getUserApi()
|
||||||
// this.accessApis = res.data
|
this.accessApis = res.data
|
||||||
return this.accessApis
|
return this.accessApis
|
||||||
},
|
},
|
||||||
resetPermission() {
|
resetPermission() {
|
||||||
|
|||||||
@ -36,15 +36,14 @@ export const useUserStore = defineStore('user', {
|
|||||||
actions: {
|
actions: {
|
||||||
async getUserInfo() {
|
async getUserInfo() {
|
||||||
try {
|
try {
|
||||||
// const res = await api.getUserInfo()
|
const res = await api.getUserInfo()
|
||||||
// if (res.code === 401) {
|
if (res.code === 401) {
|
||||||
// this.logout()
|
this.logout()
|
||||||
// return
|
return
|
||||||
// }
|
}
|
||||||
// const { id, username, email, avatar, roles, is_superuser, is_active } = res.data
|
const { id, username, email, avatar, roles, is_superuser, is_active } = res.data
|
||||||
// this.userInfo = { id, username, email, avatar, roles, is_superuser, is_active }
|
this.userInfo = { id, username, email, avatar, roles, is_superuser, is_active }
|
||||||
// return res.data
|
return res.data
|
||||||
return {}
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return error
|
return error
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,5 +16,4 @@ export function createAxios(options = {}) {
|
|||||||
|
|
||||||
export const request = createAxios({
|
export const request = createAxios({
|
||||||
baseURL: import.meta.env.VITE_BASE_API,
|
baseURL: import.meta.env.VITE_BASE_API,
|
||||||
Authorization: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoxOCwicGhvbmUiOiIxNTg1MDIwMTEzOSIsImV4cCI6MTc2MDYzNTc0NX0.Z-2oCgVYlLo4JVuFLwNWqhj2iYyAvkZxWQp0h6AlhuI'
|
|
||||||
})
|
})
|
||||||
|
|||||||
@ -2,40 +2,49 @@
|
|||||||
<AppPage :show-footer="true" bg-cover :style="{ backgroundImage: `url(${bgImg})` }">
|
<AppPage :show-footer="true" bg-cover :style="{ backgroundImage: `url(${bgImg})` }">
|
||||||
<div
|
<div
|
||||||
style="transform: translateY(25px)"
|
style="transform: translateY(25px)"
|
||||||
class="m-auto max-w-1500 min-w-750 f-c-c rounded-12 bg-white bg-opacity-80"
|
class="m-auto max-w-1500 min-w-345 f-c-c rounded-10 bg-white bg-opacity-60 p-15 card-shadow"
|
||||||
dark:bg-dark
|
dark:bg-dark
|
||||||
>
|
>
|
||||||
<div w-750 px-20 style="height: 400px; padding-top: 50px; text-align: center;">
|
<div hidden w-380 px-20 py-35 md:block>
|
||||||
<img style="width: 371px; height: 60px; margin: auto;" src="@/assets/images/logo.png" alt="">
|
<icon-custom-front-page pt-10 text-300 color-primary></icon-custom-front-page>
|
||||||
<div mt-50 style="text-align: center; font-size: 48px; color: #303133; line-height: 48px; font-weight: 600; ">
|
</div>
|
||||||
非遗IP价值评估系统
|
|
||||||
</div>
|
<div w-320 flex-col px-20 py-35>
|
||||||
<div style="text-align: center; margin-top: 16px; color: #606266;">
|
<h5 f-c-c text-24 font-normal color="#6a6a6a">
|
||||||
基于深度学习算法的智能评估系统,为您的知识产权和非物质文化遗产提供专业的价值评估服务
|
<icon-custom-logo mr-10 text-50 color-primary />{{ $t('app_name') }}
|
||||||
|
</h5>
|
||||||
|
<div mt-30>
|
||||||
|
<n-input
|
||||||
|
v-model:value="loginInfo.username"
|
||||||
|
autofocus
|
||||||
|
class="h-50 items-center pl-10 text-16"
|
||||||
|
placeholder="admin"
|
||||||
|
:maxlength="20"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div mt-30>
|
<div mt-30>
|
||||||
<n-input
|
<n-input
|
||||||
v-model:value="loginInfo.phone"
|
v-model:value="loginInfo.password"
|
||||||
style="display: inline-block; width: 260px; height: 42px; text-align: left; line-height: 42px;"
|
class="h-50 items-center pl-10 text-16"
|
||||||
placeholder="请输入手机号"
|
type="password"
|
||||||
|
show-password-on="mousedown"
|
||||||
|
placeholder="123456"
|
||||||
:maxlength="20"
|
:maxlength="20"
|
||||||
@keypress.enter="handleRegister"
|
@keypress.enter="handleLogin"
|
||||||
>
|
/>
|
||||||
<template #prefix>
|
</div>
|
||||||
<img style="width: 18px; height: 18px; margin-right: 8px;" src="@/assets/images/phone.png" alt="">
|
|
||||||
</template>
|
|
||||||
</n-input>
|
|
||||||
|
|
||||||
|
<div mt-20>
|
||||||
<n-button
|
<n-button
|
||||||
w-126
|
h-50
|
||||||
h-42
|
w-full
|
||||||
rounded-5
|
rounded-5
|
||||||
|
text-16
|
||||||
type="primary"
|
type="primary"
|
||||||
style="background: linear-gradient( 93deg, #880C22 0%, #A30113 100%); margin-left: 20px; font-size: 16px; border: none !important;"
|
:loading="loading"
|
||||||
@click="handleRegister"
|
@click="handleLogin"
|
||||||
>
|
>
|
||||||
立即登录
|
{{ $t('views.login.text_login') }}
|
||||||
<img style="width: 18px; height: 18px; margin-left: 2px;" src="@/assets/images/go.png" alt="">
|
|
||||||
</n-button>
|
</n-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -45,7 +54,7 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { lStorage, setToken } from '@/utils'
|
import { lStorage, setToken } from '@/utils'
|
||||||
import bgImg from '@/assets/images/login_bg.png'
|
import bgImg from '@/assets/images/login_bg.webp'
|
||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import { addDynamicRoutes } from '@/router'
|
import { addDynamicRoutes } from '@/router'
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
@ -55,7 +64,8 @@ const { query } = useRoute()
|
|||||||
const { t } = useI18n({ useScope: 'global' })
|
const { t } = useI18n({ useScope: 'global' })
|
||||||
|
|
||||||
const loginInfo = ref({
|
const loginInfo = ref({
|
||||||
phone: '',
|
username: '',
|
||||||
|
password: '',
|
||||||
})
|
})
|
||||||
|
|
||||||
initLoginInfo()
|
initLoginInfo()
|
||||||
@ -63,34 +73,25 @@ initLoginInfo()
|
|||||||
function initLoginInfo() {
|
function initLoginInfo() {
|
||||||
const localLoginInfo = lStorage.get('loginInfo')
|
const localLoginInfo = lStorage.get('loginInfo')
|
||||||
if (localLoginInfo) {
|
if (localLoginInfo) {
|
||||||
loginInfo.value.phone = localLoginInfo.phone || ''
|
loginInfo.value.username = localLoginInfo.username || ''
|
||||||
loginInfo.value.password = localLoginInfo.password || ''
|
loginInfo.value.password = localLoginInfo.password || ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
|
async function handleLogin() {
|
||||||
async function handleRegister() {
|
const { username, password } = loginInfo.value
|
||||||
const { phone } = loginInfo.value
|
if (!username || !password) {
|
||||||
if (!phone) {
|
$message.warning(t('views.login.message_input_username_password'))
|
||||||
$message.warning('请输入手机号')
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
loading.value = true
|
try {
|
||||||
await api.registerPhone({ phone })
|
loading.value = true
|
||||||
.then(res=>{
|
$message.loading(t('views.login.message_verifying'))
|
||||||
handleLogin()
|
const res = await api.login({ username, password: password.toString() })
|
||||||
})
|
$message.success(t('views.login.message_login_success'))
|
||||||
.catch(res=>{
|
setToken(res.data.access_token)
|
||||||
handleLogin()
|
await addDynamicRoutes()
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
async function handleLogin() {
|
|
||||||
const { phone } = loginInfo.value
|
|
||||||
loading.value = true
|
|
||||||
await api.loginPhone({ phone, password: phone.slice(5,11) }).catch(res=>{
|
|
||||||
setToken(res.error.access_token)
|
|
||||||
if (query.redirect) {
|
if (query.redirect) {
|
||||||
const path = query.redirect
|
const path = query.redirect
|
||||||
console.log('path', { path, query })
|
console.log('path', { path, query })
|
||||||
@ -99,8 +100,9 @@ async function handleLogin() {
|
|||||||
} else {
|
} else {
|
||||||
router.push('/')
|
router.push('/')
|
||||||
}
|
}
|
||||||
loading.value = false
|
} catch (e) {
|
||||||
})
|
console.error('login error', e.error)
|
||||||
|
}
|
||||||
|
loading.value = false
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -1,149 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="step-progress-bar">
|
|
||||||
<div class="step-container">
|
|
||||||
<div
|
|
||||||
v-for="(step, index) in steps"
|
|
||||||
:key="index"
|
|
||||||
class="step-item"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="step-circle"
|
|
||||||
:class="{
|
|
||||||
'completed': currentStep > index,
|
|
||||||
'current': currentStep === index,
|
|
||||||
'pending': currentStep < index
|
|
||||||
}"
|
|
||||||
>
|
|
||||||
<span>{{ index + 1 }}</span>
|
|
||||||
</div>
|
|
||||||
<div class="step-title">{{ step.title }}</div>
|
|
||||||
|
|
||||||
<!-- 虚线连接线 -->
|
|
||||||
<div v-if="index < steps.length - 1" class="step-line">
|
|
||||||
<div
|
|
||||||
class="line-progress"
|
|
||||||
:style="{ width: lineProgress(index) }"
|
|
||||||
></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" setup>
|
|
||||||
import { PropType } from 'vue';
|
|
||||||
|
|
||||||
interface Step {
|
|
||||||
title: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const props = defineProps({
|
|
||||||
steps: {
|
|
||||||
type: Array as PropType<Step[]>,
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
currentStep: {
|
|
||||||
type: Number,
|
|
||||||
default: 0,
|
|
||||||
validator: (val: number) => val >= 0
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// 计算连接线的进度
|
|
||||||
const lineProgress = (index: number) => {
|
|
||||||
if (props.currentStep > index + 1) {
|
|
||||||
return '100%';
|
|
||||||
} else if (props.currentStep === index + 1) {
|
|
||||||
return '50%';
|
|
||||||
}
|
|
||||||
return '0%';
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.step-progress-bar {
|
|
||||||
width: 100%;
|
|
||||||
padding: 20px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.step-container {
|
|
||||||
position: relative;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
}
|
|
||||||
|
|
||||||
.step-item {
|
|
||||||
position: relative;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.step-circle {
|
|
||||||
z-index: 1;
|
|
||||||
display: flex;
|
|
||||||
width: 32px;
|
|
||||||
height: 32px;
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: 500;
|
|
||||||
border-radius: 50%;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.completed {
|
|
||||||
color: #fff;
|
|
||||||
background: #A30113;
|
|
||||||
}
|
|
||||||
|
|
||||||
.current {
|
|
||||||
color: #fff;
|
|
||||||
background: #A30113;
|
|
||||||
}
|
|
||||||
|
|
||||||
.pending {
|
|
||||||
color: #000;
|
|
||||||
background-color: #f5f5f5;
|
|
||||||
/* border: 1px solid #d9d9d9; */
|
|
||||||
}
|
|
||||||
|
|
||||||
.check-icon {
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.step-title {
|
|
||||||
margin-top: 8px;
|
|
||||||
font-size: 14px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.step-line {
|
|
||||||
position: absolute;
|
|
||||||
top: 16px;
|
|
||||||
left: 50%;
|
|
||||||
z-index: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 1px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.line-progress {
|
|
||||||
width: 0;
|
|
||||||
height: 100%;
|
|
||||||
background-color: #fff;
|
|
||||||
transition: width 1s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 虚线背景 */
|
|
||||||
.step-line::before {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 15%;
|
|
||||||
width: 70%;
|
|
||||||
height: 2px;
|
|
||||||
background-image: linear-gradient(to right, #A30113 50%, transparent 50%);
|
|
||||||
background-repeat: repeat-x;
|
|
||||||
background-size: 9px 3px;
|
|
||||||
content: '';
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -34,7 +34,7 @@
|
|||||||
:key="i"
|
:key="i"
|
||||||
class="mb-10 mt-10 w-300 cursor-pointer"
|
class="mb-10 mt-10 w-300 cursor-pointer"
|
||||||
hover:card-shadow
|
hover:card-shadow
|
||||||
title=""
|
title="Vue FastAPI Admin"
|
||||||
size="small"
|
size="small"
|
||||||
>
|
>
|
||||||
<p op-60>{{ dummyText }}</p>
|
<p op-60>{{ dummyText }}</p>
|
||||||
|
|||||||