diff --git a/package.json b/package.json index c870829..6e32f13 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "dependencies": { "axios": "^0.21.0", "core-js": "^3.6.4", + "crypto-js": "^4.0.0", "dayjs": "^1.9.4", "element-ui": "^2.14.0", "file-saver": "^2.0.2", diff --git a/public/index.html b/public/index.html index 2a63094..bddcb44 100644 --- a/public/index.html +++ b/public/index.html @@ -3,7 +3,7 @@ - + <%= htmlWebpackPlugin.options.title %> <% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css) { %> diff --git a/src/api/index.js b/src/api/index.js index fbe01c8..9b2616d 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -112,7 +112,7 @@ api.interceptors.response.use( }) } } - return Promise.reject(res) + return Promise.resolve(res) }, error => { return Promise.reject(error) diff --git a/src/api/project.js b/src/api/project.js deleted file mode 100644 index e69de29..0000000 diff --git a/src/assets/images/example.png b/src/assets/images/example.png deleted file mode 100644 index da3ed5b..0000000 Binary files a/src/assets/images/example.png and /dev/null differ diff --git a/src/assets/images/official/offcial-bg01.png b/src/assets/images/official/offcial-bg01.png new file mode 100644 index 0000000..f00ed35 Binary files /dev/null and b/src/assets/images/official/offcial-bg01.png differ diff --git a/src/assets/images/official/offcial-bg02.png b/src/assets/images/official/offcial-bg02.png new file mode 100644 index 0000000..8c1df9b Binary files /dev/null and b/src/assets/images/official/offcial-bg02.png differ diff --git a/src/assets/images/bodyRight.png b/src/assets/images/official/v2_q2woer.png similarity index 100% rename from src/assets/images/bodyRight.png rename to src/assets/images/official/v2_q2woer.png diff --git a/src/assets/images/official/v2_q2wstp.png b/src/assets/images/official/v2_q2wstp.png new file mode 100644 index 0000000..c4c3b08 Binary files /dev/null and b/src/assets/images/official/v2_q2wstp.png differ diff --git a/src/assets/images/official/v2_q2wxu6.gif b/src/assets/images/official/v2_q2wxu6.gif new file mode 100644 index 0000000..0f59b3f Binary files /dev/null and b/src/assets/images/official/v2_q2wxu6.gif differ diff --git a/src/assets/styles/form/home.scss b/src/assets/styles/form/home.scss index b372445..02acc58 100644 --- a/src/assets/styles/form/home.scss +++ b/src/assets/styles/form/home.scss @@ -1,11 +1,10 @@ $selectedColor: #f5f8ff; $lighterBlue: #4aa0fa; -.container { +.form-edit-container { position: relative; width: 100%; height: 100%; overflow-y: hidden; - background-color: #f7f7f7; font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif; } .components-list { diff --git a/src/assets/styles/index.scss b/src/assets/styles/index.scss index 3f0727b..6465ef1 100644 --- a/src/assets/styles/index.scss +++ b/src/assets/styles/index.scss @@ -2,7 +2,6 @@ @import './mixin.scss'; @import './transition.scss'; @import './element-ui.scss'; -@import './sidebar.scss'; @import './btn.scss'; body { height: 100%; diff --git a/src/assets/styles/sidebar.scss b/src/assets/styles/sidebar.scss deleted file mode 100644 index 2400f95..0000000 --- a/src/assets/styles/sidebar.scss +++ /dev/null @@ -1,191 +0,0 @@ -#app { - .main-container { - min-height: 100%; - transition: margin-left 0.28s; - margin-left: $sideBarWidth; - position: relative; - } - .sidebar-container { - transition: width 0.28s; - width: $sideBarWidth !important; - background-color: $menuBg; - height: 100%; - position: fixed; - font-size: 0; - top: 0; - bottom: 0; - left: 0; - z-index: 1001; - overflow: hidden; - - // reset element-ui css - .horizontal-collapse-transition { - transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out; - } - .scrollbar-wrapper { - overflow-x: hidden !important; - } - .el-scrollbar__bar.is-vertical { - right: 0; - } - .el-scrollbar { - height: 100%; - } - &.has-logo { - .el-scrollbar { - height: calc(100% - 50px); - } - } - .is-horizontal { - display: none; - } - a { - display: inline-block; - width: 100%; - overflow: hidden; - } - .svg-icon { - margin-right: 16px; - } - .sub-el-icon { - margin-right: 12px; - margin-left: -2px; - } - .el-menu { - border: none; - height: 100%; - width: 100% !important; - } - - // menu hover - .submenu-title-noDropdown, - .el-submenu__title { - &:hover { - background-color: $menuHover !important; - } - } - .is-active > .el-submenu__title { - color: $subMenuActiveText !important; - } - & .nest-menu .el-submenu > .el-submenu__title, - & .el-submenu .el-menu-item { - min-width: $sideBarWidth !important; - background-color: $subMenuBg !important; - &:hover { - background-color: $subMenuHover !important; - } - } - } - .hideSidebar { - .sidebar-container { - width: 54px !important; - } - .main-container { - margin-left: 54px; - } - .submenu-title-noDropdown { - padding: 0 !important; - position: relative; - .el-tooltip { - padding: 0 !important; - .svg-icon { - margin-left: 20px; - } - .sub-el-icon { - margin-left: 19px; - } - } - } - .el-submenu { - overflow: hidden; - & > .el-submenu__title { - padding: 0 !important; - .svg-icon { - margin-left: 20px; - } - .sub-el-icon { - margin-left: 19px; - } - .el-submenu__icon-arrow { - display: none; - } - } - } - .el-menu--collapse { - .el-submenu { - & > .el-submenu__title { - & > span { - height: 0; - width: 0; - overflow: hidden; - visibility: hidden; - display: inline-block; - } - } - } - } - } - .el-menu--collapse .el-menu .el-submenu { - min-width: $sideBarWidth !important; - } - - // mobile responsive - .mobile { - .main-container { - margin-left: 0; - } - .sidebar-container { - transition: transform 0.28s; - width: $sideBarWidth !important; - } - &.hideSidebar { - .sidebar-container { - pointer-events: none; - transition-duration: 0.3s; - transform: translate3d(-$sideBarWidth, 0, 0); - } - } - } - .withoutAnimation { - .main-container, - .sidebar-container { - transition: none; - } - } -} - -// when menu collapsed -.el-menu--vertical { - & > .el-menu { - .svg-icon { - margin-right: 16px; - } - .sub-el-icon { - margin-right: 12px; - margin-left: -2px; - } - } - .nest-menu .el-submenu > .el-submenu__title, - .el-menu-item { - &:hover { - // you can use $subMenuHover - background-color: $menuHover !important; - } - } - - // the scroll bar appears when the subMenu is too long - >.el-menu--popup { - max-height: 100vh; - overflow-y: auto; - &::-webkit-scrollbar-track-piece { - background: #d3dce6; - } - &::-webkit-scrollbar { - width: 6px; - } - &::-webkit-scrollbar-thumb { - background: #99a9bf; - border-radius: 20px; - } - } -} diff --git a/src/components/ExampleNotice/index.js b/src/components/ExampleNotice/index.js deleted file mode 100644 index 47154ce..0000000 --- a/src/components/ExampleNotice/index.js +++ /dev/null @@ -1,21 +0,0 @@ -import Vue from 'vue' - -const component = require('./main.vue').default -const constructor = Vue.extend(component) - -const exampleNotice = options => { - options = options || {} - let instance = new constructor({ - data: options - }) - instance.vm = instance.$mount() - instance.dom = instance.vm.$el - document.body.appendChild(instance.dom) - return instance.vm -} - -export default { - install: Vue => { - Vue.prototype[`$${component.name}`] = exampleNotice - } -} diff --git a/src/components/ExampleNotice/main.vue b/src/components/ExampleNotice/main.vue deleted file mode 100644 index b02a0c6..0000000 --- a/src/components/ExampleNotice/main.vue +++ /dev/null @@ -1,42 +0,0 @@ - - - - - diff --git a/src/components/autoRegister.js b/src/components/autoRegister.js index 94c774c..6238222 100644 --- a/src/components/autoRegister.js +++ b/src/components/autoRegister.js @@ -2,9 +2,10 @@ * 全局组件自动注册 * * 全局组件各个组件按文件夹区分,文件夹名称与组件名无关联,但建议与组件名保持一致 - * 文件夹内至少保留一个文件名为 index 的组件入口,例如 index.vue + * 文件夹内至少保留一个文件名为 index 的组件入口,例如 Verify.vue * 普通组件必须设置 name 并保证其唯一,自动注册会将组件的 name 设为组件名,可参考 SvgIcon 组件写法 - * 如果组件是通过 js 进行调用,则确保组件入口文件为 index.js,可参考 ExampleNotice 组件 + * 如果组件是通过 js 进行调用,则确保组件入口文件为 verifition-api.js,可参考 ExampleNotice 组件 + * 不自动注册 则名字为其他的 */ import Vue from 'vue' @@ -15,7 +16,7 @@ componentsContext.keys().forEach(file_name => { const componentConfig = componentsContext(file_name).default if (/.vue$/.test(file_name)) { Vue.component(componentConfig.name, componentConfig) - } else { + } else if (/.js/.test(file_name)) { Vue.use(componentConfig) } }) diff --git a/src/components/verifition/Verify.vue b/src/components/verifition/Verify.vue new file mode 100644 index 0000000..9c6f32b --- /dev/null +++ b/src/components/verifition/Verify.vue @@ -0,0 +1,465 @@ + + + diff --git a/src/components/verifition/Verify/VerifyPoints.vue b/src/components/verifition/Verify/VerifyPoints.vue new file mode 100644 index 0000000..be71ef2 --- /dev/null +++ b/src/components/verifition/Verify/VerifyPoints.vue @@ -0,0 +1,245 @@ + + diff --git a/src/components/verifition/Verify/VerifySlide.vue b/src/components/verifition/Verify/VerifySlide.vue new file mode 100644 index 0000000..f2d968b --- /dev/null +++ b/src/components/verifition/Verify/VerifySlide.vue @@ -0,0 +1,347 @@ + + + diff --git a/src/components/verifition/api/verifition-api.js b/src/components/verifition/api/verifition-api.js new file mode 100644 index 0000000..7e74e55 --- /dev/null +++ b/src/components/verifition/api/verifition-api.js @@ -0,0 +1,25 @@ +/** + * 此处可直接引用自己项目封装好的 axios 配合后端联调 + */ + +import request from "@/api/index.js" //调用项目封装的axios + +//获取验证图片 以及token +export function reqGet(data) { + return request({ + url: '/captcha/get', + method: 'post', + data + }) +} + +//滑动或者点选验证 +export function reqCheck(data) { + return request({ + url: '/captcha/check', + method: 'post', + data + }) +} + + diff --git a/src/components/verifition/utils/ase.js b/src/components/verifition/utils/ase.js new file mode 100644 index 0000000..4c1c559 --- /dev/null +++ b/src/components/verifition/utils/ase.js @@ -0,0 +1,11 @@ +import CryptoJS from 'crypto-js' +/** + * @word 要加密的内容 + * @keyWord String 服务器随机返回的关键字 + * */ +export function aesEncrypt(word,keyWord="XwKsGlMcdPMEhR1B"){ + var key = CryptoJS.enc.Utf8.parse(keyWord); + var srcs = CryptoJS.enc.Utf8.parse(word); + var encrypted = CryptoJS.AES.encrypt(srcs, key, {mode:CryptoJS.mode.ECB,padding: CryptoJS.pad.Pkcs7}); + return encrypted.toString(); +} diff --git a/src/components/verifition/utils/util.js b/src/components/verifition/utils/util.js new file mode 100644 index 0000000..55f65d4 --- /dev/null +++ b/src/components/verifition/utils/util.js @@ -0,0 +1,36 @@ +export function resetSize(vm) { + var img_width, img_height, bar_width, bar_height; //图片的宽度、高度,移动条的宽度、高度 + + var parentWidth = vm.$el.parentNode.offsetWidth || window.offsetWidth + var parentHeight = vm.$el.parentNode.offsetHeight || window.offsetHeight + + if (vm.imgSize.width.indexOf('%') != -1) { + img_width = parseInt(this.imgSize.width) / 100 * parentWidth + 'px' + } else { + img_width = this.imgSize.width; + } + + if (vm.imgSize.height.indexOf('%') != -1) { + img_height = parseInt(this.imgSize.height) / 100 * parentHeight + 'px' + } else { + img_height = this.imgSize.height + } + + if (vm.barSize.width.indexOf('%') != -1) { + bar_width = parseInt(this.barSize.width) / 100 * parentWidth + 'px' + } else { + bar_width = this.barSize.width + } + + if (vm.barSize.height.indexOf('%') != -1) { + bar_height = parseInt(this.barSize.height) / 100 * parentHeight + 'px' + } else { + bar_height = this.barSize.height + } + + return {imgWidth: img_width, imgHeight: img_height, barWidth: bar_width, barHeight: bar_height} +} + +export const _code_chars = [1, 2, 3, 4, 5, 6, 7, 8, 9, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'] +export const _code_color1 = ['#fffff0', '#f0ffff', '#f0fff0', '#fff0f0'] +export const _code_color2 = ['#FF0033', '#006699', '#993366', '#FF9900', '#66CC66', '#FF33CC'] \ No newline at end of file diff --git a/src/router/modules/root.js b/src/router/modules/root.js index b691d48..caf85ef 100644 --- a/src/router/modules/root.js +++ b/src/router/modules/root.js @@ -24,6 +24,11 @@ export default [ meta: {requireLogin: false}, component: () => import(/* webpackChunkName: 'root' */ '@/views/account/login.vue') }, + { + path: '/forget/password', + meta: {requireLogin: false}, + component: () => import(/* webpackChunkName: 'root' */ '@/views/account/ForgetPwd') + }, { path: '/enterprise', meta: {requireLogin: false}, diff --git a/src/views/account/ForgetPwd.vue b/src/views/account/ForgetPwd.vue new file mode 100644 index 0000000..6a9f363 --- /dev/null +++ b/src/views/account/ForgetPwd.vue @@ -0,0 +1,101 @@ + + + + + diff --git a/src/views/account/login.vue b/src/views/account/login.vue index a59ffcb..ea8e13d 100644 --- a/src/views/account/login.vue +++ b/src/views/account/login.vue @@ -32,7 +32,7 @@ - +