朱群锋 2025-01-30 16:04:26 +08:00
parent ca0ed8624a
commit c55c214c0e
13 changed files with 56 additions and 20 deletions

View File

@ -1 +1 @@
window.common={API_QUERY_URL:"http://localhost:7000/tansci/lcPages/get/",API_SAVE_URL:"http://localhost:7000/tansci/lcPages/update",TOKEN_KEY:"token"};
window.common={API_QUERY_URL:"http://localhost:7001/tansci/lcPages/get/",API_SAVE_URL:"http://localhost:7001/tansci/lcPages/update",TOKEN_KEY:"token"};

View File

@ -1,12 +1,12 @@
{
"name": "tansci-boot-ui-editor",
"version": "2.0.0",
"version": "1.2.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "tansci-boot-ui-editor",
"version": "2.0.0",
"version": "1.2.0",
"license": "ISC",
"dependencies": {
"@fortawesome/fontawesome-free": "^5.15.3",

View File

@ -1,5 +1,5 @@
window.common = {
API_QUERY_URL: 'http://localhost:7000/tansci/lowcode/lcPages/get/',
API_SAVE_URL: 'http://localhost:7000/tansci/lowcode/lcPages/update',
API_QUERY_URL: 'http://localhost:7001/tansci/lowcode/lcPages/get/',
API_SAVE_URL: 'http://localhost:7001/tansci/lowcode/lcPages/update',
TOKEN_KEY: 'token'
}

View File

@ -1,2 +1,2 @@
VITE_BASE_API = 'http://localhost:7000/tansci'
VITE_BASE_API = 'http://localhost:7001/tansci'
VITE_EDITOR_URL = 'http://localhost:5173'

View File

@ -1,5 +1,4 @@
.vite-ssg-temp
node_modules
.DS_Store
dist

View File

@ -10,7 +10,7 @@
"typecheck": "vue-tsc --noEmit"
},
"dependencies": {
"amis": "^6.0.0",
"amis": "^6.10.0",
"axios": "^1.3.4",
"copy-to-clipboard": "^3.3.3",
"element-plus": "^2.6.3",

View File

@ -1 +1 @@
window.common={API_QUERY_URL:"http://localhost:7000/tansci/lowcode/lcPages/get/",API_SAVE_URL:"http://localhost:7000/tansci/lowcode/lcPages/update",TOKEN_KEY:"token"};
window.common={API_QUERY_URL:"http://localhost:7001/tansci/lowcode/lcPages/get/",API_SAVE_URL:"http://localhost:7001/tansci/lowcode/lcPages/update",TOKEN_KEY:"token"};

View File

@ -22,6 +22,7 @@ export function removeToken() {
// 菜单信息
export function getMenus() {
let menu = sessionStorage.getItem(menuKey);
console.info(menu);
return menu ? JSON.parse(menu) : null;
}

View File

@ -1,15 +1,51 @@
import { createRouter, createWebHistory } from "vue-router"
import { createRouter, createWebHistory,RouteRecordRaw } from "vue-router"
import { ElMessage } from 'element-plus'
import { getToken, removeToken, setMenus, getUserInfo } from "@/api/auth"
import common from '@/utils/common'
import { generateRoutes } from "./permission"
import staticRouter from './staticRouter'
const staticRouter: RouteRecordRaw[] = [
{
path: '/',
redirect: 'login',
},
{
path: '/login',
name: 'login',
meta: {title: "登录"},
component: () => import("@/views/common/Login.vue"),
},
{
path: '/404',
name: '404',
meta: {title: "404"},
component: () => import('@/views/common/404.vue')
},
{
path: '/500',
name: '500',
meta: {title: "500"},
component: () => import('@/views/common/500.vue')
},
{
path: '/index',
name: 'index',
meta: { title: "首页" },
redirect: '/index/index',
component: () => import("@/components/layout/Index.vue"),
children: [
{
path: 'index',
name: 'index',
meta: { title: "首页" },
component: () => import('@/views/Index.vue')
}
]
}
];
const router = createRouter({
history: createWebHistory(),
routes: [
...staticRouter
]
routes: staticRouter
})
const whiteList = ['/login']

View File

@ -1,4 +1,4 @@
import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios'
import axios, { AxiosInstance, InternalAxiosRequestConfig, AxiosResponse } from 'axios'
import { ElMessage } from 'element-plus'
import { logout, getToken } from '@/api/auth'
import router from '../router'
@ -14,7 +14,7 @@ const axiosInstance: AxiosInstance = axios.create({
})
// axios实例拦截请求
axiosInstance.interceptors.request.use((config: AxiosRequestConfig) => {
axiosInstance.interceptors.request.use((config: InternalAxiosRequestConfig<any>) => {
// 设置token
if (getToken()) {
config.headers.token = getToken()

View File

@ -21,7 +21,7 @@ export default defineConfig({
server: {
proxy: {
'/tansci': {
target: 'http://127.0.0.1:7000',
target: 'http://localhost:7001',
changeOrigin: true,
pathRewrite: {'^/tansci':'/tansci'}
}

View File

@ -3,8 +3,8 @@ spring:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/tansci_boot?autoReconnect=true&useUnicode=true&characterEncoding=utf-8&autoReconnect=true
username: root
password: root
username: tansci
password: tansci
initialSize: 10
minIdle: 10
maxActive: 100

View File

@ -1,5 +1,5 @@
server:
port: 7000
port: 7001
servlet:
context-path: /tansci