Merge branch 'main' of http://192.168.195.14:3000/outsource/corps
This commit is contained in:
commit
bc21eb16ef
2
src/frontend/.env.production
Normal file
2
src/frontend/.env.production
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
# API 地址配置
|
||||||
|
VITE_API_BASE_URL=https://app.zpc-xy.com/corps/api/api/admin
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
FROM node:20-alpine AS build
|
FROM node:20-alpine AS build
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
RUN npm ci
|
RUN rm -f package-lock.json && npm install
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import axios, { AxiosInstance, AxiosError, InternalAxiosRequestConfig } from 'ax
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
|
|
||||||
const apiClient: AxiosInstance = axios.create({
|
const apiClient: AxiosInstance = axios.create({
|
||||||
baseURL: '/api/admin',
|
baseURL: import.meta.env.VITE_API_BASE_URL || '/api/admin',
|
||||||
timeout: 30000,
|
timeout: 30000,
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,7 @@ const routes: RouteRecordRaw[] = [
|
||||||
]
|
]
|
||||||
|
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
history: createWebHistory(),
|
history: createWebHistory('/corps/web/'),
|
||||||
routes
|
routes
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -85,8 +85,12 @@ async function handleLogin() {
|
||||||
|
|
||||||
if (success) {
|
if (success) {
|
||||||
ElMessage.success('登录成功')
|
ElMessage.success('登录成功')
|
||||||
const redirect = route.query.redirect as string || '/dashboard'
|
const redirect = route.query.redirect as string
|
||||||
router.push(redirect)
|
if (redirect) {
|
||||||
|
router.push(redirect)
|
||||||
|
} else {
|
||||||
|
router.push({ name: 'Dashboard' })
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
ElMessage.error('用户名或密码错误')
|
ElMessage.error('用户名或密码错误')
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import { resolve } from 'path'
|
||||||
import { fileURLToPath, URL } from 'node:url'
|
import { fileURLToPath, URL } from 'node:url'
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
|
base: '/corps/web/',
|
||||||
plugins: [vue()],
|
plugins: [vue()],
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user