Skip to content

Commit 52f76fe

Browse files
committed
update
1 parent 74bd8b6 commit 52f76fe

File tree

6 files changed

+41
-4
lines changed

6 files changed

+41
-4
lines changed

template/base/.eslintrc.cjs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// @ts-check
2-
require('@rushstack/eslint-patch/modern-module-resolution')
2+
require('@rushstack/eslint-patch/modern-module-resolution');
33
/**
44
* ESLint Configuration File
55
*
@@ -38,12 +38,13 @@ module.exports = {
3838
extends: ['eslint:recommended', 'plugin:prettier/recommended'],
3939
},
4040
{
41-
files: ['./public/**/*.js'],
41+
files: ['./public/*.js'],
4242
env: {
4343
browser: true,
4444
},
4545
parserOptions: {
4646
sourceType: 'module',
47+
requireConfigFile: false,
4748
},
4849
rules: {
4950
'no-unused-vars': 'off',
@@ -105,7 +106,7 @@ module.exports = {
105106
'plugin:prettier/recommended',
106107
'plugin:vue/vue3-essential',
107108
'@vue/eslint-config-typescript',
108-
'@vue/eslint-config-prettier/skip-formatting'
109+
'@vue/eslint-config-prettier/skip-formatting',
109110
],
110111
rules: {
111112
'no-unreachable': 'warn',

template/base/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"query-string": "^8.2.0"
1515
},
1616
"devDependencies": {
17+
"@babel/eslint-parser": "^7.23.10",
1718
"@vitejs/plugin-vue": "^5.0.3",
1819
"vite": "^5.0.11",
1920
"husky": "^9.0.11",

template/base/src/api/apisTest.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { axios_backend_api } from '@/api/apiIndex';
2+
3+
/**
4+
* 上报案件
5+
*/
6+
export const apiUploadCase = (data: Record<string, any>) => {
7+
return axios_backend_api.request({
8+
url: '/api/si/scdld/upload',
9+
method: 'post',
10+
data,
11+
});
12+
};
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import queryString from 'query-string';
2+
3+
const public_config = (window as Record<string, any>)['CUSTOM_PUBLIC_CONFIG'];
4+
const paramsObj = queryString.parse(window.___location.search);
5+
6+
const local_config = {
7+
baseUrl: {
8+
/*dev*/
9+
backend_dev: '//localhost:8088',
10+
11+
/*pro*/
12+
backend_pro: BACKEND + '/api/test/',
13+
},
14+
mockMode: !!1,
15+
};
16+
const baseUrl_config = Object.assign({}, local_config.baseUrl, public_config.baseUrl);
17+
const merge_config = Object.assign({}, local_config, public_config);
18+
merge_config.baseUrl = baseUrl_config;
19+
export default merge_config;

template/base/vite.config.js.ejs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ export default ({ mode }: any) => {
2020
alias: {
2121
'@': fileURLToPath(new URL('./src', import.meta.url))
2222
}
23-
}
23+
},
24+
define: {
25+
BACKEND: JSON.stringify(process.env.BACKEND),
26+
},
2427
});
2528
}

template/config/typescript/env.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/// <reference types="vite/client" />
2+
declare const BACKEND: string

0 commit comments

Comments
 (0)