create-pubinfo 2.1.3-beta.2 → 2.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +1 -1
- package/dist/{helper-DqRlR095.js → helper.js} +39 -22
- package/dist/index.d.ts +6 -1
- package/dist/index.js +1 -1
- package/package.json +4 -3
- package/templates/pubinfo-monorepo/.browserslistrc +5 -0
- package/templates/pubinfo-monorepo/.editorconfig +10 -0
- package/templates/pubinfo-monorepo/.vscode/settings.json +50 -0
- package/templates/pubinfo-monorepo/_gitignore +38 -0
- package/templates/pubinfo-monorepo/_npmrc +5 -0
- package/templates/pubinfo-monorepo/apps/basic/.env +2 -0
- package/templates/pubinfo-monorepo/apps/basic/.env.development +4 -0
- package/templates/pubinfo-monorepo/apps/basic/.env.production +10 -0
- package/templates/pubinfo-monorepo/apps/basic/index.html +47 -0
- package/templates/pubinfo-monorepo/apps/basic/openapi.config.ts.hbs +33 -0
- package/templates/pubinfo-monorepo/apps/basic/package.json.hbs +26 -0
- package/templates/pubinfo-monorepo/apps/basic/pubinfo.config.ts +9 -0
- package/templates/pubinfo-monorepo/apps/basic/public/browser_upgrade/chrome.png +0 -0
- package/templates/pubinfo-monorepo/apps/basic/public/browser_upgrade/edge.png +0 -0
- package/templates/pubinfo-monorepo/apps/basic/public/browser_upgrade/index.css +49 -0
- package/templates/pubinfo-monorepo/apps/basic/public/loading.css +92 -0
- package/templates/pubinfo-monorepo/apps/basic/src/App.vue +7 -0
- package/templates/pubinfo-monorepo/apps/basic/src/api/modules/auth/index.ts +3 -0
- package/templates/pubinfo-monorepo/apps/basic/src/api/modules/auth/renzhengfuwu.ts +145 -0
- package/templates/pubinfo-monorepo/apps/basic/src/api/modules/auth/typings.d.ts +97 -0
- package/templates/pubinfo-monorepo/apps/basic/src/api/request.ts +125 -0
- package/templates/pubinfo-monorepo/apps/basic/src/assets/icons/logo.svg +1 -0
- package/templates/pubinfo-monorepo/apps/basic/src/assets/icons/process-management.svg +1 -0
- package/templates/pubinfo-monorepo/apps/basic/src/assets/icons/workbench.svg +1 -0
- package/templates/pubinfo-monorepo/apps/basic/src/assets/images/login-bg.webp +0 -0
- package/templates/pubinfo-monorepo/apps/basic/src/assets/images/login-bg_dark.webp +0 -0
- package/templates/pubinfo-monorepo/apps/basic/src/assets/images/login-small.png +0 -0
- package/templates/pubinfo-monorepo/apps/basic/src/assets/images/login-small_dark.webp +0 -0
- package/templates/pubinfo-monorepo/apps/basic/src/components/UIProvider/index.vue +51 -0
- package/templates/pubinfo-monorepo/apps/basic/src/layouts/index.vue +48 -0
- package/templates/pubinfo-monorepo/apps/basic/src/main.ts.hbs +26 -0
- package/templates/pubinfo-monorepo/apps/basic/src/modules/captcha.ts +8 -0
- package/templates/pubinfo-monorepo/apps/basic/src/modules/rbac.ts +10 -0
- package/templates/pubinfo-monorepo/apps/basic/src/routes/index.ts +71 -0
- package/templates/pubinfo-monorepo/apps/basic/src/routes/modules/demo/breadcrumb.example.ts +62 -0
- package/templates/pubinfo-monorepo/apps/basic/src/routes/modules/demo/link.ts +15 -0
- package/templates/pubinfo-monorepo/apps/basic/src/routes/modules/demo/multilevel.menu.example.ts +68 -0
- package/templates/pubinfo-monorepo/apps/basic/src/routes/modules/demo/other.page.ts +37 -0
- package/templates/pubinfo-monorepo/apps/basic/src/routes/modules/demo/single.ts +14 -0
- package/templates/pubinfo-monorepo/apps/basic/src/settings.ts.hbs +8 -0
- package/templates/pubinfo-monorepo/apps/basic/src/stores/index.ts +2 -0
- package/templates/pubinfo-monorepo/apps/basic/src/stores/modules/conter.ts +16 -0
- package/templates/pubinfo-monorepo/apps/basic/src/views/demo/breadcrumb_example/detail1.vue +11 -0
- package/templates/pubinfo-monorepo/apps/basic/src/views/demo/breadcrumb_example/detail2.vue +11 -0
- package/templates/pubinfo-monorepo/apps/basic/src/views/demo/breadcrumb_example/list1.vue +11 -0
- package/templates/pubinfo-monorepo/apps/basic/src/views/demo/breadcrumb_example/list2.vue +11 -0
- package/templates/pubinfo-monorepo/apps/basic/src/views/demo/multilevel_menu_example/level2/level3/page1.vue +11 -0
- package/templates/pubinfo-monorepo/apps/basic/src/views/demo/multilevel_menu_example/level2/level3/page2.vue +11 -0
- package/templates/pubinfo-monorepo/apps/basic/src/views/demo/multilevel_menu_example/level2/page.vue +11 -0
- package/templates/pubinfo-monorepo/apps/basic/src/views/demo/multilevel_menu_example/page.vue +11 -0
- package/templates/pubinfo-monorepo/apps/basic/src/views/demo/other_page/des.vue +13 -0
- package/templates/pubinfo-monorepo/apps/basic/src/views/demo/other_page/index.vue +25 -0
- package/templates/pubinfo-monorepo/apps/basic/src/views/demo/preview-empty/index.vue +17 -0
- package/templates/pubinfo-monorepo/apps/basic/src/views/demo/single/index.vue +13 -0
- package/templates/pubinfo-monorepo/apps/basic/src/views/system/index.vue +5 -0
- package/templates/pubinfo-monorepo/apps/basic/src/views/system/login/components/LoginForm.vue +29 -0
- package/templates/pubinfo-monorepo/apps/basic/src/views/system/login/components/LoginWithPhone.vue +213 -0
- package/templates/pubinfo-monorepo/apps/basic/src/views/system/login/components/PasswordLogin.vue +178 -0
- package/templates/pubinfo-monorepo/apps/basic/src/views/system/login/components/Savephone.vue +17 -0
- package/templates/pubinfo-monorepo/apps/basic/src/views/system/login/components/Useragreement.vue +26 -0
- package/templates/pubinfo-monorepo/apps/basic/src/views/system/login/composables.ts +63 -0
- package/templates/pubinfo-monorepo/apps/basic/src/views/system/login/index.vue +142 -0
- package/templates/pubinfo-monorepo/apps/basic/tsconfig.json +3 -0
- package/templates/pubinfo-monorepo/apps/basic/uno.config.ts +17 -0
- package/templates/pubinfo-monorepo/eslint.config.ts +3 -0
- package/templates/pubinfo-monorepo/package.json.hbs +46 -0
- package/templates/pubinfo-monorepo/pnpm-lock.yaml +12686 -0
- package/templates/pubinfo-monorepo/pnpm-workspace.yaml +11 -0
- package/templates/pubinfo-monorepo/stylelint.config.js +3 -0
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as validateInput, n as readPackageJSON, r as run, t as bootstrop } from "./helper
|
|
2
|
+
import { a as validateInput, n as readPackageJSON, r as run, t as bootstrop } from "./helper.js";
|
|
3
3
|
import { checkbox, confirm, input, select } from "@inquirer/prompts";
|
|
4
4
|
import { logger } from "@pubinfo/shared";
|
|
5
5
|
import { Command } from "commander";
|
|
@@ -23,10 +23,15 @@ async function copyTemplate(options) {
|
|
|
23
23
|
//#endregion
|
|
24
24
|
//#region src/core/generate.ts
|
|
25
25
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
26
|
+
const RBAC_FILE_PATHS = {
|
|
27
|
+
"pubinfo-app": ["src/modules/rbac.ts"],
|
|
28
|
+
"pubinfo-module": ["playground/src/modules/rbac.ts"],
|
|
29
|
+
"pubinfo-monorepo": ["apps/basic/src/modules/rbac.ts", "src/modules/rbac.ts"]
|
|
30
|
+
};
|
|
26
31
|
async function generate(options) {
|
|
27
32
|
const root = cwd();
|
|
28
33
|
const plop = await nodePlop();
|
|
29
|
-
const { templateName, templateDir, targetDir } = {
|
|
34
|
+
const { templateName, templateDir, targetDir, templatePath } = {
|
|
30
35
|
templateDir: resolve(__dirname, "../templates"),
|
|
31
36
|
targetDir: options.dir ? resolve(root, options.dir) : void 0,
|
|
32
37
|
openapi: false,
|
|
@@ -37,32 +42,34 @@ async function generate(options) {
|
|
|
37
42
|
...options,
|
|
38
43
|
rbac: options.modules.includes("rbac")
|
|
39
44
|
};
|
|
45
|
+
const baseTemplateDir = templatePath || resolve(templateDir, templateName);
|
|
46
|
+
const normalizedBase = baseTemplateDir.replace(/\\/g, "/");
|
|
40
47
|
plop.setGenerator("generate", { actions: () => {
|
|
41
48
|
return [{
|
|
42
49
|
type: "addMany",
|
|
43
50
|
destination: targetDir,
|
|
44
|
-
base:
|
|
45
|
-
templateFiles: `${
|
|
51
|
+
base: normalizedBase,
|
|
52
|
+
templateFiles: `${normalizedBase}/**/*.hbs`,
|
|
46
53
|
globOptions: { dot: true }
|
|
47
54
|
}, async function copyRawFiles() {
|
|
48
|
-
const
|
|
55
|
+
const skipRbacFiles = new Set(RBAC_FILE_PATHS[templateName] || []);
|
|
49
56
|
async function walk(dir) {
|
|
50
57
|
const entries = await fs.promises.readdir(dir, { withFileTypes: true });
|
|
51
58
|
for (const e of entries) {
|
|
52
59
|
const srcPath = resolve(dir, e.name);
|
|
53
|
-
const rel = relative(
|
|
60
|
+
const rel = relative(baseTemplateDir, srcPath).split(sep).join(posix.sep);
|
|
54
61
|
if (e.isDirectory()) {
|
|
55
62
|
await walk(srcPath);
|
|
56
63
|
continue;
|
|
57
64
|
}
|
|
58
65
|
if (e.name.endsWith(".hbs")) continue;
|
|
59
|
-
if (!plopOptions.rbac && rel
|
|
66
|
+
if (!plopOptions.rbac && skipRbacFiles.has(rel)) continue;
|
|
60
67
|
const targetPath = resolve(targetDir, rel);
|
|
61
68
|
await fs.promises.mkdir(dirname(targetPath), { recursive: true });
|
|
62
69
|
await fs.promises.copyFile(srcPath, targetPath);
|
|
63
70
|
}
|
|
64
71
|
}
|
|
65
|
-
await walk(
|
|
72
|
+
await walk(baseTemplateDir);
|
|
66
73
|
return `Copied raw files from ${templateName}`;
|
|
67
74
|
}];
|
|
68
75
|
} });
|
|
@@ -91,12 +98,12 @@ async function interaction() {
|
|
|
91
98
|
try {
|
|
92
99
|
const answer = {};
|
|
93
100
|
answer.dir = await input({
|
|
94
|
-
message: "
|
|
101
|
+
message: "目录名称 (dir)",
|
|
95
102
|
default: "my-app",
|
|
96
103
|
validate: validateInput
|
|
97
104
|
});
|
|
98
105
|
answer.key = await input({
|
|
99
|
-
message: "
|
|
106
|
+
message: "项目标识 (key)",
|
|
100
107
|
default: answer.dir,
|
|
101
108
|
validate: validateInput
|
|
102
109
|
});
|
|
@@ -106,18 +113,25 @@ async function interaction() {
|
|
|
106
113
|
answer.templateName = await select({
|
|
107
114
|
message: "选择模板类型",
|
|
108
115
|
default: "pubinfo-app",
|
|
109
|
-
choices: [
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
+
choices: [
|
|
117
|
+
{
|
|
118
|
+
name: "Web应用 (app)",
|
|
119
|
+
value: "pubinfo-app"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
name: "Web应用 (monorepo)",
|
|
123
|
+
value: "pubinfo-monorepo"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
name: "模块插件 (module)",
|
|
127
|
+
value: "pubinfo-module"
|
|
128
|
+
}
|
|
129
|
+
]
|
|
116
130
|
});
|
|
117
131
|
answer.modules = await checkbox({
|
|
118
132
|
message: "选择需要的模块",
|
|
119
133
|
choices: [{
|
|
120
|
-
name: "
|
|
134
|
+
name: "用户权限管理 (RBAC)",
|
|
121
135
|
value: "rbac",
|
|
122
136
|
checked: true
|
|
123
137
|
}]
|
|
@@ -147,14 +161,17 @@ async function run(version$1) {
|
|
|
147
161
|
var package_default = {
|
|
148
162
|
name: "create-pubinfo",
|
|
149
163
|
type: "module",
|
|
150
|
-
version: "2.1.
|
|
164
|
+
version: "2.1.4",
|
|
151
165
|
description: "初始化项目框架",
|
|
152
166
|
author: "Werheng <werheng.zhang@gmail.com>",
|
|
153
167
|
license: "MIT",
|
|
154
|
-
exports: {
|
|
155
|
-
"
|
|
156
|
-
|
|
157
|
-
|
|
168
|
+
exports: {
|
|
169
|
+
".": {
|
|
170
|
+
"types": "./dist/index.d.ts",
|
|
171
|
+
"default": "./dist/index.js"
|
|
172
|
+
},
|
|
173
|
+
"./package.json": "./package.json"
|
|
174
|
+
},
|
|
158
175
|
main: "./dist/index.js",
|
|
159
176
|
module: "./dist/index.js",
|
|
160
177
|
types: "./dist/index.d.ts",
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/interface.d.ts
|
|
2
|
-
type TemplateName = 'pubinfo-app' | 'pubinfo-module';
|
|
2
|
+
type TemplateName = 'pubinfo-app' | 'pubinfo-module' | 'pubinfo-monorepo';
|
|
3
3
|
type Module = 'rbac';
|
|
4
4
|
interface Options {
|
|
5
5
|
/**
|
|
@@ -28,6 +28,10 @@ interface GenerateOptions extends Options {
|
|
|
28
28
|
* 版本号
|
|
29
29
|
*/
|
|
30
30
|
version: string;
|
|
31
|
+
/**
|
|
32
|
+
* 自定义模板目录
|
|
33
|
+
*/
|
|
34
|
+
templatePath?: string;
|
|
31
35
|
/**
|
|
32
36
|
* 模板文件夹
|
|
33
37
|
*/
|
|
@@ -77,6 +81,7 @@ declare function readPackageJSON(): {
|
|
|
77
81
|
types: string;
|
|
78
82
|
default: string;
|
|
79
83
|
};
|
|
84
|
+
"./package.json": string;
|
|
80
85
|
};
|
|
81
86
|
main: string;
|
|
82
87
|
module: string;
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { i as interaction, n as readPackageJSON, o as generate, r as run, s as copyTemplate } from "./helper
|
|
1
|
+
import { i as interaction, n as readPackageJSON, o as generate, r as run, s as copyTemplate } from "./helper.js";
|
|
2
2
|
|
|
3
3
|
export { copyTemplate, generate, interaction, readPackageJSON, run };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pubinfo",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.1.
|
|
4
|
+
"version": "2.1.4",
|
|
5
5
|
"description": "初始化项目框架",
|
|
6
6
|
"author": "Werheng <werheng.zhang@gmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
".": {
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
11
|
"default": "./dist/index.js"
|
|
12
|
-
}
|
|
12
|
+
},
|
|
13
|
+
"./package.json": "./package.json"
|
|
13
14
|
},
|
|
14
15
|
"main": "./dist/index.js",
|
|
15
16
|
"module": "./dist/index.js",
|
|
@@ -37,7 +38,7 @@
|
|
|
37
38
|
"ora": "^8.2.0",
|
|
38
39
|
"rimraf": "^6.0.1",
|
|
39
40
|
"semver": "^7.7.2",
|
|
40
|
-
"@pubinfo/shared": "2.1.
|
|
41
|
+
"@pubinfo/shared": "2.1.4"
|
|
41
42
|
},
|
|
42
43
|
"devDependencies": {
|
|
43
44
|
"@types/node": "^24.0.10"
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
// Disable the default formatter, use eslint instead
|
|
3
|
+
"prettier.enable": false,
|
|
4
|
+
"editor.formatOnSave": false,
|
|
5
|
+
|
|
6
|
+
// Auto fix
|
|
7
|
+
"editor.codeActionsOnSave": {
|
|
8
|
+
"source.fixAll.eslint": "explicit",
|
|
9
|
+
"source.organizeImports": "never"
|
|
10
|
+
},
|
|
11
|
+
|
|
12
|
+
// Silent the stylistic rules in you IDE, but still auto fix them
|
|
13
|
+
"eslint.rules.customizations": [
|
|
14
|
+
{ "rule": "style/*", "severity": "off", "fixable": true },
|
|
15
|
+
{ "rule": "format/*", "severity": "off", "fixable": true },
|
|
16
|
+
{ "rule": "*-indent", "severity": "off", "fixable": true },
|
|
17
|
+
{ "rule": "*-spacing", "severity": "off", "fixable": true },
|
|
18
|
+
{ "rule": "*-spaces", "severity": "off", "fixable": true },
|
|
19
|
+
{ "rule": "*-order", "severity": "off", "fixable": true },
|
|
20
|
+
{ "rule": "*-dangle", "severity": "off", "fixable": true },
|
|
21
|
+
{ "rule": "*-newline", "severity": "off", "fixable": true },
|
|
22
|
+
{ "rule": "*quotes", "severity": "off", "fixable": true },
|
|
23
|
+
{ "rule": "*semi", "severity": "off", "fixable": true }
|
|
24
|
+
],
|
|
25
|
+
|
|
26
|
+
// Enable eslint for all supported languages
|
|
27
|
+
"eslint.validate": [
|
|
28
|
+
"javascript",
|
|
29
|
+
"javascriptreact",
|
|
30
|
+
"typescript",
|
|
31
|
+
"typescriptreact",
|
|
32
|
+
"vue",
|
|
33
|
+
"html",
|
|
34
|
+
"markdown",
|
|
35
|
+
"json",
|
|
36
|
+
"jsonc",
|
|
37
|
+
"yaml",
|
|
38
|
+
"toml",
|
|
39
|
+
"xml",
|
|
40
|
+
"gql",
|
|
41
|
+
"graphql",
|
|
42
|
+
"astro",
|
|
43
|
+
"svelte",
|
|
44
|
+
"css",
|
|
45
|
+
"less",
|
|
46
|
+
"scss",
|
|
47
|
+
"pcss",
|
|
48
|
+
"postcss"
|
|
49
|
+
]
|
|
50
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
.pubinfo
|
|
2
|
+
.eslintcache
|
|
3
|
+
.stylelintcache
|
|
4
|
+
.gitmessage
|
|
5
|
+
|
|
6
|
+
# auto generated
|
|
7
|
+
auto-imports.d.ts
|
|
8
|
+
components.d.ts
|
|
9
|
+
|
|
10
|
+
.DS_Store
|
|
11
|
+
node_modules
|
|
12
|
+
dist
|
|
13
|
+
cache
|
|
14
|
+
coverage
|
|
15
|
+
.turbo
|
|
16
|
+
.eslintcache
|
|
17
|
+
.stylelintcache
|
|
18
|
+
|
|
19
|
+
# local env files
|
|
20
|
+
.env.local
|
|
21
|
+
.env.*.local
|
|
22
|
+
|
|
23
|
+
# Log files
|
|
24
|
+
npm-debug.log*
|
|
25
|
+
yarn-debug.log*
|
|
26
|
+
yarn-error.log*
|
|
27
|
+
pnpm-debug.log*
|
|
28
|
+
lerna-debug.log*
|
|
29
|
+
|
|
30
|
+
# Editor directories and files
|
|
31
|
+
.idea
|
|
32
|
+
# .vscode
|
|
33
|
+
*.suo
|
|
34
|
+
*.ntvs*
|
|
35
|
+
*.njsproj
|
|
36
|
+
*.sln
|
|
37
|
+
*.sw?
|
|
38
|
+
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# 接口请求地址,会设置到 axios 的 baseURL 参数上
|
|
2
|
+
VITE_APP_API_BASEURL = /pubinfo-sys
|
|
3
|
+
# 是否在打包时启用 Mock
|
|
4
|
+
VITE_BUILD_MOCK = false
|
|
5
|
+
# 是否在打包时生成 sourcemap
|
|
6
|
+
VITE_BUILD_SOURCEMAP = false
|
|
7
|
+
# 是否在打包时开启压缩,支持 gzip 和 brotli,例如 gzip,brotli
|
|
8
|
+
VITE_BUILD_COMPRESS =
|
|
9
|
+
# 是否在打包时启用传统浏览器兼容,可在 .browserslistrc 中进行具体配置
|
|
10
|
+
VITE_BUILD_LEGACY = false
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" href="src/assets/icons/logo.svg" type="image/svg+xml"/>
|
|
6
|
+
<link rel="stylesheet" href="/loading.css" />
|
|
7
|
+
<link rel="stylesheet" href="/browser_upgrade/index.css" />
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
9
|
+
<meta http-equiv="Expires" content="0">
|
|
10
|
+
<meta http-equiv="Pragma" content="no-cache">
|
|
11
|
+
<meta http-equiv="Cache-control" content="no-cache">
|
|
12
|
+
<meta http-equiv="Cache" content="no-cache">
|
|
13
|
+
<title>%VITE_APP_TITLE%</title>
|
|
14
|
+
</head>
|
|
15
|
+
<body>
|
|
16
|
+
<div id="app">
|
|
17
|
+
<div class="w-admin-home">
|
|
18
|
+
<div class="loading">
|
|
19
|
+
<div class="square"></div>
|
|
20
|
+
<div class="square"></div>
|
|
21
|
+
<div class="square"></div>
|
|
22
|
+
<div class="square"></div>
|
|
23
|
+
</div>
|
|
24
|
+
<div class="text">载入中</div>
|
|
25
|
+
</div>
|
|
26
|
+
<div id="browser-upgrade">
|
|
27
|
+
<div class="title">为了您的体验,推荐使用以下浏览器</div>
|
|
28
|
+
<div class="browsers">
|
|
29
|
+
<a href="https://www.microsoft.com/edge" target="_blank" class="browser">
|
|
30
|
+
<img class="browser-icon" src="/browser_upgrade/edge.png" />
|
|
31
|
+
<div class="browser-name">Mircosoft Edge</div>
|
|
32
|
+
</a>
|
|
33
|
+
<a href="https://www.google.cn/chrome/" target="_blank" class="browser">
|
|
34
|
+
<img class="browser-icon" src="/browser_upgrade/chrome.png" />
|
|
35
|
+
<div class="browser-name">Google Chrome</div>
|
|
36
|
+
</a>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
<script>
|
|
41
|
+
if (!!window.ActiveXObject || 'ActiveXObject' in window) {
|
|
42
|
+
document.getElementById('browser-upgrade').style.display = 'block';
|
|
43
|
+
}
|
|
44
|
+
</script>
|
|
45
|
+
<script type="module" src="/src/main.ts"></script>
|
|
46
|
+
</body>
|
|
47
|
+
</html>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { defineConfig } from '@pubinfo/openapi';
|
|
2
|
+
import { presetName } from '@pubinfo/preset-openapi';
|
|
3
|
+
|
|
4
|
+
export default defineConfig({
|
|
5
|
+
enabled: {{openapi}},
|
|
6
|
+
|
|
7
|
+
presets: [
|
|
8
|
+
// 小驼峰式命名
|
|
9
|
+
presetName({
|
|
10
|
+
functionName: 'camelCase',
|
|
11
|
+
}),
|
|
12
|
+
],
|
|
13
|
+
|
|
14
|
+
imports: { '@/api/request': [{ name: 'basic', as: 'request' }] },
|
|
15
|
+
batch: [
|
|
16
|
+
{
|
|
17
|
+
input: 'http://localhost:9099/pubinfo-sys/v3/api-docs/auth',
|
|
18
|
+
output: './src/api/modules/auth',
|
|
19
|
+
imports: { '@/api/request': [{ name: 'auth', as: 'request' }] },
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
|
|
23
|
+
hooks: {
|
|
24
|
+
customType(schema, namespace, defaultFn) {
|
|
25
|
+
// `int64` 在前端会精度丢失,可在此处调整对应字段的 `TS类型`
|
|
26
|
+
if (schema?.type === 'integer' && schema?.format === 'int64') {
|
|
27
|
+
return 'number';
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return defaultFn(schema, namespace);
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pubinfo-template",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "pubinfo dev",
|
|
7
|
+
"build": "pubinfo build",
|
|
8
|
+
"preview": "pubinfo preview",
|
|
9
|
+
"upgrade": "pubinfo upgrade",
|
|
10
|
+
"prepare": "pubinfo setup",
|
|
11
|
+
"openapi": "pnpx @pubinfo/openapi generate",
|
|
12
|
+
"icon:normalize": "pubinfo icon"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@pubinfo/module-captcha": "{{version}}",
|
|
16
|
+
{{#if rbac}}
|
|
17
|
+
"@pubinfo/module-rbac": "{{version}}",
|
|
18
|
+
{{/if}}
|
|
19
|
+
"@vueuse/core": "^14.0.0",
|
|
20
|
+
"pubinfo": "{{version}}"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@pubinfo/openapi": "^0.9.1",
|
|
24
|
+
"@pubinfo/preset-openapi": "^0.9.1"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#browser-upgrade {
|
|
2
|
+
position: absolute;
|
|
3
|
+
top: 0;
|
|
4
|
+
left: 0;
|
|
5
|
+
z-index: 10001;
|
|
6
|
+
display: none;
|
|
7
|
+
width: 100%;
|
|
8
|
+
height: 100%;
|
|
9
|
+
color: #736477;
|
|
10
|
+
user-select: none;
|
|
11
|
+
background-color: snow;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
#browser-upgrade .title {
|
|
15
|
+
margin: 40px 0;
|
|
16
|
+
font-size: 24px;
|
|
17
|
+
text-align: center;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
#browser-upgrade .browsers {
|
|
21
|
+
text-align: center;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
#browser-upgrade .browsers .browser {
|
|
25
|
+
display: inline-block;
|
|
26
|
+
margin: 0 20px;
|
|
27
|
+
text-decoration: none;
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
#browser-upgrade .browsers .browser .browser-icon {
|
|
32
|
+
display: block;
|
|
33
|
+
width: 50px;
|
|
34
|
+
height: 50px;
|
|
35
|
+
margin: 0 auto;
|
|
36
|
+
border: none;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
#browser-upgrade .browsers .browser .browser-name {
|
|
40
|
+
padding-bottom: 2px;
|
|
41
|
+
margin-top: 10px;
|
|
42
|
+
color: #736477;
|
|
43
|
+
text-align: center;
|
|
44
|
+
border-bottom: 1px solid transparent;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
#browser-upgrade .browsers .browser:hover .browser-name {
|
|
48
|
+
border-bottom: 1px solid #736477;
|
|
49
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
#app {
|
|
2
|
+
height: 100%;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.w-admin-home {
|
|
6
|
+
position: absolute;
|
|
7
|
+
top: 0;
|
|
8
|
+
left: 0;
|
|
9
|
+
z-index: 10000;
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
align-items: center;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: 100%;
|
|
16
|
+
color: #736477;
|
|
17
|
+
user-select: none;
|
|
18
|
+
background-color: snow;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.w-admin-home .loading {
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-wrap: wrap;
|
|
24
|
+
align-items: center;
|
|
25
|
+
justify-content: center;
|
|
26
|
+
width: 40px;
|
|
27
|
+
height: 40px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.w-admin-home .loading .square {
|
|
31
|
+
display: flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
justify-content: center;
|
|
34
|
+
width: 20px;
|
|
35
|
+
height: 20px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.w-admin-home .loading .square::before {
|
|
39
|
+
width: 10px;
|
|
40
|
+
height: 10px;
|
|
41
|
+
content: "";
|
|
42
|
+
border: 3px solid #8c858f;
|
|
43
|
+
border-radius: 15%;
|
|
44
|
+
animation: square-to-dot-animation 2s linear infinite;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.w-admin-home .loading .square:nth-child(1)::before {
|
|
48
|
+
animation-delay: calc(150ms * 1);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.w-admin-home .loading .square:nth-child(2)::before {
|
|
52
|
+
animation-delay: calc(150ms * 2);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.w-admin-home .loading .square:nth-child(3)::before {
|
|
56
|
+
animation-delay: calc(150ms * 3);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.w-admin-home .loading .square:nth-child(4)::before {
|
|
60
|
+
animation-delay: calc(150ms * 4);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@keyframes square-to-dot-animation {
|
|
64
|
+
15%,
|
|
65
|
+
25% {
|
|
66
|
+
width: 0;
|
|
67
|
+
height: 0;
|
|
68
|
+
margin: 5px;
|
|
69
|
+
border-width: 5px;
|
|
70
|
+
border-radius: 100%;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
40% {
|
|
74
|
+
width: 10px;
|
|
75
|
+
height: 10px;
|
|
76
|
+
margin: initial;
|
|
77
|
+
border-width: 3px;
|
|
78
|
+
border-radius: 15%;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.w-admin-home .text {
|
|
83
|
+
position: relative;
|
|
84
|
+
margin-top: 20px;
|
|
85
|
+
font-size: 24px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.w-admin-home .text::after {
|
|
89
|
+
position: absolute;
|
|
90
|
+
padding-left: 5px;
|
|
91
|
+
content: "…";
|
|
92
|
+
}
|