mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-06-06 00:18:51 +08:00
refactor: 接口命名规则统一为kebab-case
串式命名法
This commit is contained in:
parent
73b5d3ec41
commit
320ee2b206
@ -322,7 +322,7 @@
|
|||||||
- Add front-end single sign-on, test address https://yiming_chang.gitee.io/vue-pure-admin/#/pure-table/index?username=sso&roles=admin&accessToken=eyJhbGciOiJIUzUxMiJ9.admin
|
- Add front-end single sign-on, test address https://yiming_chang.gitee.io/vue-pure-admin/#/pure-table/index?username=sso&roles=admin&accessToken=eyJhbGciOiJIUzUxMiJ9.admin
|
||||||
- Add more examples for [@pureadmin/table](https://github.com/pure-admin/pure-admin-table) and `element-plus` [table](https://element-plus.org /zh-CN/component/table.html) example remains the same
|
- Add more examples for [@pureadmin/table](https://github.com/pure-admin/pure-admin-table) and `element-plus` [table](https://element-plus.org /zh-CN/component/table.html) example remains the same
|
||||||
- Rich watermark function page (supports customizing various colors, shadows, text, additional attributes, setting undeletable watermarks and setting watermarks for specified elements)
|
- Rich watermark function page (supports customizing various colors, shadows, text, additional attributes, setting undeletable watermarks and setting watermarks for specified elements)
|
||||||
- Optimize the menu, add `MenuArrowIconNoTransition` global configuration, configure it in `public/serverConfig.json`, for the left menu mode, the menu expansion can be set `MenuArrowIconNoTransition: true` to solve
|
- Optimize the menu, add `MenuArrowIconNoTransition` global configuration, configure it in `public/platform-config.json`, for the left menu mode, the menu expansion can be set `MenuArrowIconNoTransition: true` to solve
|
||||||
- Replacement form designer component demo
|
- Replacement form designer component demo
|
||||||
|
|
||||||
### 🐞 Bug fixes
|
### 🐞 Bug fixes
|
||||||
|
@ -322,7 +322,7 @@
|
|||||||
- Add front-end single sign-on, test address https://yiming_chang.gitee.io/vue-pure-admin/#/pure-table/index?username=sso&roles=admin&accessToken=eyJhbGciOiJIUzUxMiJ9.admin
|
- Add front-end single sign-on, test address https://yiming_chang.gitee.io/vue-pure-admin/#/pure-table/index?username=sso&roles=admin&accessToken=eyJhbGciOiJIUzUxMiJ9.admin
|
||||||
- Add more examples for [@pureadmin/table](https://github.com/pure-admin/pure-admin-table) and `element-plus` [table](https://element-plus.org /zh-CN/component/table.html) example remains the same
|
- Add more examples for [@pureadmin/table](https://github.com/pure-admin/pure-admin-table) and `element-plus` [table](https://element-plus.org /zh-CN/component/table.html) example remains the same
|
||||||
- Rich watermark function page (supports customizing various colors, shadows, text, additional attributes, setting undeletable watermarks and setting watermarks for specified elements)
|
- Rich watermark function page (supports customizing various colors, shadows, text, additional attributes, setting undeletable watermarks and setting watermarks for specified elements)
|
||||||
- Optimize the menu, add `MenuArrowIconNoTransition` global configuration, configure it in `public/serverConfig.json`, for the left menu mode, the menu expansion can be set `MenuArrowIconNoTransition: true` to solve
|
- Optimize the menu, add `MenuArrowIconNoTransition` global configuration, configure it in `public/platform-config.json`, for the left menu mode, the menu expansion can be set `MenuArrowIconNoTransition: true` to solve
|
||||||
- Replacement form designer component demo
|
- Replacement form designer component demo
|
||||||
|
|
||||||
### 🐞 Bug fixes
|
### 🐞 Bug fixes
|
||||||
|
@ -321,7 +321,7 @@
|
|||||||
- 添加前端单点登录,测试地址 https://yiming_chang.gitee.io/vue-pure-admin/#/pure-table/index?username=sso&roles=admin&accessToken=eyJhbGciOiJIUzUxMiJ9.admin
|
- 添加前端单点登录,测试地址 https://yiming_chang.gitee.io/vue-pure-admin/#/pure-table/index?username=sso&roles=admin&accessToken=eyJhbGciOiJIUzUxMiJ9.admin
|
||||||
- 为 [@pureadmin/table](https://github.com/pure-admin/pure-admin-table) 添加更多的示例和 `element-plus` 的 [table](https://element-plus.org/zh-CN/component/table.html) 示例保持一致
|
- 为 [@pureadmin/table](https://github.com/pure-admin/pure-admin-table) 添加更多的示例和 `element-plus` 的 [table](https://element-plus.org/zh-CN/component/table.html) 示例保持一致
|
||||||
- 丰富水印功能页面(支持自定义各种颜色、阴影、文字、额外属性、设置不可删除水印以及给指定元素设置水印)
|
- 丰富水印功能页面(支持自定义各种颜色、阴影、文字、额外属性、设置不可删除水印以及给指定元素设置水印)
|
||||||
- 优化菜单,添加 `MenuArrowIconNoTransition` 全局配置,在 `public/serverConfig.json` 中配置即可,对于出现左侧菜单模式,菜单展开卡顿的可设置 `MenuArrowIconNoTransition: true` 即可解决
|
- 优化菜单,添加 `MenuArrowIconNoTransition` 全局配置,在 `public/platform-config.json` 中配置即可,对于出现左侧菜单模式,菜单展开卡顿的可设置 `MenuArrowIconNoTransition: true` 即可解决
|
||||||
- 更换表单设计器组件演示
|
- 更换表单设计器组件演示
|
||||||
|
|
||||||
### 🐞 Bug fixes
|
### 🐞 Bug fixes
|
||||||
|
@ -200,7 +200,7 @@ const tabsRouter = {
|
|||||||
|
|
||||||
export default [
|
export default [
|
||||||
{
|
{
|
||||||
url: "/getAsyncRoutes",
|
url: "/get-async-routes",
|
||||||
method: "get",
|
method: "get",
|
||||||
response: () => {
|
response: () => {
|
||||||
return {
|
return {
|
||||||
|
@ -2,7 +2,7 @@ import { MockMethod } from "vite-plugin-mock";
|
|||||||
|
|
||||||
export default [
|
export default [
|
||||||
{
|
{
|
||||||
url: "/getCardList",
|
url: "/get-card-list",
|
||||||
method: "post",
|
method: "post",
|
||||||
response: () => {
|
response: () => {
|
||||||
return {
|
return {
|
||||||
@ -559,7 +559,7 @@ export default [
|
|||||||
{
|
{
|
||||||
created_at: "2022-11-21T09:14:22Z",
|
created_at: "2022-11-21T09:14:22Z",
|
||||||
published_at: "2022-11-21T09:15:24Z",
|
published_at: "2022-11-21T09:15:24Z",
|
||||||
body: "# 3.7.0 (2022-11-21)\r\n\r\n### ✔️ refactor\r\n\r\n- 使用 `intro.js` 替换 `driver.js`\r\n\r\n### 🎫 Feat\r\n\r\n- 添加前端单点登录,测试地址 https://yiming_chang.gitee.io/vue-pure-admin/#/pure-table/index?username=sso&roles=admin&accessToken=eyJhbGciOiJIUzUxMiJ9.admin\r\n- 为 [@pureadmin/table](https://github.com/xiaoxian521/pure-admin-table) 添加更多的示例和 `element-plus` 的 [table](https://element-plus.org/zh-CN/component/table.html) 示例保持一致\r\n- 丰富水印功能页面(支持自定义各种颜色、阴影、文字、额外属性、设置不可删除水印以及给指定元素设置水印)\r\n- 优化菜单,添加 `MenuArrowIconNoTransition` 全局配置,在 `public/serverConfig.json` 中配置即可,对于出现左侧菜单模式,菜单展开卡顿的可设置 `MenuArrowIconNoTransition: true` 即可解决\r\n- 更换表单设计器组件演示\r\n\r\n### 🐞 Bug fixes\r\n\r\n- 修复页内菜单带参互相跳转,标签没有选中高亮\r\n\r\n### 🍏 Perf\r\n\r\n- 删除已废弃的 `$baseUrl`\r\n- 兼容引入某个库导致 `global is not defined` 报错,将 `src/utils/globalPolyfills.ts` 文件引入 `src/main.ts` 即可解决\r\n- 删除 `@vitejs/plugin-legacy`,`vue3` 无法通过任何工具使其支持 `ie`"
|
body: "# 3.7.0 (2022-11-21)\r\n\r\n### ✔️ refactor\r\n\r\n- 使用 `intro.js` 替换 `driver.js`\r\n\r\n### 🎫 Feat\r\n\r\n- 添加前端单点登录,测试地址 https://yiming_chang.gitee.io/vue-pure-admin/#/pure-table/index?username=sso&roles=admin&accessToken=eyJhbGciOiJIUzUxMiJ9.admin\r\n- 为 [@pureadmin/table](https://github.com/xiaoxian521/pure-admin-table) 添加更多的示例和 `element-plus` 的 [table](https://element-plus.org/zh-CN/component/table.html) 示例保持一致\r\n- 丰富水印功能页面(支持自定义各种颜色、阴影、文字、额外属性、设置不可删除水印以及给指定元素设置水印)\r\n- 优化菜单,添加 `MenuArrowIconNoTransition` 全局配置,在 `public/platform-config.json` 中配置即可,对于出现左侧菜单模式,菜单展开卡顿的可设置 `MenuArrowIconNoTransition: true` 即可解决\r\n- 更换表单设计器组件演示\r\n\r\n### 🐞 Bug fixes\r\n\r\n- 修复页内菜单带参互相跳转,标签没有选中高亮\r\n\r\n### 🍏 Perf\r\n\r\n- 删除已废弃的 `$baseUrl`\r\n- 兼容引入某个库导致 `global is not defined` 报错,将 `src/utils/globalPolyfills.ts` 文件引入 `src/main.ts` 即可解决\r\n- 删除 `@vitejs/plugin-legacy`,`vue3` 无法通过任何工具使其支持 `ie`"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
created_at: "2022-11-10T04:17:05Z",
|
created_at: "2022-11-10T04:17:05Z",
|
||||||
|
@ -25,7 +25,7 @@ const mapList = (): Array<mapType> => {
|
|||||||
|
|
||||||
export default [
|
export default [
|
||||||
{
|
{
|
||||||
url: "/getMapInfo",
|
url: "/get-map-info",
|
||||||
method: "get",
|
method: "get",
|
||||||
response: () => {
|
response: () => {
|
||||||
return {
|
return {
|
||||||
|
@ -3,7 +3,7 @@ import { MockMethod } from "vite-plugin-mock";
|
|||||||
// 模拟刷新token接口
|
// 模拟刷新token接口
|
||||||
export default [
|
export default [
|
||||||
{
|
{
|
||||||
url: "/refreshToken",
|
url: "/refresh-token",
|
||||||
method: "post",
|
method: "post",
|
||||||
response: ({ body }) => {
|
response: ({ body }) => {
|
||||||
if (body.refreshToken) {
|
if (body.refreshToken) {
|
||||||
|
@ -10,7 +10,7 @@ type Result = {
|
|||||||
|
|
||||||
/** 卡片列表 */
|
/** 卡片列表 */
|
||||||
export const getCardList = (data?: object) => {
|
export const getCardList = (data?: object) => {
|
||||||
return http.request<Result>("post", "/getCardList", { data });
|
return http.request<Result>("post", "/get-card-list", { data });
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 版本日志 */
|
/** 版本日志 */
|
||||||
|
@ -7,5 +7,5 @@ type Result = {
|
|||||||
|
|
||||||
/** 地图数据 */
|
/** 地图数据 */
|
||||||
export const mapJson = (params?: object) => {
|
export const mapJson = (params?: object) => {
|
||||||
return http.request<Result>("get", "/getMapInfo", { params });
|
return http.request<Result>("get", "/get-map-info", { params });
|
||||||
};
|
};
|
||||||
|
@ -6,5 +6,5 @@ type Result = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const getAsyncRoutes = () => {
|
export const getAsyncRoutes = () => {
|
||||||
return http.request<Result>("get", "/getAsyncRoutes");
|
return http.request<Result>("get", "/get-async-routes");
|
||||||
};
|
};
|
||||||
|
@ -35,5 +35,5 @@ export const getLogin = (data?: object) => {
|
|||||||
|
|
||||||
/** 刷新token */
|
/** 刷新token */
|
||||||
export const refreshTokenApi = (data?: object) => {
|
export const refreshTokenApi = (data?: object) => {
|
||||||
return http.request<RefreshTokenResult>("post", "/refreshToken", { data });
|
return http.request<RefreshTokenResult>("post", "/refresh-token", { data });
|
||||||
};
|
};
|
||||||
|
@ -8,7 +8,7 @@ const setConfig = (cfg?: unknown) => {
|
|||||||
config = Object.assign(config, cfg);
|
config = Object.assign(config, cfg);
|
||||||
};
|
};
|
||||||
|
|
||||||
const getConfig = (key?: string): ServerConfigs => {
|
const getConfig = (key?: string): PlatformConfigs => {
|
||||||
if (typeof key === "string") {
|
if (typeof key === "string") {
|
||||||
const arr = key.split(".");
|
const arr = key.split(".");
|
||||||
if (arr && arr.length) {
|
if (arr && arr.length) {
|
||||||
@ -27,11 +27,11 @@ const getConfig = (key?: string): ServerConfigs => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** 获取项目动态全局配置 */
|
/** 获取项目动态全局配置 */
|
||||||
export const getServerConfig = async (app: App): Promise<undefined> => {
|
export const getPlatformConfig = async (app: App): Promise<undefined> => {
|
||||||
app.config.globalProperties.$config = getConfig();
|
app.config.globalProperties.$config = getConfig();
|
||||||
return axios({
|
return axios({
|
||||||
method: "get",
|
method: "get",
|
||||||
url: `${VITE_PUBLIC_PATH}serverConfig.json`
|
url: `${VITE_PUBLIC_PATH}platform-config.json`
|
||||||
})
|
})
|
||||||
.then(({ data: config }) => {
|
.then(({ data: config }) => {
|
||||||
let $config = app.config.globalProperties.$config;
|
let $config = app.config.globalProperties.$config;
|
||||||
@ -45,7 +45,7 @@ export const getServerConfig = async (app: App): Promise<undefined> => {
|
|||||||
return $config;
|
return $config;
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
throw "请在public文件夹下添加serverConfig.json配置文件";
|
throw "请在public文件夹下添加platform-config.json配置文件";
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ export function useLayout() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 清空缓存后从serverConfig.json读取默认配置并赋值到storage中 */
|
/** 清空缓存后从platform-config.json读取默认配置并赋值到storage中 */
|
||||||
const layout = computed(() => {
|
const layout = computed(() => {
|
||||||
return $storage?.layout.layout;
|
return $storage?.layout.layout;
|
||||||
});
|
});
|
||||||
|
@ -3,7 +3,7 @@ import router from "./router";
|
|||||||
import { setupStore } from "@/store";
|
import { setupStore } from "@/store";
|
||||||
import ElementPlus from "element-plus";
|
import ElementPlus from "element-plus";
|
||||||
import { useI18n } from "@/plugins/i18n";
|
import { useI18n } from "@/plugins/i18n";
|
||||||
import { getServerConfig } from "./config";
|
import { getPlatformConfig } from "./config";
|
||||||
import { createApp, Directive } from "vue";
|
import { createApp, Directive } from "vue";
|
||||||
import { MotionPlugin } from "@vueuse/motion";
|
import { MotionPlugin } from "@vueuse/motion";
|
||||||
import { useEcharts } from "@/plugins/echarts";
|
import { useEcharts } from "@/plugins/echarts";
|
||||||
@ -45,7 +45,7 @@ app.component("FontIcon", FontIcon);
|
|||||||
import { Auth } from "@/components/ReAuth";
|
import { Auth } from "@/components/ReAuth";
|
||||||
app.component("Auth", Auth);
|
app.component("Auth", Auth);
|
||||||
|
|
||||||
getServerConfig(app).then(async config => {
|
getPlatformConfig(app).then(async config => {
|
||||||
setupStore(app);
|
setupStore(app);
|
||||||
app.use(router);
|
app.use(router);
|
||||||
await router.isReady();
|
await router.isReady();
|
||||||
|
@ -4,7 +4,7 @@ import Storage from "responsive-storage";
|
|||||||
import { routerArrays } from "@/layout/types";
|
import { routerArrays } from "@/layout/types";
|
||||||
import { responsiveStorageNameSpace } from "@/config";
|
import { responsiveStorageNameSpace } from "@/config";
|
||||||
|
|
||||||
export const injectResponsiveStorage = (app: App, config: ServerConfigs) => {
|
export const injectResponsiveStorage = (app: App, config: PlatformConfigs) => {
|
||||||
const nameSpace = responsiveStorageNameSpace();
|
const nameSpace = responsiveStorageNameSpace();
|
||||||
const configObj = Object.assign(
|
const configObj = Object.assign(
|
||||||
{
|
{
|
||||||
|
12
types/global.d.ts
vendored
12
types/global.d.ts
vendored
@ -72,10 +72,10 @@ declare global {
|
|||||||
interface TableColumnList extends Array<TableColumns> {}
|
interface TableColumnList extends Array<TableColumns> {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 对应 `public/serverConfig.json` 文件的类型声明
|
* 对应 `public/platform-config.json` 文件的类型声明
|
||||||
* @see {@link https://yiming_chang.gitee.io/pure-admin-doc/pages/config/#serverconfig-json}
|
* @see {@link https://yiming_chang.gitee.io/pure-admin-doc/pages/config/#platform-config-json}
|
||||||
*/
|
*/
|
||||||
interface ServerConfigs {
|
interface PlatformConfigs {
|
||||||
Version?: string;
|
Version?: string;
|
||||||
Title?: string;
|
Title?: string;
|
||||||
FixedHeader?: boolean;
|
FixedHeader?: boolean;
|
||||||
@ -108,8 +108,8 @@ declare global {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 与 `ServerConfigs` 类型不同,这里是缓存到浏览器本地存储的类型声明
|
* 与 `PlatformConfigs` 类型不同,这里是缓存到浏览器本地存储的类型声明
|
||||||
* @see {@link https://yiming_chang.gitee.io/pure-admin-doc/pages/config/#serverconfig-json}
|
* @see {@link https://yiming_chang.gitee.io/pure-admin-doc/pages/config/#platform-config-json}
|
||||||
*/
|
*/
|
||||||
interface StorageConfigs {
|
interface StorageConfigs {
|
||||||
version?: string;
|
version?: string;
|
||||||
@ -171,6 +171,6 @@ declare global {
|
|||||||
interface GlobalPropertiesApi {
|
interface GlobalPropertiesApi {
|
||||||
$echarts: ECharts;
|
$echarts: ECharts;
|
||||||
$storage: ResponsiveStorage;
|
$storage: ResponsiveStorage;
|
||||||
$config: ServerConfigs;
|
$config: PlatformConfigs;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user