Skip to content

Commit

Permalink
[Optimize]optimize_devops & code prettier (#2238)
Browse files Browse the repository at this point in the history
* optimize_devops & code prettier

* code prettier
  • Loading branch information
zackyoungh authored Aug 18, 2023
1 parent 42d9962 commit be7faa1
Show file tree
Hide file tree
Showing 369 changed files with 23,996 additions and 17,665 deletions.
15 changes: 8 additions & 7 deletions dinky-web/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
*/

// https://umijs.org/config/
import {defineConfig} from '@umijs/max';
import {join} from 'path';
import { defineConfig } from '@umijs/max';
import { join } from 'path';
import defaultSettings from './defaultSettings';
import proxy from './proxy';
import routes from './routes';

const {REACT_APP_ENV = 'dev'} = process.env;
const { REACT_APP_ENV = 'dev' } = process.env;

export default defineConfig({
/**
Expand Down Expand Up @@ -166,7 +166,7 @@ export default defineConfig({
*/
headScripts: [
// 解决首次加载时白屏的问题
{src: '/scripts/loading.js', async: true},
{ src: '/scripts/loading.js', async: true },
],
//================ pro 插件配置 =================
presets: ['umi-presets-pro'],
Expand All @@ -177,15 +177,16 @@ export default defineConfig({
*/
openAPI: [
{
requestLibPath: 'import { request } from \'@umijs/max\'',
requestLibPath: "import { request } from '@umijs/max'",
// 或者使用在线的版本
// schemaPath: "https://gw.alipayobjects.com/os/antfincdn/M%24jrzTTYJN/oneapi.json"
schemaPath: join(__dirname, 'oneapi.json'),
mock: false,
},
{
requestLibPath: 'import { request } from \'@umijs/max\'',
schemaPath: 'https://gw.alipayobjects.com/os/antfincdn/CA1dOm%2631B/openapi.json',
requestLibPath: "import { request } from '@umijs/max'",
schemaPath:
'https://gw.alipayobjects.com/os/antfincdn/CA1dOm%2631B/openapi.json',
projectName: 'swagger',
},
],
Expand Down
2 changes: 1 addition & 1 deletion dinky-web/config/defaultSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const Settings: ProLayoutProps & {
pageContainer: {
paddingBlockPageContainerContent: 5,
paddingInlinePageContainerContent: 10,
}
},
},
};

Expand Down
5 changes: 2 additions & 3 deletions dinky-web/config/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ export default [
hideInMenu: true,
component: './DevOps/JobDetail',
},

],
},
{
Expand Down Expand Up @@ -118,8 +117,8 @@ export default [
routes: [
{
path: '/registration/database/detail/:id',
}
]
},
],
},
{
path: '/registration/alert',
Expand Down
6 changes: 3 additions & 3 deletions dinky-web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<artifactId>dinky-web</artifactId>
<packaging>pom</packaging>

<name>Dinky : Dinky-Web</name>
<name>Dinky : Web</name>

<build>
<finalName>${project.artifactId}-${project.version}</finalName>
Expand All @@ -38,8 +38,8 @@
<artifactId>frontend-maven-plugin</artifactId>
<version>1.12.0</version>
<configuration>
<nodeVersion>v14.17.0</nodeVersion>
<npmVersion>7.19.0</npmVersion>
<nodeVersion>v16.17.0</nodeVersion>
<npmVersion>8.19.0</npmVersion>
<!-- 国内node下载加速 -->
<!--<nodeDownloadRoot>https://mirrors.huaweicloud.com/nodejs/</nodeDownloadRoot>-->
<!--<npmDownloadRoot>https://repo.huaweicloud.com/npm-software/</npmDownloadRoot>-->
Expand Down
6 changes: 4 additions & 2 deletions dinky-web/src/access.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ import { API } from './services/data';
/**
* @see https://umijs.org/zh-CN/plugins/plugin-access
* */
export default function access(initialState: { currentUser?: API.CurrentUser } | undefined) {
export default function access(
initialState: { currentUser?: API.CurrentUser } | undefined,
) {
const { currentUser } = initialState ?? {};
return {
canAdmin: currentUser && currentUser.user.superAdminFlag,
canAuth({ path, ...route }:{path:string}) {
canAuth({ path, ...route }: { path: string }) {
if (currentUser && currentUser.user.superAdminFlag) {
return true;
}
Expand Down
Loading

0 comments on commit be7faa1

Please sign in to comment.