diff --git a/.eslintrc.js b/.eslintrc.js index 233c5d0bc..d1e29b8e0 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -34,7 +34,10 @@ module.exports = { BK_API_URL_TMPL: false, BKPAAS_ENVIRONMENT: false, BK_ITSM_URL: false, - BK_APP_APIGW_PREFIX: false + BK_APP_APIGW_PREFIX: false, + BKPAAS_ENGINE_REGION: false, + BK_IAM_HOST: false, + IAM_ENABLE: false }, // add your custom rules hered rules: { diff --git a/lib/client/build/webpack.dev.conf.js b/lib/client/build/webpack.dev.conf.js index 9010a851b..716368520 100644 --- a/lib/client/build/webpack.dev.conf.js +++ b/lib/client/build/webpack.dev.conf.js @@ -18,6 +18,7 @@ const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') const postcssPlugins = require('./postcss-plugins') const clientConf = require('./conf') const httpConf = require('../../server/conf/http') +const iamConf = require('../../server/conf/iam') const { pathToNodeModules } = require('./util') const baseConf = require('./webpack.base.conf') const manifest = require('../static/lib-manifest.json') @@ -150,7 +151,10 @@ const webpackConfig = merge(baseConf, { staticUrl: clientConf.dev.staticUrl, BKPAAS_ENVIRONMENT: clientConf.dev.BKPAAS_ENVIRONMENT, BK_ITSM_URL: httpConf.itsmUrl, - BK_APP_APIGW_PREFIX: (httpConf.apiGateWayUrlTmpl && (httpConf.apiGateWayUrlTmpl.replace('{api_name}', 'bk-lesscode') + '/' + clientConf.build.LESSCODE_ENVIRONMENT)) || '' + BK_APP_APIGW_PREFIX: (httpConf.apiGateWayUrlTmpl && (httpConf.apiGateWayUrlTmpl.replace('{api_name}', 'bk-lesscode') + '/' + clientConf.build.LESSCODE_ENVIRONMENT)) || '', + BKPAAS_ENGINE_REGION: httpConf.authName === 'bk_token' ? 'default' : 'ieod', + BK_IAM_HOST: iamConf.IAM_SAAS_HOST, + IAM_ENABLE: false }), new HtmlWebpackPlugin({ @@ -160,7 +164,10 @@ const webpackConfig = merge(baseConf, { staticUrl: clientConf.dev.staticUrl, BKPAAS_ENVIRONMENT: clientConf.dev.BKPAAS_ENVIRONMENT, BK_ITSM_URL: httpConf.itsmUrl, - BK_APP_APIGW_PREFIX: (httpConf.apiGateWayUrlTmpl && (httpConf.apiGateWayUrlTmpl.replace('{api_name}', 'bk-lesscode') + '/' + clientConf.build.LESSCODE_ENVIRONMENT)) || '' + BK_APP_APIGW_PREFIX: (httpConf.apiGateWayUrlTmpl && (httpConf.apiGateWayUrlTmpl.replace('{api_name}', 'bk-lesscode') + '/' + clientConf.build.LESSCODE_ENVIRONMENT)) || '', + BKPAAS_ENGINE_REGION: httpConf.authName === 'bk_token' ? 'default' : 'ieod', + BK_IAM_HOST: iamConf.IAM_SAAS_HOST, + IAM_ENABLE: false }), new FriendlyErrorsPlugin() diff --git a/lib/client/build/webpack.prod.conf.js b/lib/client/build/webpack.prod.conf.js index a72514030..f7b9bc668 100644 --- a/lib/client/build/webpack.prod.conf.js +++ b/lib/client/build/webpack.prod.conf.js @@ -22,6 +22,7 @@ const postcssPlugins = require('./postcss-plugins') const ReplaceStaticUrlPlugin = require('./replace-static-url-plugin') const clientConf = require('./conf') const httpConf = require('../../server/conf/http') +const iamConf = require('../../server/conf/iam') const { pathToNodeModules } = require('./util') const baseConf = require('./webpack.base.conf') const manifest = require('../static/lib-manifest.json') @@ -244,7 +245,10 @@ module.exports = merge(baseConf, { staticUrl: clientConf.build.staticUrl, BKPAAS_ENVIRONMENT: clientConf.build.BKPAAS_ENVIRONMENT, BK_ITSM_URL: httpConf.itsmUrl, - BK_APP_APIGW_PREFIX: (httpConf.apiGateWayUrlTmpl && (httpConf.apiGateWayUrlTmpl.replace('{api_name}', 'bk-lesscode') + '/' + clientConf.build.LESSCODE_ENVIRONMENT)) || '' + BK_APP_APIGW_PREFIX: (httpConf.apiGateWayUrlTmpl && (httpConf.apiGateWayUrlTmpl.replace('{api_name}', 'bk-lesscode') + '/' + clientConf.build.LESSCODE_ENVIRONMENT)) || '', + BKPAAS_ENGINE_REGION: httpConf.authName === 'bk_token' ? 'default' : 'ieod', + BK_IAM_HOST: iamConf.IAM_SAAS_HOST, + IAM_ENABLE: true }), new HtmlWebpackPlugin({ @@ -265,7 +269,9 @@ module.exports = merge(baseConf, { staticUrl: clientConf.build.staticUrl, BKPAAS_ENVIRONMENT: clientConf.build.BKPAAS_ENVIRONMENT, BK_ITSM_URL: httpConf.itsmUrl, - BK_APP_APIGW_PREFIX: (httpConf.apiGateWayUrlTmpl && (httpConf.apiGateWayUrlTmpl.replace('{api_name}', 'bk-lesscode') + '/' + clientConf.build.LESSCODE_ENVIRONMENT)) || '' + BK_APP_APIGW_PREFIX: (httpConf.apiGateWayUrlTmpl && (httpConf.apiGateWayUrlTmpl.replace('{api_name}', 'bk-lesscode') + '/' + clientConf.build.LESSCODE_ENVIRONMENT)) || '', + BK_IAM_HOST: iamConf.IAM_SAAS_HOST, + IAM_ENABLE: true }), new MiniCssExtractPlugin({ diff --git a/lib/client/index-dev.html b/lib/client/index-dev.html index 4721113f1..75f093033 100644 --- a/lib/client/index-dev.html +++ b/lib/client/index-dev.html @@ -30,6 +30,9 @@ var STATIC_URL = '<%= htmlWebpackPlugin.options.staticUrl %>' var BKPAAS_ENVIRONMENT = '<%= htmlWebpackPlugin.options.BKPAAS_ENVIRONMENT %>' var BK_API_URL_TMPL = '{{ BK_API_URL_TMPL }}' + var BKPAAS_ENGINE_REGION = '<%= htmlWebpackPlugin.options.BKPAAS_ENGINE_REGION %>' + var BK_IAM_HOST = '<%= htmlWebpackPlugin.options.BK_IAM_HOST %>' + var IAM_ENABLE = <%= htmlWebpackPlugin.options.IAM_ENABLE %> <%= require('html-loader!./require-monaco.html') %> diff --git a/lib/client/index.html b/lib/client/index.html index aebe95f48..9cb9f898f 100644 --- a/lib/client/index.html +++ b/lib/client/index.html @@ -30,6 +30,9 @@ var STATIC_URL = '<%= htmlWebpackPlugin.options.staticUrl %>' var BKPAAS_ENVIRONMENT = '<%= htmlWebpackPlugin.options.BKPAAS_ENVIRONMENT %>' var BK_API_URL_TMPL = '{{ BK_API_URL_TMPL }}' + var BKPAAS_ENGINE_REGION = '<%= htmlWebpackPlugin.options.BKPAAS_ENGINE_REGION %>' + var BK_IAM_HOST = '<%= htmlWebpackPlugin.options.BK_IAM_HOST %>' + var IAM_ENABLE = <%= htmlWebpackPlugin.options.IAM_ENABLE %> <%= require('html-loader!./require-monaco.html') %> diff --git a/lib/client/preview.html b/lib/client/preview.html index 4fdb17e82..d7b9226ae 100644 --- a/lib/client/preview.html +++ b/lib/client/preview.html @@ -126,13 +126,16 @@ var BKPAAS_ENVIRONMENT = '<%= htmlWebpackPlugin.options.BKPAAS_ENVIRONMENT %>' var BK_ITSM_URL = '<%= htmlWebpackPlugin.options.BK_ITSM_URL %>' var BK_APP_APIGW_PREFIX = '<%= htmlWebpackPlugin.options.BK_APP_APIGW_PREFIX %>' + var BKPAAS_ENGINE_REGION = '<%= htmlWebpackPlugin.options.BKPAAS_ENGINE_REGION %>' + var BK_IAM_HOST = '<%= htmlWebpackPlugin.options.BK_IAM_HOST %>' + var IAM_ENABLE = <%= htmlWebpackPlugin.options.IAM_ENABLE %> const recalculate = () => { const html = window.document.documentElement const clientWidth = html.clientWidth || 375 html.style.fontSize = `${clientWidth / 20}px` } - + window.addEventListener('resize', recalculate, false) window.document.addEventListener('DOMContentLoaded', recalculate, false) diff --git a/lib/client/src/App.vue b/lib/client/src/App.vue index cae760412..e2ed24458 100644 --- a/lib/client/src/App.vue +++ b/lib/client/src/App.vue @@ -11,27 +11,43 @@ @@ -134,6 +187,54 @@ z-index: 9999; } + .nav-footer-bar.middle { + transition:transform .5s, opacity .5s; + top: auto; + bottom: 1%; + } + + .no-footer-bar.middle { + transition:transform .5s, opacity .5s; + top: auto; + bottom: -3%; + } + + .nav-icon{ + z-index: 2009; + position: fixed; + right: 10px; + width: 52px; + height: 20px; + background: #3A84FF; + box-shadow: 0 -2px 8px 0 rgba(0,0,0,0.12); + border-radius: 15px 15px 0 0; + bottom: 50px; + text-align: center; + color: #fff; + font-size: 24px; + cursor: pointer; + i { + position: absolute; + top: -1px; + left: 14px; + transition:transform 0.5s; + } + .nav-icon-down{ + transform: rotate(0deg); + } + .nav-icon-up{ + transform: rotate(180deg); + } + } + + .nav-icon-footer{ + bottom: 50px; + } + + .nav-icon-bottom{ + bottom: 0px; + } + .win { /* font-family: Microsoft Yahei, PingFang SC, Helvetica, Aria; */ font-family: -apple-system, BlinkMacSystemFont, PingFang SC, Microsoft YaHei, Helvetica Neue, Arial; diff --git a/lib/client/src/api/index.js b/lib/client/src/api/index.js index 116fdd3b4..9499f0d07 100644 --- a/lib/client/src/api/index.js +++ b/lib/client/src/api/index.js @@ -27,6 +27,16 @@ axios.interceptors.response.use( // 接口请求成功 case 0: return data + // 需要去权限中心申请权限 + case 403: + if (data.data.permissionType === 'page') { + bus.$emit('permission-page', data.data) + return data.data + } + return data + case 404: + bus.$emit('not-exist', data.message) + return data // 后端业务处理报错 default: const { code, message = '系统错误' } = response.data diff --git a/lib/client/src/bk-icon/demo.html b/lib/client/src/bk-icon/demo.html index 75a53f934..2ad463dd8 100644 --- a/lib/client/src/bk-icon/demo.html +++ b/lib/client/src/bk-icon/demo.html @@ -117,6 +117,10 @@

为什么使用

为什么使用