xto-fronted 0.4.61 → 0.4.62
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/index-BHQIqN1E.js +372 -0
- package/dist/index-BZKw7U60.js +475 -0
- package/dist/index-Cn_4o3fi.js +345 -0
- package/dist/index-Djdb936p.js +142 -0
- package/dist/index-DwJILh-Q.js +3149 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.es.js +61 -60
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
- package/src/index.ts +36 -0
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,6 +1,42 @@
|
|
|
1
1
|
// 样式
|
|
2
2
|
import './style.scss'
|
|
3
3
|
|
|
4
|
+
// 配置
|
|
5
|
+
import { initAppConfig, getAppId, getClientId, getApiBaseUrl } from './utils/config'
|
|
6
|
+
|
|
7
|
+
// XtoConfig 类型定义
|
|
8
|
+
export interface XtoConfig {
|
|
9
|
+
appName?: string
|
|
10
|
+
appId?: string
|
|
11
|
+
clientId?: string
|
|
12
|
+
apiBaseUrl?: string
|
|
13
|
+
indexPath?: string
|
|
14
|
+
loginPath?: string
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* 初始化 XTO 应用
|
|
19
|
+
* 在项目入口文件中调用此函数设置应用配置
|
|
20
|
+
* @param config 应用配置
|
|
21
|
+
*/
|
|
22
|
+
export function createXtoApp(config: Partial<XtoConfig>) {
|
|
23
|
+
initAppConfig({
|
|
24
|
+
appId: config.appId,
|
|
25
|
+
clientId: config.clientId,
|
|
26
|
+
apiBaseUrl: config.apiBaseUrl
|
|
27
|
+
})
|
|
28
|
+
return {
|
|
29
|
+
config: {
|
|
30
|
+
appName: config.appName || 'XTO App',
|
|
31
|
+
appId: getAppId(),
|
|
32
|
+
clientId: getClientId(),
|
|
33
|
+
apiBaseUrl: getApiBaseUrl(),
|
|
34
|
+
indexPath: config.indexPath || '/dashboard',
|
|
35
|
+
loginPath: config.loginPath || '/login'
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
4
40
|
// 组件
|
|
5
41
|
export { default as Layout } from './components/Layout/index.vue'
|
|
6
42
|
export { default as Header } from './components/Layout/Header.vue'
|