fix: 全链路运行时修复 — 登录/路由/菜单/门店CRUD
登录流程:
- login() 不再设置 userInfo,由 router guard 触发 getInfo() + 路由生成
- validate() 从 callback 改为 Promise 式,修复异步链断裂
- getInfo() 适配 /auth/me 扁平响应结构
动态路由:
- import.meta.glob 替代 Vite 不支持的多级动态 import
- 目录菜单检测: !component || 'Layout' 而非仅 'Layout'
- resolveComponent 支持多种 key 格式 + 后缀匹配兜底
侧边栏:
- menu.title → menu.name (匹配后端字段)
- 空 path 目录节点加 fallback index
门店管理:
- StoreController: region_id 改 nullable, 新增 contact/capacity/description 验证
- has('status') → filled('status') 修复空字符串导致列表为空
- capacity null → 0 兜底,避免 NOT NULL 约束报错
- 前端: capacity 初始值 '' → 1, handleSubmit 过滤冗余字段
- region 列渲染 region.name 而非 [object Object]
- 新增 stores 表迁移: contact/capacity/description 列
种子数据:
- DatabaseSeeder 改用 InitSeeder
- createMenus() 补全 52 个叶子页面菜单 (13 模块)
- 目录菜单添加 path 属性
其他:
- vite proxy 端口 8000 → 8001
- request.js 添加 Accept: application/json
- UserStatus 枚举值对齐 (Active=1, Disabled=0)
- 新增 positions/index.vue 页面
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('stores', function (Blueprint $table) {
|
||||
// Make region_id nullable (frontend may not always provide it)
|
||||
$table->foreignId('region_id')->nullable()->change();
|
||||
|
||||
// Add fields that frontend form expects
|
||||
$table->string('contact', 50)->nullable()->after('phone')->comment('联系人');
|
||||
$table->unsignedSmallInteger('capacity')->default(0)->after('contact')->comment('床位数');
|
||||
$table->string('description', 500)->nullable()->after('capacity')->comment('备注');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('stores', function (Blueprint $table) {
|
||||
$table->dropColumn(['contact', 'capacity', 'description']);
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user