Commit 3b0a4c85 authored by 张宇迪's avatar 张宇迪

init

parents
clone:
git:
image: registry.cn-qingdao.aliyuncs.com/wod/devops-git-arm64:1.0
pipeline:
read-cache:
image: registry.cn-qingdao.aliyuncs.com/wod/devops-cache-arm64:1.0
restore: true
mount:
- ./node_modules
volumes:
- /cache:/cache
build:
image: registry.cn-qingdao.aliyuncs.com/wod/devops-node-arm64:12.18.2-buster
volumes:
- /data/cache/yarn:/usr/local/share/.cache/yarn/v1
commands:
- yarn install
- yarn run build
store-cache:
image: registry.cn-qingdao.aliyuncs.com/wod/devops-cache-arm64:1.0
rebuild: true
mount:
- ./node_modules
volumes:
- /cache:/cache
docker-branch:
image: registry.cn-qingdao.aliyuncs.com/wod/devops-docker-arm64:1.0
volumes:
- /var/run/docker.sock:/var/run/docker.sock
base: registry.cn-qingdao.aliyuncs.com/wod/apaas-login-base-arm64:v3.0.0-apaasv3
repo: wod/apaas-login-arm64
registry: registry.cn-qingdao.aliyuncs.com
version: "v3.0.1"
channel: branch
secrets:
- source: REGISTRY_USER_ALIYUN
target: REGISTRY_USER
- source: REGISTRY_PASSWORD_ALIYUN
target: REGISTRY_PASSWORD
when:
branch:
exclude: [master,dev]
latest:
image: registry.cn-qingdao.aliyuncs.com/wod/devops-docker-arm64:1.0
volumes:
- /var/run/docker.sock:/var/run/docker.sock
base: registry.cn-qingdao.aliyuncs.com/wod/apaas-login-base-arm64:v3.0.0-apaasv3
repo: wod/apaas-login-arm64
registry: registry.cn-qingdao.aliyuncs.com
version: "v3.0"
secrets:
- source: REGISTRY_USER_ALIYUN
target: REGISTRY_USER
- source: REGISTRY_PASSWORD_ALIYUN
target: REGISTRY_PASSWORD
\ No newline at end of file
platform: 10.11.92.33
clone:
git:
image: registry.cn-qingdao.aliyuncs.com/wod-devops/git:1.4.0
pull: true
dns: 223.5.5.5
pipeline:
read-cache:
image: registry.cn-qingdao.aliyuncs.com/wod-devops/cache:latest
restore: true
mount:
- ./node_modules
volumes:
- /cache:/cache
build:
image: registry.cn-qingdao.aliyuncs.com/wod-devops/node:8.15.0-onbuild
dns: 223.5.5.5
volumes:
- /data/cache/yarn:/usr/local/share/.cache/yarn/v1
commands:
- yarn install
- yarn run build
store-cache:
image: registry.cn-qingdao.aliyuncs.com/wod-devops/cache:latest
rebuild: true
mount:
- ./node_modules
volumes:
- /cache:/cache
docker:
image: registry.cn-qingdao.aliyuncs.com/wod-devops/docker:1.0
volumes:
- /var/run/docker.sock:/var/run/docker.sock
base: registry.cn-qingdao.aliyuncs.com/wod/apaas-login-base:v3.0.2-apaasv3
repo: wod/apaas-login
version: "v3.0.0"
channel: alpha
registry: registry.cn-qingdao.aliyuncs.com
secrets:
- source: REGISTRY_USER_ALIYUN
target: REGISTRY_USER
- source: REGISTRY_PASSWORD_ALIYUN
target: REGISTRY_PASSWORD
when:
branch: dev
docker-master:
image: registry.cn-qingdao.aliyuncs.com/wod-devops/docker:1.0
volumes:
- /var/run/docker.sock:/var/run/docker.sock
base: registry.cn-qingdao.aliyuncs.com/wod/apaas-login-base:v3.0.2-apaasv3
repo: wod/apaas-login
version: "v3.0.0"
registry: registry.cn-qingdao.aliyuncs.com
secrets:
- source: REGISTRY_USER_ALIYUN
target: REGISTRY_USER
- source: REGISTRY_PASSWORD_ALIYUN
target: REGISTRY_PASSWORD
when:
branch: master
docker-branch:
image: registry.cn-qingdao.aliyuncs.com/wod-devops/docker:1.0
volumes:
- /var/run/docker.sock:/var/run/docker.sock
base: registry.cn-qingdao.aliyuncs.com/wod/apaas-login-base:v3.0.2-apaasv3
repo: wod/apaas-login
registry: registry.cn-qingdao.aliyuncs.com
version: "v3.0.0"
channel: branch
secrets:
- source: REGISTRY_USER_ALIYUN
target: REGISTRY_USER
- source: REGISTRY_PASSWORD_ALIYUN
target: REGISTRY_PASSWORD
when:
branch:
exclude: [master,dev]
latest:
image: registry.cn-qingdao.aliyuncs.com/wod-devops/docker:1.0
volumes:
- /var/run/docker.sock:/var/run/docker.sock
base: registry.cn-qingdao.aliyuncs.com/wod/apaas-login-base:v3.0.2-apaasv3
repo: wod/apaas-login
registry: registry.cn-qingdao.aliyuncs.com
version: "v3.0"
secrets:
- source: REGISTRY_USER_ALIYUN
target: REGISTRY_USER
- source: REGISTRY_PASSWORD_ALIYUN
target: REGISTRY_PASSWORD
when:
branch:
exclude: [master,dev]
deploy:
image: registry.cn-qingdao.aliyuncs.com/wod-devops/kubernetes:1.0
namespace: apaas-v3
deployment: apaas-login
container: apaas-login
registry: registry.cn-qingdao.aliyuncs.com
\ No newline at end of file
node_modules/
\ No newline at end of file
.DS_Store
node_modules/
dist
npm-debug.log*
yarn-debug.log*
yarn-error.log*
package-lock.json
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
\ No newline at end of file
// https://github.com/michael-ciniawsky/postcss-load-config
module.exports = {
"plugins": {
"postcss-import": {},
"postcss-url": {},
// to edit target browsers: use "browserslist" field in package.json
"autoprefixer": {}
}
}
module.exports = {
presets: [
["@babel/preset-env", {
"modules": false
}]
],
plugins: ["transform-vue-jsx", "@babel/plugin-transform-runtime"]
}
FROM {{ BASEIMAGE }}
MAINTAINER {{ AUTHOR }}
LABEL Author={{ AUTHOR }} Name={{ PROJECT }} Version={{ VERSION }}
ADD ./dist /www
\ No newline at end of file
'use strict'
require('./check-versions')()
process.env.NODE_ENV = 'production'
const ora = require('ora')
const rm = require('rimraf')
const path = require('path')
const chalk = require('chalk')
const webpack = require('webpack')
const config = require('../config')
const webpackConfig = require('./webpack.prod.conf')
const spinner = ora('building for production...')
spinner.start()
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
if (err) throw err
webpack(webpackConfig, (err, stats) => {
spinner.stop()
if (err) throw err
process.stdout.write(stats.toString({
colors: true,
modules: false,
children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
chunks: false,
chunkModules: false
}) + '\n\n')
if (stats.hasErrors()) {
console.log(chalk.red(' Build failed with errors.\n'))
process.exit(1)
}
console.log(chalk.cyan(' Build complete.\n'))
console.log(chalk.yellow(
' Tip: built files are meant to be served over an HTTP server.\n' +
' Opening index.html over file:// won\'t work.\n'
))
})
})
'use strict'
const chalk = require('chalk')
const semver = require('semver')
const packageConfig = require('../package.json')
const shell = require('shelljs')
function exec(cmd) {
return require('child_process').execSync(cmd).toString().trim()
}
const versionRequirements = [
{
name: 'node',
currentVersion: semver.clean(process.version),
versionRequirement: packageConfig.engines.node
}
]
if (shell.which('yarn')) {
versionRequirements.push({
name: 'yarn',
currentVersion: exec('yarn --version'),
versionRequirement: packageConfig.engines.yarn
})
}
module.exports = function () {
const warnings = []
for (let i = 0; i < versionRequirements.length; i++) {
const mod = versionRequirements[i]
if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
warnings.push(mod.name + ': ' +
chalk.red(mod.currentVersion) + ' should be ' +
chalk.green(mod.versionRequirement)
)
}
}
if (warnings.length) {
console.log('')
console.log(chalk.yellow('To use this template, you must update following to modules:'))
console.log()
for (let i = 0; i < warnings.length; i++) {
const warning = warnings[i]
console.log(' ' + warning)
}
console.log()
process.exit(1)
}
}
index: /awecloud/ui/
login: /awecloud/dex/login
logout: /awecloud/dex/logout
\ No newline at end of file
FROM {{ BASEIMAGE }}
MAINTAINER {{ AUTHOR }}
LABEL Author={{ AUTHOR }} Name={{ PROJECT }} Version={{ VERSION }}
ADD ./dist /www
\ No newline at end of file
'use strict'
const path = require('path')
const config = require('../config')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const packageConfig = require('../package.json')
exports.assetsPath = function (_path) {
const assetsSubDirectory = process.env.NODE_ENV === 'production'
? config.build.assetsSubDirectory
: config.dev.assetsSubDirectory
return path.posix.join(assetsSubDirectory, _path)
}
exports.cssLoaders = function (options) {
options = options || {}
const cssLoader = {
loader: 'css-loader',
options: {
sourceMap: options.sourceMap
}
}
const postcssLoader = {
loader: 'postcss-loader',
options: {
sourceMap: options.sourceMap
}
}
// generate loader string to be used with extract text plugin
function generateLoaders (loader, loaderOptions) {
const loaders = []
// Extract CSS when that option is specified
// (which is the case during production build)
if (options.extract) {
loaders.push(MiniCssExtractPlugin.loader)
}
else {
loaders.push('vue-style-loader')
}
loaders.push(cssLoader)
if (options.usePostCSS) {
loaders.push(postcssLoader)
}
if (loader) {
loaders.push({
loader: loader + '-loader',
options: Object.assign({}, loaderOptions, {
sourceMap: options.sourceMap
})
})
}
return loaders
}
// https://vue-loader.vuejs.org/en/configurations/extract-css.html
return {
css: generateLoaders(),
postcss: generateLoaders(),
less: generateLoaders('less'),
sass: generateLoaders('sass', { indentedSyntax: true }),
scss: generateLoaders('sass'),
stylus: generateLoaders('stylus'),
styl: generateLoaders('stylus')
}
}
// Generate loaders for standalone style files (outside of .vue)
exports.styleLoaders = function (options) {
const output = []
const loaders = exports.cssLoaders(options)
for (const extension in loaders) {
const loader = loaders[extension]
output.push({
test: new RegExp('\\.' + extension + '$'),
use: loader
})
}
return output
}
exports.createNotifierCallback = () => {
const notifier = require('node-notifier')
return (severity, errors) => {
if (severity !== 'error') return
const error = errors[0]
const filename = error.file && error.file.split('!').pop()
notifier.notify({
title: packageConfig.name,
message: severity + ': ' + error.name,
subtitle: filename || '',
icon: path.join(__dirname, 'logo.png')
})
}
}
'use strict'
const config = require('../config')
module.exports = {
cacheBusting: config.dev.cacheBusting,
transformAssetUrls: {
video: ['src', 'poster'],
source: 'src',
img: 'src',
image: 'xlink:href'
}
}
'use strict'
const path = require('path')
const utils = require('./utils')
const config = require('../config')
const vueLoaderConfig = require('./vue-loader.conf')
const { VueLoaderPlugin } = require('vue-loader')
function resolve (dir) {
return path.join(__dirname, '..', dir)
}
module.exports = {
context: path.resolve(__dirname, '../'),
entry: {
app: './src/main.js'
},
output: {
path: config.build.assetsRoot,
filename: '[name].js',
publicPath: process.env.NODE_ENV === 'production'
? config.build.assetsPublicPath
: config.dev.assetsPublicPath
},
plugins: [
new VueLoaderPlugin(),
],
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'vue$': 'vue/dist/vue.esm.js',
'@': resolve('src'),
}
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
options: vueLoaderConfig
},
{
test: /\.js$/,
loader: 'babel-loader',
include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')]
},
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('img/[name].[hash:7].[ext]')
}
},
{
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('media/[name].[hash:7].[ext]')
}
},
{
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
}
}
]
},
node: {
// prevent webpack from injecting useless setImmediate polyfill because Vue
// source contains it (although only uses it if it's native).
setImmediate: false,
// prevent webpack from injecting mocks to Node native modules
// that does not make sense for the client
dgram: 'empty',
fs: 'empty',
net: 'empty',
tls: 'empty',
child_process: 'empty'
}
}
'use strict'
const utils = require('./utils')
const webpack = require('webpack')
const config = require('../config')
const merge = require('webpack-merge')
const path = require('path')
const baseWebpackConfig = require('./webpack.base.conf')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
const portfinder = require('portfinder')
const HOST = process.env.HOST
const PORT = process.env.PORT && Number(process.env.PORT)
const devWebpackConfig = merge(baseWebpackConfig, {
mode: 'development',
module: {
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
},
// cheap-module-eval-source-map is faster for development
devtool: config.dev.devtool,
// these devServer options should be customized in /config/index.js
devServer: {
clientLogLevel: 'warning',
historyApiFallback: {
rewrites: [
{ from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') },
],
},
hot: true,
contentBase: false, // since we use CopyWebpackPlugin.
compress: true,
host: HOST || config.dev.host,
port: PORT || config.dev.port,
open: config.dev.autoOpenBrowser,
overlay: config.dev.errorOverlay
? { warnings: false, errors: true }
: false,
publicPath: config.dev.assetsPublicPath,
proxy: config.dev.proxyTable,
quiet: true, // necessary for FriendlyErrorsPlugin
watchOptions: {
poll: config.dev.poll,
}
},
plugins: [
new webpack.DefinePlugin({
'process.env': require('../config/dev.env')
}),
new webpack.HotModuleReplacementPlugin(),
new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update.
new webpack.NoEmitOnErrorsPlugin(),
// https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'index.html',
inject: true,
favicon: './static/favicon.ico'
}),
// copy custom static assets
new CopyWebpackPlugin([
{
from: path.resolve(__dirname, '../static'),
to: config.dev.assetsSubDirectory,
ignore: ['.*']
}
])
],
optimization: {
noEmitOnErrors: true,
},
})
module.exports = new Promise((resolve, reject) => {
portfinder.basePort = process.env.PORT || config.dev.port
portfinder.getPort((err, port) => {
if (err) {
reject(err)
} else {
// publish the new Port, necessary for e2e tests
process.env.PORT = port
// add port to devServer config
devWebpackConfig.devServer.port = port
// Add FriendlyErrorsPlugin
devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({
compilationSuccessInfo: {
messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`],
},
onErrors: config.dev.notifyOnErrors
? utils.createNotifierCallback()
: undefined
}))
resolve(devWebpackConfig)
}
})
})
'use strict'
const path = require('path')
const utils = require('./utils')
const webpack = require('webpack')
const config = require('../config')
const merge = require('webpack-merge')
const baseWebpackConfig = require('./webpack.base.conf')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
const TerserPlugin = require('terser-webpack-plugin');
const env = require('../config/prod.env')
const webpackConfig = merge(baseWebpackConfig, {
mode: 'production',
module: {
rules: utils.styleLoaders({
sourceMap: config.build.productionSourceMap,
extract: true,
usePostCSS: true
})
},
devtool: config.build.productionSourceMap ? config.build.devtool : false,
output: {
path: config.build.assetsRoot,
filename: utils.assetsPath('js/[name].[chunkhash].js'),
},
plugins: [
// http://vuejs.github.io/vue-loader/en/workflow/production.html
new webpack.DefinePlugin({
'process.env': env
}),
// extract css into its own file
new MiniCssExtractPlugin({
filename: utils.assetsPath('css/[name].[chunkhash].css'),
}),
// Compress extracted CSS. We are using this plugin so that possible
// duplicated CSS from different components can be deduped.
new OptimizeCSSPlugin({
cssProcessorOptions: config.build.productionSourceMap
? { safe: true, map: { inline: false } }
: { safe: true }
}),
// generate dist index.html with correct asset hash for caching.
// you can customize output by editing /index.html
// see https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: config.build.index,
template: 'index.html',
inject: true,
minify: {
removeComments: true,
collapseWhitespace: true,
removeAttributeQuotes: true
// more options:
// https://github.com/kangax/html-minifier#options-quick-reference
},
// necessary to consistently work with multiple chunks
chunksSortMode: 'dependency'
}),
// keep module.id stable when vendor modules does not change
new webpack.NamedChunksPlugin(),
new webpack.HashedModuleIdsPlugin(),
// copy custom static assets
new CopyWebpackPlugin([
{
from: path.resolve(__dirname, '../static'),
to: config.build.assetsSubDirectory,
ignore: ['.*']
}
])
],
optimization: {
splitChunks: {
chunks: 'all',
cacheGroups: {
vendor: {
name: 'vendor',
test: /[\\/]node_modules[\\/]/,
enforce: true,
},
},
},
runtimeChunk: 'single',
minimizer: [
new TerserPlugin({
terserOptions: {
ecma: 6,
compress: true,
output: {
comments: false,
beautify: false
}
}
}),
],
},
})
if (config.build.productionGzip) {
const CompressionWebpackPlugin = require('compression-webpack-plugin')
webpackConfig.plugins.push(
new CompressionWebpackPlugin({
asset: '[path].gz[query]',
algorithm: 'gzip',
test: new RegExp(
'\\.(' +
config.build.productionGzipExtensions.join('|') +
')$'
),
threshold: 10240,
minRatio: 0.8
})
)
}
if (config.build.bundleAnalyzerReport) {
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
webpackConfig.plugins.push(new BundleAnalyzerPlugin())
}
module.exports = webpackConfig
'use strict'
const merge = require('webpack-merge')
const prodEnv = require('./prod.env')
module.exports = merge(prodEnv, {
NODE_ENV: '"development"'
})
'use strict'
// Template version: 1.3.1
// see http://vuejs-templates.github.io/webpack for documentation.
const path = require('path')
module.exports = {
dev: {
// Paths
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {},
// Various Dev Server settings
host: 'localhost', // can be overwritten by process.env.HOST
port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: false,
errorOverlay: true,
notifyOnErrors: true,
poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
// Use Eslint Loader?
// If true, your code will be linted during bundling and
// linting errors and warnings will be shown in the console.
useEslint: true,
// If true, eslint errors and warnings will also be shown in the error overlay
// in the browser.
showEslintErrorsInOverlay: false,
/**
* Source Maps
*/
// https://webpack.js.org/configuration/devtool/#development
devtool: 'cheap-module-eval-source-map',
// If you have problems debugging vue-files in devtools,
// set this to false - it *may* help
// https://vue-loader.vuejs.org/en/options.html#cachebusting
cacheBusting: true,
cssSourceMap: true
},
build: {
// Template for index.html
index: path.resolve(__dirname, '../dist', 'iam','login', 'index.html'),
// Paths
assetsRoot: path.resolve(__dirname, '../dist', 'iam','login'),
assetsSubDirectory: 'static',
assetsPublicPath: '/iam/login/',
/**
* Source Maps
*/
productionSourceMap: true,
// https://webpack.js.org/configuration/devtool/#production
devtool: '#source-map',
// Gzip off by default as many popular static hosts such as
// Surge or Netlify already gzip all static assets for you.
// Before setting to `true`, make sure to:
// npm install --save-dev compression-webpack-plugin
productionGzip: false,
productionGzipExtensions: ['js', 'css'],
// Run the build command with an extra argument to
// View the bundle analyzer report after build finishes:
// `npm run build --report`
// Set to `true` or `false` to always turn it on or off
bundleAnalyzerReport: process.env.npm_config_report
}
}
'use strict'
module.exports = {
NODE_ENV: '"production"'
}
<?xml version="1.0" encoding="utf-8"?>
<AutoResponder LastSave="2018-04-21T17:18:19.4349974+08:00" FiddlerVersion="5.0.20173.50948">
<State Enabled="true" Fallthrough="true" UseLatency="false">
<ResponseRule Match="EXACT:http://localhost:8080/rest/harbor/api/projects" Action="C:\Git\cloud\awecloud-ui\docs\harbor_api_projects.json" Enabled="true" />
<ResponseRule Match="EXACT:http://localhost:8080/rest/harbor/api/projects/3" Action="C:\Git\cloud\awecloud-ui\docs\harbor_api_projects_3.json" Enabled="true" />
<ResponseRule Match="regex:http://localhost:8080/rest/harbor/api/repositories/(.*?)/tags" Action="C:\Git\cloud\awecloud-ui\docs\harbor_api_repositories_cig_rest_tags.json" Enabled="true" />
<ResponseRule Match="regex:http://localhost:8080/rest/harbor/api/repositories(.*?)" Action="C:\Git\cloud\awecloud-ui\docs\harbor_api_repositories.json" Enabled="true" />
<ResponseRule Match="regex:http://localhost:8080/rest/kubernetes/api/v1/node(.*?)" Action="C:\Git\cloud\awecloud-ui\docs\k8s_api_v1_node.json" Enabled="true" />
<ResponseRule Match="EXACT:http://localhost:8080/rest/kubernetes/api/v1/node" Action="C:\Git\cloud\awecloud-ui\docs\k8s_api_v1_node.json" Enabled="true" />
<ResponseRule Match="EXACT:http://localhost:8080/rest/kubernetes/api/v1/node/172.16.11.241" Action="C:\Git\cloud\awecloud-ui\docs\k8s_api_v1_node_192.168.74.101.json" Enabled="true" />
<ResponseRule Match="EXACT:http://localhost:8080/api/v4/user" Action="C:\Git\cloud\awecloud-ui\docs\gitlab_api_v4_user.json" Enabled="true" />
</State>
</AutoResponder>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<AutoResponder LastSave="2018-04-20T23:41:40.6792103+08:00" FiddlerVersion="5.0.20173.49666">
<State Enabled="true" Fallthrough="true" UseLatency="false">
<ResponseRule Match="regex:https://gitlab.ispacesys.cn/awecloud/ui(.*?)" Action="http://localhost:8080$1" Enabled="true" />
<ResponseRule Match="regex:https://gitlab.ispacesys.cn/static(.*?)" Action="http://localhost:8080/static$1" Enabled="true" />
<ResponseRule Match="EXACT:https://gitlab.ispacesys.cn/app.js" Action="http://localhost:8080/app.js" Enabled="true" />
</State>
</AutoResponder>
\ No newline at end of file
{
"objectMeta": {
"name": "zhzltest-1525854120-pcsfx",
"namespace": "test-zhzl",
"labels": {
"controller-uid": "0f53c523-5362-11e8-88ba-000c29516a6e",
"job-name": "zhzltest-1525854120"
},
"creationTimestamp": "2018-05-09T08:22:06Z"
},
"typeMeta": {
"kind": "pod"
},
"podPhase": "Succeeded",
"podIP": "10.2.1.239",
"nodeName": "192.168.74.102",
"restartCount": 0,
"qosClass": "BestEffort",
"controller": {
"objectMeta": {
"name": "zhzltest-1525854120",
"namespace": "test-zhzl",
"labels": {
"controller-uid": "0f53c523-5362-11e8-88ba-000c29516a6e",
"job-name": "zhzltest-1525854120"
},
"creationTimestamp": "2018-05-09T08:22:06Z"
},
"typeMeta": {
"kind": "job"
},
"pods": {
"current": 0,
"desired": 1,
"running": 0,
"pending": 0,
"failed": 0,
"succeeded": 1,
"warnings": []
},
"containerImages": [
"registry.ispacesys.cn/cig/zhzlconsole:0.0.2-test"
],
"initContainerImages": null
},
"containers": [
{
"name": "zhzlconsole",
"image": "registry.ispacesys.cn/cig/zhzlconsole:0.0.2-test",
"env": [
{
"name": "STORAGE_URL",
"value": "192.168.74.102",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "STORAGE_URL"
}
}
},
{
"name": "ELASTIC_PORT",
"value": "9200",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "ELASTIC_PORT"
}
}
},
{
"name": "NODE_ORACLEDB_EP_PASSWORD",
"value": "EFLOW1234",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "NODE_ORACLEDB_EP_PASSWORD"
}
}
},
{
"name": "NODE_ORACLEDB_USER",
"value": "cigproxy",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "NODE_ORACLEDB_USER"
}
}
},
{
"name": "SDJ_EVENTURL",
"value": "http://cxcig.ddns.net:10014/gateway/api/001003001029/GrassrootsGovernance/bR4rD5d1O04KUdV0.htm",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "SDJ_EVENTURL"
}
}
},
{
"name": "SDJ_SECRETURL_BYKEY",
"value": "http://cxcig.ddns.net:10014/gateway/app/refreshTokenByKey.htm",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "SDJ_SECRETURL_BYKEY"
}
}
},
{
"name": "SYS_SERVICE_ROOT",
"value": "http://test-zhzl.spacecig.com/",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "SYS_SERVICE_ROOT"
}
}
},
{
"name": "WX_PROTOCOL",
"value": "http://",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "WX_PROTOCOL"
}
}
},
{
"name": "APPKEYSECRET",
"value": "bF97LaEoiVPuGn8HMUy4",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "APPKEYSECRET"
}
}
},
{
"name": "NODE_REDIS_CONNECTION",
"value": "redis://deps:6379",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "NODE_REDIS_CONNECTION"
}
}
},
{
"name": "ELASTIC_HOST",
"value": "elasticsearch.efk",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "ELASTIC_HOST"
}
}
},
{
"name": "HOST_OUTER",
"value": "123.157.108.231",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "HOST_OUTER"
}
}
},
{
"name": "MAP_BAIDU_SERVICEID",
"value": "149274",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "MAP_BAIDU_SERVICEID"
}
}
},
{
"name": "NODE_MSMQ_REDIS_CONNECTION",
"value": "redis://deps-msmqredis:6379",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "NODE_MSMQ_REDIS_CONNECTION"
}
}
},
{
"name": "NODE_ORACLEDB_PASSWORD",
"value": "cigproxy",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "NODE_ORACLEDB_PASSWORD"
}
}
},
{
"name": "TOKEN_SERVICE",
"value": "http://iam:3011/admin",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "TOKEN_SERVICE"
}
}
},
{
"name": "WFSERVICE_PORT",
"value": "890",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "WFSERVICE_PORT"
}
}
},
{
"name": "DH_HOST",
"value": "10.21.197.45",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "DH_HOST"
}
}
},
{
"name": "JPUSH_IOS_ENV",
"value": "PRODUCTION",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "JPUSH_IOS_ENV"
}
}
},
{
"name": "MSG_NONCE",
"value": "58772015",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "MSG_NONCE"
}
}
},
{
"name": "NODE_MSMQ_REDIS_REST_TICK",
"value": "[1, 6, 11, 16, 21, 26, 31, 36, 41, 46, 51, 56]",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "NODE_MSMQ_REDIS_REST_TICK"
}
}
},
{
"name": "TXYZB_ACCOUNT_TYPE",
"value": "18538",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "TXYZB_ACCOUNT_TYPE"
}
}
},
{
"name": "APPKEY_OUTER",
"value": "28624821",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "APPKEY_OUTER"
}
}
},
{
"name": "CIG_TASK_JOB",
"value": "0",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "CIG_TASK_JOB"
}
}
},
{
"name": "MAP_BAIDU_APPKEY",
"value": "f1PKq1WeBmB893LfnGxQ7gEuDV6uSeRb",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "MAP_BAIDU_APPKEY"
}
}
},
{
"name": "PORT_OUTER",
"value": "9999",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "PORT_OUTER"
}
}
},
{
"name": "TXYZB_SDK_APPID",
"value": "1400047153",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "TXYZB_SDK_APPID"
}
}
},
{
"name": "YH_API_URL",
"value": "http://192.168.74.102:29980/yhapi",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "YH_API_URL"
}
}
},
{
"name": "APP_FILE_SERVICE",
"value": "https://test-zhzl.spacecig.com",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "APP_FILE_SERVICE"
}
}
},
{
"name": "MSG_APPSECRET",
"value": "92fac7d3a7dc",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "MSG_APPSECRET"
}
}
},
{
"name": "HEZHANG_DEAL_PATH",
"value": "/hzzpublic/event/outTimeEvent/doOverEvent",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "HEZHANG_DEAL_PATH"
}
}
},
{
"name": "HEZHANG_HOST",
"value": "https://hzz.spacecig.com",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "HEZHANG_HOST"
}
}
},
{
"name": "NODE_ORACLEDB_CONNECTIONSTRING",
"value": "oracle:11421/xe",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "NODE_ORACLEDB_CONNECTIONSTRING"
}
}
},
{
"name": "NODE_ORACLEDB_EP_USER",
"value": "EFLOW",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "NODE_ORACLEDB_EP_USER"
}
}
},
{
"name": "NODE_ORACLEGEODB_PASSWORD",
"value": "cigsde",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "NODE_ORACLEGEODB_PASSWORD"
}
}
},
{
"name": "REST_APIURLBASE_WF",
"value": "http://test-zhzl.spacecig.com/",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "REST_APIURLBASE_WF"
}
}
},
{
"name": "APPSECRET_INNER",
"value": "Q9GM11oUW74AkOcc0Gq9",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "APPSECRET_INNER"
}
}
},
{
"name": "SDJ_APPSECRET",
"value": "a1be950e557946af91a0bb425bd3b2ac",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "SDJ_APPSECRET"
}
}
},
{
"name": "WX_HOST",
"value": "test-zhzl.spacecig.com",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "WX_HOST"
}
}
},
{
"name": "MSG_CODELEN",
"value": "6",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "MSG_CODELEN"
}
}
},
{
"name": "REST_APIURLBASE_WF_NEW",
"value": "http://test-zhzl.spacecig.com/wf/",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "REST_APIURLBASE_WF_NEW"
}
}
},
{
"name": "SCHEDULE",
"value": "1",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "SCHEDULE"
}
}
},
{
"name": "UV_THREADPOOL_SIZE",
"value": "20",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "UV_THREADPOOL_SIZE"
}
}
},
{
"name": "YICHUANG_HOST",
"value": "http://xzfw.zjcx.gov.cn",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "YICHUANG_HOST"
}
}
},
{
"name": "NODE_ORACLEGEODB_USER",
"value": "cigsde",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "NODE_ORACLEGEODB_USER"
}
}
},
{
"name": "MEMCACHED_PATH",
"value": "deps:11211",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "MEMCACHED_PATH"
}
}
},
{
"name": "SDJ_SECRETURL_BYSEC",
"value": "http://cxcig.ddns.net:10014/gateway/app/refreshTokenBySec.htm",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "SDJ_SECRETURL_BYSEC"
}
}
},
{
"name": "CACHE_CONFIG_URL",
"value": "deps:11211",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "CACHE_CONFIG_URL"
}
}
},
{
"name": "DH_HOST_OUT",
"value": "client.zjcx1.cn",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "DH_HOST_OUT"
}
}
},
{
"name": "GEO_SERVER_HOST",
"value": "test-zhzl.spacecig.com",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "GEO_SERVER_HOST"
}
}
},
{
"name": "GEO_SERVER_PORT",
"value": "80",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "GEO_SERVER_PORT"
}
}
},
{
"name": "MSG_SERVERURL",
"value": "https://api.netease.im/sms/sendcode.action",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "MSG_SERVERURL"
}
}
},
{
"name": "MSG_TEMPLATEID",
"value": "4022280",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "MSG_TEMPLATEID"
}
}
},
{
"name": "WFSERVICE_HOST",
"value": "192.168.74.116",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "WFSERVICE_HOST"
}
}
},
{
"name": "APPKEY_INNER",
"value": "26208115",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "APPKEY_INNER"
}
}
},
{
"name": "JPUSH_SECRET",
"value": "350010b7ff0c0f8c7700ab91",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "JPUSH_SECRET"
}
}
},
{
"name": "MSG_APPKEY",
"value": "7cd4776db7cebf12a733b78fdba7bba1",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "MSG_APPKEY"
}
}
},
{
"name": "SDJ_ISSEND",
"value": "0",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "SDJ_ISSEND"
}
}
},
{
"name": "STORAGE_PORT",
"value": "50070",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "STORAGE_PORT"
}
}
},
{
"name": "ZHZLBACKEND_DOMAIN",
"value": "http://zhzlbackend:3003",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "ZHZLBACKEND_DOMAIN"
}
}
},
{
"name": "DH_HOST_PORT",
"value": "8080",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "DH_HOST_PORT"
}
}
},
{
"name": "JPUSH_KEY",
"value": "a2b9b0542275313950882390",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "JPUSH_KEY"
}
}
},
{
"name": "TXYZB_KEY_PATH",
"value": "common/config/txYunKey/test",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "TXYZB_KEY_PATH"
}
}
},
{
"name": "CIGWBJ_NODE_ORACLEDB_USER",
"value": "cigwbj",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "CIGWBJ_NODE_ORACLEDB_USER"
}
}
},
{
"name": "CIGWBJ_NODE_ORACLEDB_PASSWORD",
"value": "esri@123",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "CIGWBJ_NODE_ORACLEDB_PASSWORD"
}
}
},
{
"name": "DH_PORT_OUT",
"value": "8081",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "DH_PORT_OUT"
}
}
},
{
"name": "HEZHANG_OVERTIME_PATH",
"value": "/hzzpublic/event/outTimeEvent/addOverEvent",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "HEZHANG_OVERTIME_PATH"
}
}
},
{
"name": "HOST_INNER",
"value": "10.21.197.78",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "HOST_INNER"
}
}
},
{
"name": "KUBERNETES_HOST",
"value": "https://k8s.ispacesys.cn:6443",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "KUBERNETES_HOST"
}
}
},
{
"name": "NODE_ORACLEGEODB_CONNECTIONSTRING",
"value": "192.168.74.109:1521/orcl",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "NODE_ORACLEGEODB_CONNECTIONSTRING"
}
}
},
{
"name": "PORT_INNER",
"value": "9999",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "PORT_INNER"
}
}
},
{
"name": "CIGWBJ_NODE_ORACLEDB_CONNECTIONSTRING",
"value": "10.21.198.126:15214/xe",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "CIGWBJ_NODE_ORACLEDB_CONNECTIONSTRING"
}
}
},
{
"name": "PROXY_IIS_CIGSYSTEM",
"value": "http://192.168.74.109",
"valueFrom": {
"configMapKeyRef": {
"name": "cig",
"key": "PROXY_IIS_CIGSYSTEM"
}
}
}
],
"commands": [
"pm2"
],
"args": [
"start",
"./pm2/prod-zhzlconsole.config.js",
"--env",
"production",
"--no-daemon",
"--",
"-r",
"test/index",
"-a",
"\"{'b':1}\""
]
}
],
"initContainers": [],
"metrics": [
{
"dataPoints": [],
"metricPoints": [],
"metricName": "cpu/usage_rate",
"aggregation": "sum"
},
{
"dataPoints": [],
"metricPoints": [],
"metricName": "memory/usage",
"aggregation": "sum"
}
],
"conditions": [
{
"type": "Initialized",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2018-05-09T08:22:06Z",
"reason": "PodCompleted",
"message": ""
},
{
"type": "Ready",
"status": "False",
"lastProbeTime": null,
"lastTransitionTime": "2018-05-09T08:22:21Z",
"reason": "PodCompleted",
"message": ""
},
{
"type": "PodScheduled",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2018-05-09T08:22:06Z",
"reason": "",
"message": ""
}
],
"eventList": {
"listMeta": {
"totalItems": 9
},
"events": [
{
"objectMeta": {
"name": "zhzltest-1525854120-pcsfx.152cec3e605825a8",
"namespace": "test-zhzl",
"creationTimestamp": "2018-05-09T08:22:06Z"
},
"typeMeta": {
"kind": "event"
},
"message": "Successfully assigned zhzltest-1525854120-pcsfx to 192.168.74.102",
"sourceComponent": "default-scheduler",
"sourceHost": "",
"object": "",
"count": 1,
"firstSeen": "2018-05-09T08:22:06Z",
"lastSeen": "2018-05-09T08:22:06Z",
"reason": "Scheduled",
"type": "Normal"
},
{
"objectMeta": {
"name": "zhzltest-1525854120-pcsfx.152cec3e71be3c05",
"namespace": "test-zhzl",
"creationTimestamp": "2018-05-09T08:22:06Z"
},
"typeMeta": {
"kind": "event"
},
"message": "MountVolume.SetUp succeeded for volume \"uploaddir\" ",
"sourceComponent": "kubelet",
"sourceHost": "192.168.74.102",
"object": "",
"count": 1,
"firstSeen": "2018-05-09T08:22:06Z",
"lastSeen": "2018-05-09T08:22:06Z",
"reason": "SuccessfulMountVolume",
"type": "Normal"
},
{
"objectMeta": {
"name": "zhzltest-1525854120-pcsfx.152cec3e71cb9080",
"namespace": "test-zhzl",
"creationTimestamp": "2018-05-09T08:22:06Z"
},
"typeMeta": {
"kind": "event"
},
"message": "MountVolume.SetUp succeeded for volume \"logdir\" ",
"sourceComponent": "kubelet",
"sourceHost": "192.168.74.102",
"object": "",
"count": 1,
"firstSeen": "2018-05-09T08:22:06Z",
"lastSeen": "2018-05-09T08:22:06Z",
"reason": "SuccessfulMountVolume",
"type": "Normal"
},
{
"objectMeta": {
"name": "zhzltest-1525854120-pcsfx.152cec3e71cd1649",
"namespace": "test-zhzl",
"creationTimestamp": "2018-05-09T08:22:06Z"
},
"typeMeta": {
"kind": "event"
},
"message": "MountVolume.SetUp succeeded for volume \"localtime\" ",
"sourceComponent": "kubelet",
"sourceHost": "192.168.74.102",
"object": "",
"count": 1,
"firstSeen": "2018-05-09T08:22:06Z",
"lastSeen": "2018-05-09T08:22:06Z",
"reason": "SuccessfulMountVolume",
"type": "Normal"
},
{
"objectMeta": {
"name": "zhzltest-1525854120-pcsfx.152cec3e729c7be8",
"namespace": "test-zhzl",
"creationTimestamp": "2018-05-09T08:22:06Z"
},
"typeMeta": {
"kind": "event"
},
"message": "MountVolume.SetUp succeeded for volume \"default-token-mr56l\" ",
"sourceComponent": "kubelet",
"sourceHost": "192.168.74.102",
"object": "",
"count": 1,
"firstSeen": "2018-05-09T08:22:06Z",
"lastSeen": "2018-05-09T08:22:06Z",
"reason": "SuccessfulMountVolume",
"type": "Normal"
},
{
"objectMeta": {
"name": "zhzltest-1525854120-pcsfx.152cec3ecba4ed74",
"namespace": "test-zhzl",
"creationTimestamp": "2018-05-09T08:22:08Z"
},
"typeMeta": {
"kind": "event"
},
"message": "pulling image \"registry.ispacesys.cn/cig/zhzlconsole:0.0.2-test\"",
"sourceComponent": "kubelet",
"sourceHost": "192.168.74.102",
"object": "spec.containers{zhzlconsole}",
"count": 1,
"firstSeen": "2018-05-09T08:22:08Z",
"lastSeen": "2018-05-09T08:22:08Z",
"reason": "Pulling",
"type": "Normal"
},
{
"objectMeta": {
"name": "zhzltest-1525854120-pcsfx.152cec3ee78808a3",
"namespace": "test-zhzl",
"creationTimestamp": "2018-05-09T08:22:08Z"
},
"typeMeta": {
"kind": "event"
},
"message": "Successfully pulled image \"registry.ispacesys.cn/cig/zhzlconsole:0.0.2-test\"",
"sourceComponent": "kubelet",
"sourceHost": "192.168.74.102",
"object": "spec.containers{zhzlconsole}",
"count": 1,
"firstSeen": "2018-05-09T08:22:08Z",
"lastSeen": "2018-05-09T08:22:08Z",
"reason": "Pulled",
"type": "Normal"
},
{
"objectMeta": {
"name": "zhzltest-1525854120-pcsfx.152cec3efafce4dc",
"namespace": "test-zhzl",
"creationTimestamp": "2018-05-09T08:22:09Z"
},
"typeMeta": {
"kind": "event"
},
"message": "Created container",
"sourceComponent": "kubelet",
"sourceHost": "192.168.74.102",
"object": "spec.containers{zhzlconsole}",
"count": 1,
"firstSeen": "2018-05-09T08:22:09Z",
"lastSeen": "2018-05-09T08:22:09Z",
"reason": "Created",
"type": "Normal"
},
{
"objectMeta": {
"name": "zhzltest-1525854120-pcsfx.152cec3f1afdc1f8",
"namespace": "test-zhzl",
"creationTimestamp": "2018-05-09T08:22:09Z"
},
"typeMeta": {
"kind": "event"
},
"message": "Started container",
"sourceComponent": "kubelet",
"sourceHost": "192.168.74.102",
"object": "spec.containers{zhzlconsole}",
"count": 1,
"firstSeen": "2018-05-09T08:22:09Z",
"lastSeen": "2018-05-09T08:22:09Z",
"reason": "Started",
"type": "Normal"
}
]
},
"persistentVolumeClaimList": {
"listMeta": {
"totalItems": 0
},
"items": null,
"errors": null
},
"errors": []
}
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>单点登录</title>
<link rel="shortcut icon" type="image/x-icon" href="static/favicon.ico" />
</head>
<body>
<style>
html {
overflow-y: auto;
margin: 0;
padding: 0;
}
body {
margin: 0;
padding: 0;
}
</style>
<div id="app"></div>
</body>
</html>
{
"name": "apaas-login",
"version": "1.0.0",
"description": "A Vuetify.js Project Manage Kubernetes",
"author": "shucheng <shucheng@bd-apaas.com>",
"private": true,
"scripts": {
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
"start": "npm run dev",
"build": "node build/build.js"
},
"dependencies": {
"@fortawesome/fontawesome-free": "^5.8.0",
"axios": "^0.19.2",
"babel-polyfill": "^6.26.0",
"codemirror": "^5.45.0",
"element-ui": "^2.11.1",
"material-design-icons-iconfont": "^4.0.5",
"qs": "^6.9.4",
"string-format": "^2.0.0",
"vue": "^2.6.10",
"vue-router": "^3.0.2",
"vuex": "^3.1.0"
},
"devDependencies": {
"@babel/core": "^7.4.0",
"@babel/plugin-syntax-jsx": "^7.2.0",
"@babel/plugin-transform-runtime": "^7.4.0",
"@babel/preset-env": "^7.4.2",
"@babel/runtime": "^7.4.2",
"autoprefixer": "^9.5.0",
"babel-loader": "^8.0.5",
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-vue-jsx": "^3.7.0",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^2.1.1",
"file-loader": "^3.0.1",
"friendly-errors-webpack-plugin": "^1.7.0",
"html-webpack-plugin": "^3.2.0",
"mini-css-extract-plugin": "^0.5.0",
"node-notifier": "^5.4.0",
"optimize-css-assets-webpack-plugin": "^5.0.1",
"ora": "^3.2.0",
"portfinder": "^1.0.20",
"postcss-import": "^12.0.1",
"postcss-loader": "^3.0.0",
"postcss-url": "^8.0.0",
"rimraf": "^2.6.3",
"semver": "^5.6.0",
"shelljs": "^0.8.3",
"terser-webpack-plugin": "^1.2.3",
"url-loader": "^1.1.2",
"vue-loader": "^15.7.0",
"vue-style-loader": "^4.1.2",
"vue-template-compiler": "^2.6.10",
"webpack": "^4.29.6",
"webpack-bundle-analyzer": "^3.1.0",
"webpack-cli": "^3.2.3",
"webpack-dev-server": "^3.2.1",
"webpack-merge": "^4.2.1"
},
"engines": {
"node": ">= 8.12.0",
"npm": ">= 6.4.1",
"yarn": ">= 1.12.3"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
}
# awecloud
> A Vue.js project
## Build Setup
``` bash
# install dependencies
yarn install
# serve with hot reload at localhost:8080
yarn run dev
# build for production with minification
yarn run build
```
# 使用
## 修改config/index.js
```javascript
build: {
// Template for index.html
index: path.resolve(__dirname, '../dist', 'awecloud', 'ui', 'index.html'),
// Paths
assetsRoot: path.resolve(__dirname, '../dist', 'awecloud', 'ui'),
assetsSubDirectory: 'static',
assetsPublicPath: '/awecloud/ui/',
}
```
## 修改build/dockerfile
```
ADD ./dist /www
ADD ./build/conf.yaml /etc/awecloud/conf.yaml
```
## 修改.drone.yml
```
```
## googlefonts本地化
```bash
# index.html
- <link href='https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons' rel="stylesheet">
# src/assets/css
add googlefonts.css googlefonts
# src/main.js
+ import "@src/assets/css/googlefonts.css";
```
## add IE11 support
```bash
# src/main.js
+ import "babel-polyfill";
# package.json
yarn add babel-polyfill
```
## remove overflow-y
```bash
# index.html
+ <style>
+ html {
+ overflow-y: auto
+ }
+ </style>
```
; DO NOT EDIT (unless you know what you are doing)
;
; This subdirectory is a git "subrepo", and this file is maintained by the
; git-subrepo command. See https://github.com/git-commands/git-subrepo#readme
;
[subrepo]
remote = https://github.com/vuetifyjs/templates-common.git
branch = subrepo/webpack-src
commit = 090741fa8ba4da0c6f85db64eff64550704123e1
parent = e05204fc0583a8c99f1963ce873eba1266838215
method = merge
cmdver = 0.4.0
<template>
<div id="app">
<router-view />
</div>
</template>
<script>
export default {
data: () => ({}),
methods: {},
created() {},
};
</script>
<style scoped>
#app {
background-color: #f6f7fb;
font-size: 14px;
}
</style>
\ No newline at end of file
<template>
<div class="s-canvas">
<canvas id="s-canvas" :width="contentWidth" :height="contentHeight"></canvas>
</div>
</template>
<script>
export default {
name: "SIdentify",
props: {
identifyCode: {
type: String,
default: "1234"
},
fontSizeMin: {
type: Number,
default: 25
},
fontSizeMax: {
type: Number,
default: 30
},
backgroundColorMin: {
type: Number,
default: 255
},
backgroundColorMax: {
type: Number,
default: 255
},
colorMin: {
type: Number,
default: 0
},
colorMax: {
type: Number,
default: 160
},
lineColorMin: {
type: Number,
default: 100
},
lineColorMax: {
type: Number,
default: 255
},
dotColorMin: {
type: Number,
default: 0
},
dotColorMax: {
type: Number,
default: 255
},
contentWidth: {
type: Number,
default: 150
},
contentHeight: {
type: Number,
default: 38
}
},
methods: {
// 生成一个随机数
randomNum(min, max) {
return Math.floor(Math.random() * (max - min) + min);
},
// 生成一个随机的颜色
randomColor(min, max) {
let r = this.randomNum(min, max);
let g = this.randomNum(min, max);
let b = this.randomNum(min, max);
return "rgb(" + r + "," + g + "," + b + ")";
},
drawPic() {
let canvas = document.getElementById("s-canvas");
let ctx = canvas.getContext("2d");
ctx.textBaseline = "bottom";
// 绘制背景
ctx.fillStyle = this.randomColor(
this.backgroundColorMin,
this.backgroundColorMax
);
ctx.fillRect(0, 0, this.contentWidth, this.contentHeight);
// 绘制文字
for (let i = 0; i < this.identifyCode.length; i++) {
this.drawText(ctx, this.identifyCode[i], i);
}
this.drawLine(ctx);
this.drawDot(ctx);
},
drawText(ctx, txt, i) {
ctx.fillStyle = this.randomColor(this.colorMin, this.colorMax);
ctx.font =
this.randomNum(this.fontSizeMin, this.fontSizeMax) + "px SimHei";
let x = (i + 1) * (this.contentWidth / (this.identifyCode.length + 1));
let y = this.randomNum(this.fontSizeMax, this.contentHeight - 5);
var deg = this.randomNum(-45, 45);
// 修改坐标原点和旋转角度
ctx.translate(x, y);
ctx.rotate((deg * Math.PI) / 180);
ctx.fillText(txt, 0, 0);
// 恢复坐标原点和旋转角度
ctx.rotate((-deg * Math.PI) / 180);
ctx.translate(-x, -y);
},
drawLine(ctx) {
// 绘制干扰线
for (let i = 0; i < 5; i++) {
ctx.strokeStyle = this.randomColor(
this.lineColorMin,
this.lineColorMax
);
ctx.beginPath();
ctx.moveTo(
this.randomNum(0, this.contentWidth),
this.randomNum(0, this.contentHeight)
);
ctx.lineTo(
this.randomNum(0, this.contentWidth),
this.randomNum(0, this.contentHeight)
);
ctx.stroke();
}
},
drawDot(ctx) {
// 绘制干扰点
for (let i = 0; i < 80; i++) {
ctx.fillStyle = this.randomColor(0, 255);
ctx.beginPath();
ctx.arc(
this.randomNum(0, this.contentWidth),
this.randomNum(0, this.contentHeight),
1,
0,
2 * Math.PI
);
ctx.fill();
}
}
},
watch: {
identifyCode() {
this.drawPic();
}
},
mounted() {
this.drawPic();
}
};
</script>
<style scoped>
.s-canvas {
height: 38px;
}
</style>
\ No newline at end of file
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import '@fortawesome/fontawesome-free/css/all.css'
import 'material-design-icons-iconfont/dist/material-design-icons.css'
import "babel-polyfill";
import Vue from 'vue'
import Vuex from 'vuex';
Vue.use(Vuex);
import store from '@/store';
store.install(Vuex);
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css'
Vue.use(ElementUI)
import App from './App'
import router from './router'
Vue.config.productionTip = false
/* eslint-disable no-new */
import api from './request/api'
Vue.prototype.$api = api;
new Vue({
el: '#app',
router,
components: { App },
template: '<App/>'
})
<template>
<div class="login_backg">
<div class="login_all">
<div class="headercontainer">
<div class="center-logo" style="width:100%;">
<img class="logo" src="@/assets/image/login_head.png" alt />
</div>
</div>
<el-card v-show="active == 'login'" class="box-card login">
<div slot="header" class="clearfix"></div>
<el-form :model="form" ref="form1" @submit.native.prevent class="login_forms">
<el-form-item>
<p class="item_p">账号</p>
<el-input v-model.trim="form.userid" autofocus="autofocus" placeholder="请输入账号"></el-input>
</el-form-item>
<el-form-item>
<p class="item_p">密码</p>
<el-input
:type="visible ? 'password':'text'"
v-model.trim="form.password"
placeholder="请输入密码"
>
<span
slot="suffix"
:title="visible ? '显示密码':'隐藏密码'"
@click="changePass()"
style="cursor:pointer;"
:class="visible ? 'eye_dis':'eye'"
></span>
</el-input>
</el-form-item>
</el-form>
<el-form>
<el-form-item class="rembme">
<el-checkbox v-model="checked">记住密码</el-checkbox>
</el-form-item>
<el-form-item>
<el-button
class="btn_sub sub1"
type="primary"
@click.prevent="login_remember_info()"
>登 录</el-button>
</el-form-item>
<el-form-item>
<el-button class="btn_sub sub2" @click.prevent="register">
还没有账户?立即注册&nbsp;&nbsp;
<i class="el-icon-arrow-right"></i>
</el-button>
</el-form-item>
</el-form>
</el-card>
<el-card v-show="active == 'register'" class="box-card login">
<div slot="header" class="clearfix"></div>
<div class="register_step">
<el-steps :active="registerActive" align-center>
<el-step title="个人信息"></el-step>
<el-step title="业务系统信息"></el-step>
</el-steps>
</div>
<div v-show="registerActive == 0">
<el-form :model="ruleForm_0" :rules="rules_0" ref="ruleForm_0" class="demo-ruleForm">
<el-form-item prop="userid1" :class="ruleFormIcon.userid1?'':'icon_show'">
<p class="item_p">账号</p>
<el-input v-model.trim="ruleForm_0.userid1" placeholder="为字母、数字、下划线或其组合"></el-input>
</el-form-item>
<el-form-item prop="password1" :class="ruleFormIcon.password1?'':'icon_show'">
<p class="item_p">登录密码</p>
<el-input
autocomplete="off"
v-model.trim="ruleForm_0.password1"
:type="pwdCheck?'text':'password'"
placeholder="密码为大小写字母及数字组合,不少于6位"
>
<span
slot="suffix"
:title="pwdCheck?'隐藏密码':'显示密码'"
:class="pwdCheck?'eye':'eye_dis'"
@click="pwdCheck=!pwdCheck"
></span>
</el-input>
</el-form-item>
<el-form-item prop="truePassword" :class="ruleFormIcon.truePassword?'':'icon_show'">
<p class="item_p">确认密码</p>
<el-input
autocomplete="off"
v-model.trim="ruleForm_0.truePassword"
:type="truePwdCheck?'text':'password'"
placeholder="请确认密码"
>
<span
slot="suffix"
:title="truePwdCheck?'隐藏密码':'显示密码'"
:class="truePwdCheck?'eye':'eye_dis'"
@click="truePwdCheck=!truePwdCheck"
></span>
</el-input>
</el-form-item>
<el-form-item prop="cname" :class="ruleFormIcon.cname?'':'icon_show'">
<p class="item_p">昵称</p>
<el-input v-model.trim="ruleForm_0.cname" placeholder="给自己取个昵称吧"></el-input>
</el-form-item>
</el-form>
</div>
<div v-show="registerActive == 1">
<el-form :model="ruleForm_1" :rules="rules_1" ref="ruleForm_1" class="demo-ruleForm">
<el-form-item
prop="businessSystemName"
:class="ruleFormIcon.businessSystemName?'':'icon_show'"
>
<p class="item_p">业务系统名</p>
<el-input v-model.trim="ruleForm_1.businessSystemName" placeholder="例:机关事务大数据平台"></el-input>
</el-form-item>
<el-form-item prop="domainName" :class="ruleFormIcon.domainName?'':'icon_show'">
<p class="item_p">域名</p>
<el-input v-model.trim="ruleForm_1.domainName" placeholder="填写业务系统的域名"></el-input>
</el-form-item>
<el-form-item>
<p class="item_p">IP(白名单)</p>
<div class="ip_block">
<div v-for="(item, index) in ruleForm_1.ip_white" :key="index" class="ip_item">
{{ item }}
<i class="el-icon-close ip_del" @click="delIp(index)"></i>
</div>
<el-input
v-if="whiteAddShow"
class="ip_input"
v-model="newIpWhite"
@keyup.enter.native="watchKeyboardWhite"
></el-input>
<el-button class="add_ip" @click="addIp('white')" icon="el-icon-plus">增加</el-button>
</div>
</el-form-item>
<el-form-item prop="organization" :class="ruleFormIcon.organization?'':'icon_show'">
<p class="item_p">用户组织机构</p>
<el-select v-model="ruleForm_1.organization" placeholder="请选择">
<el-option
v-for="item in organizationOptions"
:key="item.department_id"
:label="item.department_name"
:value="item.department_id"
></el-option>
</el-select>
</el-form-item>
</el-form>
</div>
<div v-if="registerActive == 1">
<el-form :model="yzms" :rules="yzmRules" ref="yzms" class="demo-ruleForm">
<el-form-item prop="yzm" :class="ruleFormIcon.yzm?'yzm':'yzm icon_show'">
<p class="item_p">验证码</p>
<el-input v-model.trim="yzms.yzm" placeholder="请输入验证码"></el-input>
<s-identify
class="yzm_img"
:identifyCode="identifyCode"
@click.native="refreshCode()"
></s-identify>
</el-form-item>
</el-form>
</div>
<el-form class="demo-ruleForm">
<el-form-item>
<el-button
v-if="registerActive == 1"
class="btn_sub sub1"
type="primary"
@click.prevent="submitForm()"
>完成注册</el-button>
<el-button v-else class="btn_sub sub1" type="primary" @click.prevent="nextStep()">下一步</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="registerActive == 0" class="btn_sub sub2" @click.prevent="login">
<i class="el-icon-arrow-left"></i>&nbsp;&nbsp;登录已有账号
</el-button>
<el-button v-else class="btn_sub sub2" @click.prevent="previous">
<i class="el-icon-arrow-left"></i>&nbsp;&nbsp;上一步
</el-button>
</el-form-item>
</el-form>
</el-card>
<div v-if="active == 'login'" class="footer_message">
登录即代表您已同意
<span class="footer_message_bg">《BD-aPaaS平台用户协议与隐私政策》</span>
</div>
</div>
</div>
</template>
<script>
import { getCookie, clearCookie, setCookie } from "@/services/cookie.js";
import SIdentify from "@/components/sidentify";
export default {
components: { SIdentify },
data() {
var validatePass = (rule, value, callback) => {
if (value !== this.ruleForm_0.password1) {
this.ruleFormIcon.truePassword = false;
callback(new Error("密码和确认密码不一致"));
} else {
this.ruleFormIcon.truePassword = true;
callback();
}
};
var validateUser = (rule, value, callback) => {
let reg = new RegExp(/^[a-zA-Z0-9|\-|_|\.]+$/);
if (value == "") {
this.ruleFormIcon.userid1 = false;
callback(new Error("请输入账号"));
} else if (value.length > 16) {
this.ruleFormIcon.userid1 = false;
callback(new Error("长度请不要超过16位"));
} else if (!reg.test(value)) {
this.ruleFormIcon.userid1 = false;
callback(new Error("只支持字母、数字、-、_、."));
} else {
let query = {
value: value,
};
this.$api.general
.validateUser(query)
.then((response) => {
if (response.data.success == 1) {
this.ruleFormIcon.userid1 = true;
callback();
} else {
this.ruleFormIcon.userid1 = false;
callback(new Error(response.data.errMsg));
}
})
.catch((response) => {
this.ruleFormIcon.userid1 = false;
callback(new Error("Network fluctuation"));
});
}
};
var validatePassword = (rule, value, callback) => {
let reg = new RegExp(
/^.*(?=.{6,50})(?=.*\d)(?=.*[A-Z]{1,})(?=.*[a-z]{1,}).*$/
);
if (value == "") {
this.ruleFormIcon.password1 = false;
callback(new Error("请输入密码"));
} else if (!reg.test(value)) {
this.ruleFormIcon.password1 = false;
callback(new Error("密码包含大小写字母、数字,长度不小于6位"));
} else {
this.ruleFormIcon.password1 = true;
callback();
}
};
var validateCname = (rule, value, callback) => {
if (value == "") {
this.ruleFormIcon.cname = false;
callback(new Error("请输入昵称"));
} else {
this.ruleFormIcon.cname = true;
callback();
}
};
var validateBusinessSystemName = (rule, value, callback) => {
if (value == "") {
this.ruleFormIcon.businessSystemName = false;
callback(new Error("请输入业务系统名"));
} else {
this.ruleFormIcon.businessSystemName = true;
callback();
}
};
var validateDomainName = (rule, value, callback) => {
if (value == "") {
this.ruleFormIcon.domainName = false;
callback(new Error("请输入域名"));
} else {
this.ruleFormIcon.domainName = true;
callback();
}
};
var validateOrganization = (rule, value, callback) => {
if (value == "") {
this.ruleFormIcon.organization = false;
callback(new Error("请选择用户组织机构"));
} else {
this.ruleFormIcon.organization = true;
callback();
}
};
var validateYzm = (rule, value, callback) => {
if (value == "") {
this.ruleFormIcon.yzm = false;
this.yzmState = false;
callback(new Error("请输入验证码"));
} else {
if (value !== this.identifyCode) {
this.ruleFormIcon.yzm = false;
this.refreshCode();
callback(new Error("验证码错误"));
} else {
this.ruleFormIcon.yzm = true;
this.yzmState = true;
callback();
}
}
};
return {
form: {
userid: "",
password: "",
},
visible: true,
checked: false,
active: "login",
pwdCheck: false,
truePwdCheck: false,
ruleForm_0: {
userid1: "",
password1: "",
truePassword: "",
cname: "",
},
ruleForm_1: {
businessSystemName: "",
domainName: "",
ip_white: [],
organization: "",
},
yzms: {
yzm: "",
},
yzmRules: {
yzm: [{ validator: validateYzm, trigger: "blur" }],
},
yzmState: false,
ruleFormIcon: {
userid1: true,
password1: true,
truePassword: true,
cname: true,
businessSystemName: true,
yzm: true,
domainName: true,
organization: true,
},
rules_0: {
userid1: [
{ validator: validateUser, trigger: "blur" },
{ max: 8, message: "长度请小于8个字符", trigger: "blur" },
],
password1: [
{ validator: validatePassword, trigger: "blur" },
{ max: 20, message: "长度请小于20个字符", trigger: "blur" },
],
truePassword: [
{ validator: validatePass, trigger: "blur" },
{ max: 20, message: "长度请小于20个字符", trigger: "blur" },
],
cname: [
{ validator: validateCname, trigger: "blur" },
{ max: 8, message: "长度请小于8个字符", trigger: "blur" },
],
},
rules_1: {
businessSystemName: [
{ validator: validateBusinessSystemName, trigger: "blur" },
{ max: 16, message: "长度请小于16个字符", trigger: "blur" },
],
domainName: [
{ validator: validateDomainName, trigger: "blur" },
{ max: 50, message: "长度请小于50个字符", trigger: "blur" },
],
organization: [{ validator: validateOrganization, trigger: "change" }],
},
imgSrc: "",
imgId: "",
registerActive: 0,
organizationOptions: [],
identifyCodes: "1234567890",
identifyCode: "",
whiteAddShow: "",
newIpWhite: "",
};
},
mounted() {
this.init();
},
created() {
if (getCookie("userinfo")) {
this.checked = true;
let userinfo = decodeURI(decodeURI(getCookie("userinfo"))).split(",");
this.form.userid = userinfo[0];
this.form.password = userinfo[1];
} else {
this.checked = false;
}
},
methods: {
init() {
if (this.$route.params.userid != undefined) {
this.form.userid = this.$route.params.userid;
this.form.password = this.$route.params.password;
}
},
//登录请求
// ?ReturnUrl=/shop/video_service_list/7
login_request() {
let self = this;
if (self.form.userid == "") {
self.$message({
message: "请填写用户名",
type: "error",
});
} else if (self.form.password == "") {
self.$message({
message: "请填写密码",
type: "error",
});
} else {
let query = self.form;
self.$api.general.login(query).then((response) => {
if (response.data.success == 1) {
let redirect = self.$route.query.ReturnUrl;
if (redirect && redirect != "") {
// redirect = decodeURIComponent(redirect)
window.location.href = redirect;
} else {
self.$api.general.getNowUser().then((response) => {
if (response.data.success == 1) {
if (
response.data.data.is_admin == 1 ||
response.data.data.is_admin == 2
) {
window.location.href = "/apaas/ui/#/workplace";
} else {
window.location.href = "/apaas/ui/#/services_shop";
}
} else {
self.$message({
message: response.data.errMsg,
type: "error",
});
}
});
}
} else if (response.data.success == 0) {
self.$message({
message: response.data.errMsg,
type: "error",
});
}
});
}
},
login_remember_info() {
if (this.checked) {
setCookie(
"userinfo",
encodeURI(encodeURI(this.form.userid + "," + this.form.password))
);
} else {
clearCookie("userinfo");
}
this.login_request();
},
changePass() {
this.visible = !this.visible;
},
register() {
this.active = "register";
this.registerActive = 0;
setTimeout(() => {
this.ruleForm_0.userid1 = "";
this.ruleForm_0.password1 = "";
this.ruleFormIcon.userid1 = true;
this.ruleFormIcon.password1 = true;
this.$refs.ruleForm_0.clearValidate();
}, 100);
this.getOrganizations();
this.refreshCode();
},
// get random
randomNum(min, max) {
return Math.floor(Math.random() * (max - min) + min);
},
//验证码
refreshCode() {
this.identifyCode = "";
this.makeCode(this.identifyCodes, 4);
},
makeCode(o, l) {
for (let i = 0; i < l; i++) {
this.identifyCode += this.identifyCodes[
this.randomNum(0, this.identifyCodes.length)
];
}
},
getOrganizations() {
this.$api.general.getOrganizations().then((response) => {
if (response.data.success == 1) {
this.organizationOptions = response.data.data;
}
});
},
submitForm() {
let self = this;
self.$refs["ruleForm_1"].validate((valid, obj) => {
if (valid) {
self.$refs["yzms"].validate((volid_yzm, obj_yzm) => {
if (volid_yzm) {
let setI = setInterval(function () {
clearInterval(setI);
self.submitAll();
});
} else {
self.$message({
message: "请完善验证码",
type: "error",
});
self.refreshCode();
}
});
} else {
self.$message({
message: "请完善信息",
type: "error",
});
}
});
},
submitAll() {
let query = {
user_id: this.ruleForm_0.userid1,
user_name: this.ruleForm_0.cname,
password: this.ruleForm_0.password1,
system_name: this.ruleForm_1.businessSystemName,
domain_name: this.ruleForm_1.domainName,
department_id: this.ruleForm_1.organization,
phone: "",
email: "",
state: 0,
position: "",
qq: "",
ip_whitelist: this.ruleForm_1.ip_white,
};
this.$api.general.register(query).then((response) => {
if (response.data.success == 1) {
// console.log(response.data.data);
this.$message({
message: "注册成功",
type: "success",
});
this.login();
this.form.userid = this.ruleForm_0.userid1;
this.form.password = this.ruleForm_0.password1;
} else {
this.$message({
message: "注册失败" + response.data.data,
type: "error",
});
}
});
},
delIp(index) {
this.ruleForm_1.ip_white.split(index, 1);
},
login() {
this.active = "login";
this.ruleForm_0.userid1 = "";
this.ruleForm_0.password1 = "";
this.ruleForm_0.truePassword = "";
this.ruleForm_0.cname = "";
this.ruleForm_1.businessSystemName = "";
this.ruleForm_1.domainName = "";
this.ruleForm_1.ip_white = [];
this.ruleForm_1.organization = "";
this.ruleFormIcon.userid1 = true;
this.ruleFormIcon.password1 = true;
this.ruleFormIcon.truePassword = true;
this.ruleFormIcon.cname = true;
this.ruleFormIcon.businessSystemName = true;
this.ruleFormIcon.yzm = true;
this.ruleFormIcon.domainName = true;
this.ruleFormIcon.organization = true;
},
nextStep() {
this.$refs["ruleForm_0"].validate((valid, obj) => {
if (valid) {
this.registerActive = 1;
}
});
},
previous() {
this.registerActive = 0;
},
addIp(type) {
this.whiteAddShow
? this.$message({
message: "请按回车完善本次ip填写",
type: "error",
})
: (this.whiteAddShow = true);
},
watchKeyboardWhite() {
let self = this;
if (self.newIpWhite != "") {
let reg = new RegExp(
/((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}/g
);
if (reg.test(self.newIpWhite)) {
self.ruleForm_1.ip_white.push(self.newIpWhite);
self.whiteAddShow = false;
self.newIpWhite = "";
} else {
self.$message({
message: "ip格式错误",
type: "error",
});
self.whiteAddShow = false;
self.newIpWhite = "";
}
}
},
},
};
</script>
<style scoped>
.login_backg {
height: 100vh;
background: url("~@/assets/image/img_bg.jpg") center center;
background-size: 100% 100%;
overflow: auto;
}
.login_all {
width: 500px;
height: 100vh;
margin: 0 auto;
}
.login {
min-width: 500px;
font-size: 16px;
margin-bottom: 100px;
}
.login .el-card__header {
padding: 10px;
}
.login_head {
display: block;
width: 100%;
font-size: 16px;
font-weight: bold;
text-align: center;
color: #1a2236;
}
.item_p {
margin: 0 0 0 10%;
padding: 0 0 0 15px;
line-height: 24px;
}
.login .el-form-item {
margin-bottom: 22px;
}
.warning_icon_div {
display: inline-block;
width: 9%;
}
.login .el-input {
width: 80%;
margin-left: 10%;
}
.login .el-select {
width: 80%;
margin-left: 10%;
}
.login .rembme {
padding-left: 14%;
margin-bottom: 10px;
}
.login .el-button {
width: 80%;
margin-left: 10%;
height: 40px;
border-radius: 20px;
}
.sub1 {
background-image: linear-gradient(0deg, #d7d7d7 0%, #ffffff 100%),
linear-gradient(#0f2683, #0f2683);
background-blend-mode: color-burn, normal;
box-shadow: 0px 3px 6px 0px #515fe7;
border: #0f2683 1px solid;
color: #f4f7fc;
}
.sub2 {
background-color: #e6ebfe;
color: #515fe7;
}
.headercontainer {
max-width: 960px;
margin: 0;
padding: 15vh 0 7vh;
margin-right: auto;
margin-left: auto;
}
.center-logo {
/* margin: 8px 0; */
text-align: center;
}
.el-form--label-top .el-form-item__label {
padding: 0px;
}
.logo {
width: 275px;
height: 45px;
}
.login_forms {
margin-top: 20px;
}
.icon_show {
position: relative;
}
.icon_show::before {
content: "";
width: 20px;
height: 20px;
position: absolute;
top: 34px;
left: 15px;
background: url("~@/assets/image/ic_warning.png") no-repeat center center;
}
.eye {
display: inline-block;
width: 20px;
height: 20px;
position: relative;
top: 4px;
cursor: pointer;
background: url("~@/assets/image/login_eye.png") no-repeat center center;
}
.eye_dis {
display: inline-block;
width: 20px;
height: 20px;
position: relative;
top: 6px;
cursor: pointer;
background: url("~@/assets/image/login_eye_dis.png") no-repeat center center;
}
.login .yzm .el-input {
width: 42%;
margin-left: 10%;
}
.yzm {
position: relative;
}
.yzm .yzm_img {
position: absolute;
top: 26px;
right: 12%;
width: 150px;
height: 40px;
cursor: pointer;
}
.footer_message {
width: 500px;
text-align: center;
color: #bcc1d0;
position: fixed;
bottom: 5vh;
}
.footer_message_bg {
color: #fff;
cursor: pointer;
}
.register_step {
margin-bottom: 20px;
}
.ip_block {
border-radius: 8px;
border: solid 1px #e3e5ef;
background-color: #f7f8f9;
padding: 10px 0 0 10px;
line-height: 24px;
width: calc(80% - 10px);
margin-left: 10%;
}
.ip_item {
display: inline-block;
position: relative;
background-color: #e6ebfe;
border-radius: 4px;
color: #0f2683;
font-size: 12px;
line-height: 24px;
padding: 0 26px 0 8px;
margin-right: 10px;
margin-bottom: 10px;
}
.ip_del {
position: absolute;
right: 8px;
top: 6px;
font-size: 14px;
color: #6573ae;
cursor: pointer;
}
.ip_del:hover {
color: #e56600;
}
.add_ip {
background-color: #495feb;
border-radius: 4px !important;
color: #f8f9fd;
font-size: 12px;
line-height: 24px;
padding: 0 8px !important;
margin-right: 10px !important;
margin-bottom: 10px !important;
width: 60px !important;
height: 24px !important;
margin-left: 0 !important;
}
.ip_input {
width: 110px !important;
margin-left: 0 !important;
margin-right: 10px !important;
margin-bottom: 10px !important;
}
</style>
<style>
.login .el-input__suffix {
font-size: 20px;
right: 10px;
}
.login .el-form-item__error {
left: 14%;
}
.login .el-input__inner {
height: 40px;
padding-left: 20px;
padding-right: 38px;
border-radius: 8px;
border: solid 1px #e3e5ef;
background-color: #f7f8f9;
}
.login .rembme .el-checkbox__input.is-checked + .el-checkbox__label {
color: #1a2236;
font-weight: 700;
}
.el-card.login {
border: 0;
border-radius: 12px;
}
.login .el-card__header {
padding: 0;
height: 10px;
background-image: linear-gradient(90deg, #ea7d19 0%, #fcce72 100%),
linear-gradient(#e56600, #e56600);
background-blend-mode: normal, normal;
}
.register_step .is-process .el-step__icon,
.register_step .is-finish .el-step__icon {
width: 30px;
height: 30px;
background-image: radial-gradient(
#515fe7 50%,
#8390ee 50%,
#8390ee 60%,
#515fe7 60%,
#515fe7 100%
);
border: 0;
}
.register_step .is-process .el-step__icon-inner,
.register_step .is-finish .el-step__icon-inner {
color: #fff;
}
.register_step .el-step__icon {
width: 30px;
height: 30px;
background-image: radial-gradient(
#bcc1d0 50%,
#e3e5ef 50%,
#e3e5ef 60%,
#bcc1d0 60%,
#bcc1d0 100%
);
border: 0;
}
.register_step .el-step__icon-inner {
color: #e3e5ef;
}
.register_step .el-step__title.is-process,
.register_step .el-step__title.is-finish {
color: #242c43;
font-weight: 500;
}
.register_step .el-step__title {
font-size: 14px;
color: #bcc1d0;
}
.register_step .el-step.is-horizontal .el-step__line {
height: 3px;
top: 14px;
background: linear-gradient(
to right,
transparent 0%,
transparent 10%,
#515fe7 10%,
#515fe7 50%,
#e3e5ef 50%,
#e3e5ef 90%,
transparent 90%,
transparent 100%
);
}
.register_step .el-step.is-horizontal .is-finish .el-step__line {
height: 3px;
top: 14px;
background: linear-gradient(
to right,
transparent 0%,
transparent 10%,
#515fe7 10%,
#515fe7 90%,
transparent 90%,
transparent 100%
);
}
.login .rembme .el-checkbox__input.is-checked .el-checkbox__inner,
.el-checkbox__input.is-indeterminate .el-checkbox__inner {
background-color: #515fe7;
border-color: #515fe7;
}
.login .rembme .el-checkbox__input.is-focus .el-checkbox__inner {
border-color: #515fe7;
}
.ip_input .el-input__inner {
border-radius: 4px;
padding: 0 8px;
font-size: 12px;
line-height: 24px;
height: 24px;
}
</style>
\ No newline at end of file
import general from '@/request/api/general';
export default {
general
}
\ No newline at end of file
import axios from '@/request/http'; // 导入http中创建的axios实例
import qs from 'qs'; // 根据需求是否导入qs模块
const general = {
login(params) {
return axios.post(`/iam/api/login`, params);
},
validateUser(params) {
return axios.get(`/apaas/backmgt/user/checkUserId?user_id=${params.value}`);
},
register(params) {
return axios.post(`/apaas/backmgt/user/register`, params);
},
getOrganizations() {
return axios.get(`/apaas/backmgt/department/list`);
},
// user info
getNowUser() {
return axios.get(`/apaas/backmgt/user/getCurrentUser`);
},
}
export default general;
/**
* axios封装
* 请求拦截、响应拦截、错误统一处理
*/
import axios from 'axios';
import router from '../router';
import store from '../store/index';
import ElementUI from 'element-ui';
const tip = msg => {
console.log(msg);
ElementUI.Message.error(msg);
}
/**
* 跳转登录页
* 携带当前页面路由,以期在登录页面完成登录后返回当前页面
*/
const toLogin = () => {
window.location.href = "/login?redirect=" + router.currentRoute.fullPath
}
/**
* 请求失败后的错误统一处理
* @param {Number} status 请求失败的状态码
*/
const errorHandle = (status, other) => {
// 状态码判断
switch (status) {
case 400: tip('请求错误(400)'); break;
// 401: 未登录状态,跳转登录页
case 401:
toLogin();
break;
// 403 token过期
// 清除token并跳转登录页
case 403:
tip('登录过期,请重新登录');
localStorage.removeItem('token');
store.commit('loginSuccess', null);
setTimeout(() => {
toLogin();
}, 1000);
break;
case 404: tip('请求的资源不存在'); break;
case 408: tip('请求超时(408)'); break;
case 500: tip('服务器错误(500)'); break;
case 501: tip('服务未实现(501)'); break;
case 502: tip('网络错误(502)'); break;
case 503: tip('服务不可用(503)'); break;
case 504: tip('网络超时(504)'); break;
case 505: tip('HTTP版本不受支持(505)'); break;
default: tip(`连接出错,${other}`);
}
}
// 创建axios实例
var instance = axios.create({ timeout: 1000 * 12 });
// 设置post请求头
instance.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
/**
* 请求拦截器
* 每次请求前,如果存在token则在请求头中携带token
*/
instance.interceptors.request.use(
config => {
// const token = store.state.token;
// token && (config.headers.Authorization = token);
return config;
},
error => Promise.error(error))
// 响应拦截器
instance.interceptors.response.use(
// 请求成功
res => res.status === 200 ? Promise.resolve(res) : Promise.reject(res),
// 请求失败
error => {
const { response } = error;
if (response) {
// 请求已发出,但是不在2xx的范围
errorHandle(response.status, response.data.errmessage);
return Promise.reject(response);
}
});
export default instance;
import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/pages/login'
Vue.use(Router)
export default new Router({
routes: [
{
path: "/",
redirect: "/login",
},
{
path: '/login',
name: 'Login',
component: Login
},
]
})
// 取得cookie
function getCookie(name) {
var nameEQ = name + '='
var ca = document.cookie.split(';') // 把cookie分割成组
for (var i = 0; i < ca.length; i++) {
var c = ca[i] // 取得字符串
while (c.charAt(0) == ' ') { // 判断一下字符串有没有前导空格
c = c.substring(1, c.length) // 有的话,从第二位开始取
}
if (c.indexOf(nameEQ) == 0) { // 如果含有我们要的name
return unescape(c.substring(nameEQ.length, c.length)) // 解码并截取我们要值
}
}
return false
}
// 清除cookie
function clearCookie(name) {
setCookie(name, "", -1);
}
// 设置cookie
function setCookie(name, value, seconds) {
seconds = seconds || 0; //seconds有值就直接赋值,没有为0,这个根php不一样。
var expires = "";
if (seconds != 0 ) { //设置cookie生存时间
var date = new Date();
date.setTime(date.getTime()+(seconds*1000));
expires = "; expires="+date.toGMTString();
}
document.cookie = name+"="+escape(value)+expires+"; path=/"; //转码并赋值
}
export {
getCookie,
clearCookie,
setCookie,
}
module.exports = {
"harbor": "/awecloud/rest/harbor/api",
};
\ No newline at end of file
var store = {
install: function (Vuex) {
store.namespace = new Vuex.Store({
state: {
name: "",
},
mutations: {
change(state, name) {
state.name = name;
sessionStorage.setItem("name", name);
}
}
})
}
}
module.exports = store;
(function (window, document) {
var eventUrl = "/awecloud/api/events/token/subscribe";
var pingUrl = "/awecloud/api/events/token/publish?state=ping";
var evtSource = new EventSource(eventUrl);
evtSource.addEventListener("message", function (e) {
console.log("message:", e);
if (e.data == "timeout") {
location.href = "/awecloud/dex/logout?ReturnUrl=" + encodeURIComponent(location.href);
} else if (e.data == "new_login") {
location.href = "/awecloud/dex/logout?ReturnUrl=" + encodeURIComponent(location.href);
}
});
var pingFn = function () {
var req = new XMLHttpRequest();
req.open("GET", pingUrl);
req.send();
};
var nowFn = function () {
return new Date().getTime();
};
var lastActTime = nowFn();
var interval = 10000;
var pingTimerFn = function () {
if (nowFn() - lastActTime < interval) {
pingFn();
}
setTimeout(pingTimerFn, interval);
};
pingTimerFn();
var listenMouseover = function () {
document.body.addEventListener("mouseover", function (e) {
lastActTime = nowFn();
});
};
if (document.body) {
listenMouseover();
} else {
window.addEventListener("load", listenMouseover);
}
})(window, document);
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment