@freelog/tools-lib 0.1.105 → 0.1.108
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/service-API/combinations/index.d.ts +7 -0
- package/dist/service-API/index.d.ts +2 -0
- package/dist/service-API/resources.d.ts +2 -2
- package/dist/service-API/storages.d.ts +5 -2
- package/dist/service-API/user.d.ts +6 -0
- package/dist/tools-lib.cjs.development.js +91 -11
- package/dist/tools-lib.cjs.development.js.map +1 -1
- package/dist/tools-lib.cjs.production.min.js +1 -1
- package/dist/tools-lib.cjs.production.min.js.map +1 -1
- package/dist/tools-lib.esm.js +91 -11
- package/dist/tools-lib.esm.js.map +1 -1
- package/dist/utils/format.d.ts +5 -0
- package/package.json +67 -65
- package/src/i18n/I18nNext.ts +146 -134
- package/src/i18n/index.ts +7 -7
- package/src/index.ts +9 -9
- package/src/service-API/combinations/index.ts +27 -0
- package/src/service-API/i18n.ts +35 -35
- package/src/service-API/index.ts +2 -0
- package/src/service-API/resources.ts +2 -2
- package/src/service-API/storages.ts +358 -345
- package/src/service-API/user.ts +205 -190
- package/src/utils/format.ts +9 -0
- package/src/utils/index.ts +20 -20
package/dist/utils/format.d.ts
CHANGED
|
@@ -22,3 +22,8 @@ export declare function policyCodeTranslationToText(code: string, targetType: st
|
|
|
22
22
|
error: string[] | null;
|
|
23
23
|
text?: string;
|
|
24
24
|
}>;
|
|
25
|
+
/**
|
|
26
|
+
* 将资源类型关键字数组,转换成标准展示文字
|
|
27
|
+
* @param arr 关键字数组
|
|
28
|
+
*/
|
|
29
|
+
export declare function resourceTypeKeyArrToResourceType(arr: string[]): string;
|
package/package.json
CHANGED
|
@@ -1,65 +1,67 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@freelog/tools-lib",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"license": "MIT",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"typings": "dist/index.d.ts",
|
|
7
|
-
"files": [
|
|
8
|
-
"dist",
|
|
9
|
-
"src"
|
|
10
|
-
],
|
|
11
|
-
"engines": {
|
|
12
|
-
"node": ">=10"
|
|
13
|
-
},
|
|
14
|
-
"scripts": {
|
|
15
|
-
"start": "tsdx watch",
|
|
16
|
-
"build": "tsdx build",
|
|
17
|
-
"test": "tsdx test",
|
|
18
|
-
"lint": "tsdx lint",
|
|
19
|
-
"prepare": "tsdx build",
|
|
20
|
-
"size": "size-limit",
|
|
21
|
-
"analyze": "size-limit --why",
|
|
22
|
-
"publish": "npm publish --access public"
|
|
23
|
-
},
|
|
24
|
-
"peerDependencies": {},
|
|
25
|
-
"husky": {
|
|
26
|
-
"hooks": {}
|
|
27
|
-
},
|
|
28
|
-
"prettier": {
|
|
29
|
-
"printWidth": 80,
|
|
30
|
-
"semi": true,
|
|
31
|
-
"singleQuote": true,
|
|
32
|
-
"trailingComma": "es5"
|
|
33
|
-
},
|
|
34
|
-
"author": "liu-kai-github",
|
|
35
|
-
"module": "dist/tools-lib.esm.js",
|
|
36
|
-
"size-limit": [
|
|
37
|
-
{
|
|
38
|
-
"path": "dist/tools-lib.cjs.production.min.js",
|
|
39
|
-
"limit": "10 KB"
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
"path": "dist/tools-lib.esm.js",
|
|
43
|
-
"limit": "10 KB"
|
|
44
|
-
}
|
|
45
|
-
],
|
|
46
|
-
"devDependencies": {
|
|
47
|
-
"@size-limit/preset-small-lib": "^4.11.0",
|
|
48
|
-
"@types/crypto-js": "^4.0.1",
|
|
49
|
-
"@types/
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
"@freelog/
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@freelog/tools-lib",
|
|
3
|
+
"version": "0.1.108",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"typings": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"src"
|
|
10
|
+
],
|
|
11
|
+
"engines": {
|
|
12
|
+
"node": ">=10"
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"start": "tsdx watch",
|
|
16
|
+
"build": "tsdx build",
|
|
17
|
+
"test": "tsdx test",
|
|
18
|
+
"lint": "tsdx lint",
|
|
19
|
+
"prepare": "tsdx build",
|
|
20
|
+
"size": "size-limit",
|
|
21
|
+
"analyze": "size-limit --why",
|
|
22
|
+
"publish": "npm publish --access public"
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {},
|
|
25
|
+
"husky": {
|
|
26
|
+
"hooks": {}
|
|
27
|
+
},
|
|
28
|
+
"prettier": {
|
|
29
|
+
"printWidth": 80,
|
|
30
|
+
"semi": true,
|
|
31
|
+
"singleQuote": true,
|
|
32
|
+
"trailingComma": "es5"
|
|
33
|
+
},
|
|
34
|
+
"author": "liu-kai-github",
|
|
35
|
+
"module": "dist/tools-lib.esm.js",
|
|
36
|
+
"size-limit": [
|
|
37
|
+
{
|
|
38
|
+
"path": "dist/tools-lib.cjs.production.min.js",
|
|
39
|
+
"limit": "10 KB"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"path": "dist/tools-lib.esm.js",
|
|
43
|
+
"limit": "10 KB"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@size-limit/preset-small-lib": "^4.11.0",
|
|
48
|
+
"@types/crypto-js": "^4.0.1",
|
|
49
|
+
"@types/js-cookie": "^3.0.2",
|
|
50
|
+
"@types/nprogress": "^0.2.0",
|
|
51
|
+
"husky": "^6.0.0",
|
|
52
|
+
"size-limit": "^4.11.0",
|
|
53
|
+
"tsdx": "^0.14.1",
|
|
54
|
+
"tslib": "^2.2.0",
|
|
55
|
+
"typescript": "^4.3.2"
|
|
56
|
+
},
|
|
57
|
+
"dependencies": {
|
|
58
|
+
"@freelog/resource-policy-lang": "1.1.26",
|
|
59
|
+
"@freelog/tools-lib": "^0.1.43",
|
|
60
|
+
"axios": "^0.21.1",
|
|
61
|
+
"crypto-js": "^4.0.0",
|
|
62
|
+
"i18next": "^21.8.10",
|
|
63
|
+
"js-cookie": "^3.0.1",
|
|
64
|
+
"moment": "^2.29.1",
|
|
65
|
+
"nprogress": "^0.2.0"
|
|
66
|
+
}
|
|
67
|
+
}
|
package/src/i18n/I18nNext.ts
CHANGED
|
@@ -1,134 +1,146 @@
|
|
|
1
|
-
import i18next, {Resource} from 'i18next';
|
|
2
|
-
import axios from "axios";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
private
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
|
|
1
|
+
import i18next, {Resource} from 'i18next';
|
|
2
|
+
import axios from "axios";
|
|
3
|
+
import Cookies from 'js-cookie';
|
|
4
|
+
import FUtil from '../utils';
|
|
5
|
+
|
|
6
|
+
type LanguageKeyType = 'zh_CN' | 'en_US';
|
|
7
|
+
|
|
8
|
+
const ossJsonUrl: string = 'https://freelog-i18n.oss-cn-shenzhen.aliyuncs.com/configs/i18n.json';
|
|
9
|
+
const localStorage_i18nextLng_key: string = 'locale';
|
|
10
|
+
const localStorage_i18nextResources_key: string = 'i18nextResources';
|
|
11
|
+
|
|
12
|
+
const allLanguage = [
|
|
13
|
+
{value: 'en_US', label: 'English'},
|
|
14
|
+
{value: 'zh_CN', label: '简体中文'},
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
let self: I18nNext;
|
|
18
|
+
|
|
19
|
+
class I18nNext {
|
|
20
|
+
|
|
21
|
+
private _loadingData: 'NotStart' | 'Start' | 'End' = 'NotStart';
|
|
22
|
+
private _taskQueue: Function[] = [];
|
|
23
|
+
// private _currentLanguage: LanguageKeyType = window.localStorage.getItem(localStorage_i18nextLng_key) as null || 'zh_CN';
|
|
24
|
+
private _currentLanguage: LanguageKeyType = Cookies.get(localStorage_i18nextLng_key) as undefined || 'zh_CN';
|
|
25
|
+
|
|
26
|
+
constructor() {
|
|
27
|
+
self = this;
|
|
28
|
+
self.ready();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
async ready() {
|
|
32
|
+
const exc = () => {
|
|
33
|
+
while (self._taskQueue.length > 0) {
|
|
34
|
+
const task = self._taskQueue.shift();
|
|
35
|
+
task && task();
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
const handleTasks = async () => {
|
|
39
|
+
if (self._loadingData === 'End') {
|
|
40
|
+
exc();
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (self._loadingData === 'Start') {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// NO_START
|
|
48
|
+
self._loadingData = 'Start';
|
|
49
|
+
|
|
50
|
+
await self._handleData();
|
|
51
|
+
// console.log('######');
|
|
52
|
+
exc();
|
|
53
|
+
};
|
|
54
|
+
const promise = new Promise((resolve) => {
|
|
55
|
+
self._taskQueue.push(resolve);
|
|
56
|
+
});
|
|
57
|
+
handleTasks();
|
|
58
|
+
return promise;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
t(key: string, options?: { [key: string]: any }) {
|
|
62
|
+
return i18next.t(key, options);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
changeLanguage(lng: LanguageKeyType) {
|
|
66
|
+
// return i18next.changeLanguage(lng);
|
|
67
|
+
// window.localStorage.setItem(localStorage_i18nextLng_key, lng)
|
|
68
|
+
Cookies.set(localStorage_i18nextLng_key, lng, {
|
|
69
|
+
expires: 36525,
|
|
70
|
+
domain: FUtil.Format.completeUrlByDomain('').replace(/http(s)?:\/\//, ''),
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
getAllLanguage(): typeof allLanguage {
|
|
75
|
+
return allLanguage;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
getCurrentLanguage(): LanguageKeyType {
|
|
79
|
+
return self._currentLanguage;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
private async _handleData() {
|
|
83
|
+
|
|
84
|
+
const lng: string = self._currentLanguage;
|
|
85
|
+
const resource: string | null = window.localStorage.getItem(localStorage_i18nextResources_key);
|
|
86
|
+
// const resource: string | undefined = Cookies.get(decodeURIComponent(localStorage_i18nextResources_key));
|
|
87
|
+
let i18nextResources: Resource | null = resource ? JSON.parse(resource) : null;
|
|
88
|
+
|
|
89
|
+
if (!i18nextResources) {
|
|
90
|
+
// console.log('######892io3jlkl')
|
|
91
|
+
i18nextResources = await self._fetchData();
|
|
92
|
+
} else {
|
|
93
|
+
self._fetchData();
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
await i18next
|
|
97
|
+
.init({
|
|
98
|
+
// the translations
|
|
99
|
+
// (tip move them in a JSON file and import them,
|
|
100
|
+
// or even better, manage them via a UI: https://react.i18next.com/guides/multiple-translation-files#manage-your-translations-with-a-management-gui)
|
|
101
|
+
resources: i18nextResources,
|
|
102
|
+
lng: lng, // if you're using a language detector, do not define the lng option
|
|
103
|
+
fallbackLng: 'zh_CN',
|
|
104
|
+
|
|
105
|
+
interpolation: {
|
|
106
|
+
escapeValue: false, // react already safes from xss => https://www.i18next.com/translation-function/interpolation#unescape
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
private async _fetchData(): Promise<Resource> {
|
|
112
|
+
const res: any = await axios.get(ossJsonUrl, {
|
|
113
|
+
withCredentials: false,
|
|
114
|
+
});
|
|
115
|
+
// console.log(res, 'data09oiw3qjelsfkdfjlsdkfjl');
|
|
116
|
+
|
|
117
|
+
const en_US: { [key: string]: string } = {};
|
|
118
|
+
const zh_CN: { [key: string]: string } = {};
|
|
119
|
+
|
|
120
|
+
for (const [key, value] of Object.entries(res)) {
|
|
121
|
+
// console.log(key, value, 'key, value90iowsldfjlsdkj');
|
|
122
|
+
en_US[key] = (value as any)['en_US'];
|
|
123
|
+
zh_CN[key] = (value as any)['zh_CN'];
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const result: Resource = {
|
|
127
|
+
en_US: {
|
|
128
|
+
translation: en_US,
|
|
129
|
+
},
|
|
130
|
+
zh_CN: {
|
|
131
|
+
translation: zh_CN,
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
// console.log(result, 'result093sdolkfjlsdkjl');
|
|
136
|
+
window.localStorage.setItem(localStorage_i18nextResources_key, JSON.stringify(result));
|
|
137
|
+
// Cookies.set(localStorage_i18nextResources_key, encodeURIComponent(JSON.stringify(result)), {
|
|
138
|
+
// expires: 36525,
|
|
139
|
+
// domain: FUtil.Format.completeUrlByDomain('').replace(/http(s)?:\/\//, ''),
|
|
140
|
+
// });
|
|
141
|
+
|
|
142
|
+
return result;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export default I18nNext;
|
package/src/i18n/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import I18nNext from './I18nNext';
|
|
2
|
-
|
|
3
|
-
const FI18n = {
|
|
4
|
-
i18nNext: new I18nNext(),
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
export default FI18n;
|
|
1
|
+
import I18nNext from './I18nNext';
|
|
2
|
+
|
|
3
|
+
const FI18n = {
|
|
4
|
+
i18nNext: new I18nNext(),
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export default FI18n;
|
package/src/index.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import FUtil from './utils';
|
|
2
|
-
import FServiceAPI from './service-API';
|
|
3
|
-
import FI18n from './i18n';
|
|
4
|
-
|
|
5
|
-
export {
|
|
6
|
-
FUtil,
|
|
7
|
-
FServiceAPI,
|
|
8
|
-
FI18n,
|
|
9
|
-
};
|
|
1
|
+
import FUtil from './utils';
|
|
2
|
+
import FServiceAPI from './service-API';
|
|
3
|
+
import FI18n from './i18n';
|
|
4
|
+
|
|
5
|
+
export {
|
|
6
|
+
FUtil,
|
|
7
|
+
FServiceAPI,
|
|
8
|
+
FI18n,
|
|
9
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as Storage from '../storages';
|
|
2
|
+
|
|
3
|
+
interface FileInfo {
|
|
4
|
+
sha1: string;
|
|
5
|
+
state: 'success' | 'fail' | 'nonentity';
|
|
6
|
+
dataSource: {
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
interface GetFileInfosBySha1Params {
|
|
12
|
+
sha1: string[];
|
|
13
|
+
cdPartiallySuccess?: (s: any[]) => void;
|
|
14
|
+
cdPartiallyFail?: (f: any[]) => void;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export async function getFilesSha1Info({sha1, cdPartiallySuccess, cdPartiallyFail}: GetFileInfosBySha1Params) {
|
|
18
|
+
const {data} = await Storage.filesListInfo({
|
|
19
|
+
sha1: sha1,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const all: FileInfo[] = [];
|
|
23
|
+
const success: any = [];
|
|
24
|
+
const fail: any = [];
|
|
25
|
+
|
|
26
|
+
console.log(data, all, success, fail, cdPartiallySuccess, cdPartiallyFail, '093oijsdlkfsjdl')
|
|
27
|
+
}
|
package/src/service-API/i18n.ts
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import FUtil from '../utils';
|
|
2
|
-
|
|
3
|
-
// 列出翻译
|
|
4
|
-
interface ConfigsListParamsType {
|
|
5
|
-
key: string;
|
|
6
|
-
content: string;
|
|
7
|
-
tagIds: string[];
|
|
8
|
-
status: 0 | 1 | 2 | 3; // 0:全部 1:待翻译 2:待发布 3:已发布
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function configsList(params: ConfigsListParamsType) {
|
|
12
|
-
// console.log('####@30984i2o3jdsjflfkjsdl')
|
|
13
|
-
return FUtil.Request({
|
|
14
|
-
method: 'POST',
|
|
15
|
-
url: `/v2/i18n/configs/list`,
|
|
16
|
-
data: params,
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// oss保存的翻译
|
|
21
|
-
// interface ConfigsListParamsType {
|
|
22
|
-
// key: string;
|
|
23
|
-
// content: string;
|
|
24
|
-
// tagIds: string[];
|
|
25
|
-
// status: 0 | 1 | 2 | 3; // 0:全部 1:待翻译 2:待发布 3:已发布
|
|
26
|
-
// }
|
|
27
|
-
//
|
|
28
|
-
// export function configsList(params: ConfigsListParamsType) {
|
|
29
|
-
// // console.log('####@30984i2o3jdsjflfkjsdl')
|
|
30
|
-
// return FUtil.Request({
|
|
31
|
-
// method: 'POST',
|
|
32
|
-
// url: `/v2/i18n/configs/list`,
|
|
33
|
-
// data: params,
|
|
34
|
-
// });
|
|
35
|
-
// }
|
|
1
|
+
import FUtil from '../utils';
|
|
2
|
+
|
|
3
|
+
// 列出翻译
|
|
4
|
+
interface ConfigsListParamsType {
|
|
5
|
+
key: string;
|
|
6
|
+
content: string;
|
|
7
|
+
tagIds: string[];
|
|
8
|
+
status: 0 | 1 | 2 | 3; // 0:全部 1:待翻译 2:待发布 3:已发布
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function configsList(params: ConfigsListParamsType) {
|
|
12
|
+
// console.log('####@30984i2o3jdsjflfkjsdl')
|
|
13
|
+
return FUtil.Request({
|
|
14
|
+
method: 'POST',
|
|
15
|
+
url: `/v2/i18n/configs/list`,
|
|
16
|
+
data: params,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// oss保存的翻译
|
|
21
|
+
// interface ConfigsListParamsType {
|
|
22
|
+
// key: string;
|
|
23
|
+
// content: string;
|
|
24
|
+
// tagIds: string[];
|
|
25
|
+
// status: 0 | 1 | 2 | 3; // 0:全部 1:待翻译 2:待发布 3:已发布
|
|
26
|
+
// }
|
|
27
|
+
//
|
|
28
|
+
// export function configsList(params: ConfigsListParamsType) {
|
|
29
|
+
// // console.log('####@30984i2o3jdsjflfkjsdl')
|
|
30
|
+
// return FUtil.Request({
|
|
31
|
+
// method: 'POST',
|
|
32
|
+
// url: `/v2/i18n/configs/list`,
|
|
33
|
+
// data: params,
|
|
34
|
+
// });
|
|
35
|
+
// }
|
package/src/service-API/index.ts
CHANGED
|
@@ -13,6 +13,7 @@ import * as Activity from './activities';
|
|
|
13
13
|
import * as TestQualification from './testQualifications';
|
|
14
14
|
import * as Statistic from './statistics';
|
|
15
15
|
import * as I18n from './i18n';
|
|
16
|
+
import * as C from './combinations';
|
|
16
17
|
|
|
17
18
|
const FServiceAPI = {
|
|
18
19
|
Node,
|
|
@@ -30,6 +31,7 @@ const FServiceAPI = {
|
|
|
30
31
|
TestQualification,
|
|
31
32
|
Statistic,
|
|
32
33
|
I18n,
|
|
34
|
+
C,
|
|
33
35
|
};
|
|
34
36
|
|
|
35
37
|
export default FServiceAPI;
|
|
@@ -17,7 +17,7 @@ interface IResourceInfo {
|
|
|
17
17
|
}[];
|
|
18
18
|
resourceId: string;
|
|
19
19
|
resourceName: string;
|
|
20
|
-
resourceType: string;
|
|
20
|
+
resourceType: string[];
|
|
21
21
|
resourceVersions: {
|
|
22
22
|
createDate: string;
|
|
23
23
|
version: string;
|
|
@@ -33,7 +33,7 @@ interface IResourceInfo {
|
|
|
33
33
|
// 创建资源
|
|
34
34
|
export interface CreateParamsType {
|
|
35
35
|
name: string;
|
|
36
|
-
resourceType: string
|
|
36
|
+
resourceType: string[]
|
|
37
37
|
policies?: any[];
|
|
38
38
|
coverImages?: string[];
|
|
39
39
|
intro?: string;
|