|
|
1 месяц назад | |
|---|---|---|
| .. | ||
| public | 1 месяц назад | |
| src | 1 месяц назад | |
| README.md | 1 месяц назад | |
| index.html | 1 месяц назад | |
| package-lock.json | 1 месяц назад | |
| package.json | 1 месяц назад | |
| tsconfig.json | 1 месяц назад | |
| tsconfig.node.json | 1 месяц назад | |
| vite.config.ts | 1 месяц назад | |
基于 Vue 3 + Element Plus 的前端管理界面,用于管理配置服务的租户、角色、用户、项目等资源。
cd svc-configure/web
npm install
npm run dev
访问 http://localhost:3001
npm run build:prod
cd svc-configure
go build
src/
├── api/ # API模块(35个端点)
├── views/ # 页面组件(9个管理页面)
├── components/ # 公共组件
├── store/ # 状态管理(Pinia)
├── styles/ # 全局样式
├── App.vue # 根组件
├── main.ts # 应用入口
└── router.ts # 路由配置(临时位置)
如果遇到文件权限问题,执行以下步骤:
# 删除旧的router目录(如果存在)
rm -rf svc-configure/web/src/router
# 创建新的router目录
mkdir -p svc-configure/web/src/router
# 将router.ts移动到正确位置
mv svc-configure/web/src/router.ts svc-configure/web/src/router/index.ts
确保 svc-configure/web/src/main.ts 包含以下导入:
import router from './router' // 而不是 './router.ts'
cd svc-configure/web
npm run build:prod
cd svc-configure
go build
# 清除缓存
rm -rf node_modules package-lock.json
npm install
npm run build
# 清除macOS扩展属性
xattr -rc svc-configure/
# 修改权限
chmod -R 755 svc-configure/
# 检查dist目录
ls -la svc-configure/web/dist/
# 重新构建前端
cd svc-configure/web && npm run build:prod
/login)/dashboard)src/views 创建Vue组件src/router.ts 添加路由配置src/api 添加对应API模块// 1. 在types.ts定义类型
export interface Resource {
id: string
name: string
// ...
}
// 2. 创建API模块
export const resourceApi = {
create: async (data: ResourceRequest) => request.post('/create/resource', data),
// ...
}
// 3. 在页面中调用
const result = await resourceApi.create(formData)
npm run test:unit
npm run test:e2e
访问 http://localhost:3001/test-api.html
npm run dev
npm run build:prod
go build -o svc-configure
./svc-configure
FROM node:18-alpine as builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build:prod
FROM golang:1.25-alpine
WORKDIR /app
COPY --from=builder /app/dist ./web/dist
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN go build -o svc-configure
CMD ["./svc-configure"]
项目遵循公司内部许可证。