当第一眼看到 Cool-Admin 就被它的颜值惊艳到了
官方只有node和java版本的server api,于是基于Laravel做了权限管理模块
composer require flaravel/cool-admin-api
php artisan vendor:publish --tag=cool-admin
php artisan migrate
php artisan vendor:publish --tag=cool-seeder
php artisan db:seed --class=CoolAdminSeeder
php artisan jwt:secret
github: https://github.com/flaravel/cool-admin-vue
代码拉取下来之后更改代理配置(在 vite.config.ts文件 中), 更改成当前你的后面请求地址
const proxy = {
"/dev": {
target: "请求服务端的url",
changeOrigin: true,
rewrite: (path: string) => path.replace(/^\/dev/, "")
},
"/pro": {
target: "https://show.cool-admin.com",
changeOrigin: true,
rewrite: (path: string) => path.replace(/^\/pro/, "/api")
}
};
更改完运行就能看到如下界面:
管理员:
- admin
- password
测试:
- test
- password