0.0.3 • Published 7 months ago
@bitfirer/web-bootstrap v0.0.3
@bitfirer/web-bootstrap
bitfirer前台前端启动框架
配置与使用方法基本与 @bitfirer/admin-web-bootstrap
框架相同
更新日志
0.8.1-beta0.1
- 401 静默登录
- 401请求转发
v0.8.0
- response code 401 时 不再清除
localstorage
check-app-state.js
中,同一个域下(atSameDomain
),不再调用跨域(使用同域)方法 检查cas
和 业务系统状态
v0.6.0
新增 atSameDomain
配置项,类型: Boolean
,若为 true
则获取getinfo.json
文件的地址将为 ${domain}/cas
v0.5.0
- 生产环境中去除了控制台输出的日志;
- 新增首屏加载
loading
动画; 新增登录系统自动获取
cas
信息的功能,配置项中传入isLoginSystem
即可。配置项中 ... currentSystem: 'Foo', isLoginSystem: process.env.NODE_ENV === 'production' ...
v0.4.2
版本说明:
- 解决了内部
message
事件监听被覆盖导致执行逻辑错乱的问题并规范了message
事件回调函数中的数据结构; - 优化了不同登录状态时的处理逻辑,不再出现
401
情况,取消了loading
页; - 新增通过路由配置能细粒度控制页面状态功能。
更改:
currentSystem
当前系统type String
,传入STATIC_SYSTEM
表示该系统是纯静态系统,例如登录系统,首页并非纯静态系统,它关联了UC
模块- 路由配置,主要为
meta
对象中... meta: { isSinglePage: Boolean, // 表示是否为单个的页面 无头尾导航 isStaticPage: Boolean // 表示是否为静态页面 该页面只会进行 `check` 状态检查 仅此而已 } ...
关于纯静态页的一些说明:
- 不再需要在配置中传入
ApiClient
, 但需要在main.js
中使用 即Vue.use(ApiClient)
api.js
中编写方式import HttpClient from '@bitfirer/http-client' import axios from 'axios' const defaultConfig = { timeout: 2 * 60 * 1000, withCredentials: true } let axiosInstance = axios.create(defaultConfig) axiosInstance.interceptors.response.use(function (response) { let httpData = response.data return httpData }, function (error) { return Promise.reject(error) }) class ApiClient extends HttpClient { // ... ... }
v0.2.0
currentSystemName
更名为currentSystem
必选type String | Object
当传入一个对象时 需要传入
name
当前系统名isStaticPage
是否为静态页
e.g. { name: 'UC', isStaticPage: true }
otherSystems
其他系统名称。type String
当需要调用其他系统接口时传入 可选 e.g.['system1', 'system2']
store
里不再存入userinfo
调用UC
模块对应接口即可
一、差异:
- 样式表引入
@bitfirer/web-bootstrap/dist/WebParentFrame.css
必须使用一套主题
@bitfirer/web-theme
,以后会内置一套。有哪些主题?import WebTheme from '@bitfirer/web-theme/dist/aiib' Vue.use(WebTheme)
路由配置
export default [ { path: '/foo', name: 'Foo', mate: { isSinglePage: true // 该字段用于配置是否为独立的单页视图,可选 }, component: () => import('path/to/foo') }, { path: '/bar', name: 'Bar', component: () => import('path/to/bar') } ]
vue
的原型上挂载了$axios
是axios
的一个实例
二、新增:
EventBus
订阅-发布事件,此对象挂载在Vue
原型上,可全局使用vm.$EventBus.emit( eventName, […args] )
- 参数
-
{string} eventName
-[...args]
- 参数
-
vm.$EventBus.emit('foo')
vm.$EventBus.on('foo', function () {
// do something...
})
注:事件名称请勿以下划线 _
开头,避免与内置事件冲突
三、内置事件
_languageSwitched
国际化语言切换