mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2025-12-12 05:32:48 +00:00
解决 type DictKey = 空
This commit is contained in:
parent
669fe3fe30
commit
d3d9314abb
@ -39,7 +39,7 @@
|
|||||||
"xlsx": "^0.18.5"
|
"xlsx": "^0.18.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@cool-vue/vite-plugin": "^8.0.0",
|
"@cool-vue/vite-plugin": "^8.0.1",
|
||||||
"@intlify/unplugin-vue-i18n": "^6.0.3",
|
"@intlify/unplugin-vue-i18n": "^6.0.3",
|
||||||
"@rushstack/eslint-patch": "^1.10.5",
|
"@rushstack/eslint-patch": "^1.10.5",
|
||||||
"@tsconfig/node20": "^20.1.4",
|
"@tsconfig/node20": "^20.1.4",
|
||||||
|
|||||||
13
packages/vite-plugin/dist/index.js
vendored
13
packages/vite-plugin/dist/index.js
vendored
@ -521,15 +521,16 @@
|
|||||||
}
|
}
|
||||||
// 创建 dict
|
// 创建 dict
|
||||||
async function createDict() {
|
async function createDict() {
|
||||||
return axios
|
return axios.get(config.reqUrl + "/" + config.type + "/dict/info/types").then((res) => {
|
||||||
.get(config.reqUrl + "/" + config.type + "/dict/info/types")
|
|
||||||
.then(async (res) => {
|
|
||||||
const { code, data } = res.data;
|
const { code, data } = res.data;
|
||||||
if (code === 1000) {
|
if (code === 1000) {
|
||||||
return `type DictKey = ${data.map((e) => `"${e.key}"`).join(" | ")}`;
|
let v = "string";
|
||||||
|
if (!lodash.isEmpty(data)) {
|
||||||
|
v = data.map((e) => `"${e.key}"`).join(" | ");
|
||||||
}
|
}
|
||||||
})
|
return `type DictKey = ${v}`;
|
||||||
.catch((err) => { });
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
// 创建 eps
|
// 创建 eps
|
||||||
async function createEps() {
|
async function createEps() {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@cool-vue/vite-plugin",
|
"name": "@cool-vue/vite-plugin",
|
||||||
"version": "8.0.0",
|
"version": "8.0.1",
|
||||||
"description": "cool-admin、cool-uni builder",
|
"description": "cool-admin、cool-uni builder",
|
||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/index.d.ts",
|
||||||
"main": "/dist/index.js",
|
"main": "/dist/index.js",
|
||||||
|
|||||||
@ -481,16 +481,19 @@ function createService() {
|
|||||||
|
|
||||||
// 创建 dict
|
// 创建 dict
|
||||||
async function createDict() {
|
async function createDict() {
|
||||||
return axios
|
return axios.get(config.reqUrl + "/" + config.type + "/dict/info/types").then((res) => {
|
||||||
.get(config.reqUrl + "/" + config.type + "/dict/info/types")
|
const { code, data } = res.data as { code: number; data: any[] };
|
||||||
.then(async (res) => {
|
|
||||||
const { code, data } = res.data;
|
|
||||||
|
|
||||||
if (code === 1000) {
|
if (code === 1000) {
|
||||||
return `type DictKey = ${data.map((e: any) => `"${e.key}"`).join(" | ")}`;
|
let v = "string";
|
||||||
|
|
||||||
|
if (!isEmpty(data)) {
|
||||||
|
v = data.map((e) => `"${e.key}"`).join(" | ");
|
||||||
}
|
}
|
||||||
})
|
|
||||||
.catch((err) => {});
|
return `type DictKey = ${v}`;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建 eps
|
// 创建 eps
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user