提交 1e93d3ba authored 作者: 王鹏飞's avatar 王鹏飞

移除无用文件

上级 20e1e6a1
/* Automatically generated by './build/bin/build-entry.js' */ /* Automatically generated by './build/bin/build-entry.js' */
/* 模块基于 element-ui,一定在 element-ui后加载 */ /* 模块基于 element-ui,一定在 element-ui后加载 */
import LoginModule from './login-module'
import Discuss from './discuss' import Discuss from './discuss'
const components = [ const components = [Discuss]
LoginModule,
Discuss
]
const install = function (Vue, opts = {}) { const install = function(Vue, opts = {}) {
components.forEach(component => { components.forEach(component => {
Vue.use(component, opts) Vue.use(component, opts)
}) })
...@@ -22,6 +18,5 @@ if (typeof window !== 'undefined' && window.Vue) { ...@@ -22,6 +18,5 @@ if (typeof window !== 'undefined' && window.Vue) {
export default { export default {
install, install,
LoginModule,
Discuss Discuss
} }
import BaseACTION from '@/action/base_action'
import { Login } from '../api'
export default class LoginAction extends BaseACTION {
/**
* 当前登录用户,检测是否该系统有权限
*/
getInfo () { return Login.getInfo().then(res => res) }
/**
* 调用登录接口
*/
userLogin (obj) {
return Login.userLogin(obj).then(res => {
if (res && res.url === undefined) {
res.url = webConf.others.url || ''
}
return res
})
}
/**
* 调用验证码登录
*/
codeLogin (obj) {
return Login.codeLogin(obj).then(res => {
if (res && res.url === undefined) {
res.url = webConf.others.url || ''
}
return res
})
}
/* 调用退出登录接口 */
outLogin () { return Login.outLogin().then(res => res) }
/**
* 调用获取验证码
*/
sendCode (obj) { return Login.sendCode(obj).then(res => res) }
/**
* 调用发送重置密码验证码
*/
sendResetPwdCode (obj) { return Login.sendResetPwdCode(obj).then(res => res) }
/**
* 调用重置密码验证码确认
*/
validateCode (obj) { return Login.validateCode(obj).then(res => res) }
/**
* 调用重置密码
*/
resetPwd (obj) { return Login.resetPwd(obj).then(res => res) }
/**
* 清空cookies
*/
clearCookies (obj) { return Login.clearCookies(obj).then(res => res) }
}
import LoginAction from './LoginAction'
const Login = new LoginAction()
export default Login
import LoginAPI from './login_api'
const Login = new LoginAPI(webConf)
export {
Login
}
import BaseAPI from '@/api/base_api'
export default class LoginAPI extends BaseAPI {
/**
* 调用登录接口
* @param {[string]} obj.login_name 用户名
* @param {[string]} obj.password 密码 md5加密
* @param {[string]} obj.service 传当前域名
*/
userLogin = (obj = {}) => this.post('/api/passport/rest/login', obj, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } })
/**
* 调用退出登录
*/
outLogin = () => this.get('/api/passport/rest/logout', {}, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } })
/**
* 当前登录用户,检测是否该系统有权限
*/
getInfo = () => this.get('/api/passport/account/get-user-info', {}, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } })
/**
* 发送验证码
* @param {[string]} obj.mobile 手机号
* @param {[string]} obj.service 传当前域名
*/
sendCode = (obj = {}) => this.post('/api/usercenter/user/send-code', obj, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } })
/**
* 验证码登录
* @param {[string]} obj.mobile 手机号
* @param {[string]} obj.code 验证码
* @param {[string]} obj.service 传当前域名
*/
codeLogin = (obj = {}) => this.post('/api/passport/rest/login', obj, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } })
/**
* 发送重置密码验证码
* @param {[string]} obj.contact 手机号/邮箱
* @param {[string]} obj.source_type 值为 3
* @param {[string]} obj.service 传当前域名
*/
sendResetPwdCode = (obj = {}) => this.post('/api/usercenter/user/send-code', obj, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } })
/**
* 重置密码验证码确认
* @param {[string]} obj.contact 手机号/邮箱
* @param {[string]} obj.code 验证码
* @param {[string]} obj.service 传当前域名
*/
validateCode = (obj = {}) => this.post('/api/passport/user_center/validate_code', obj, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } })
/**
* 重置密码
* @param {[string]} obj.contact 手机号/邮箱
* @param {[string]} obj.code 验证码
* @param {[string]} obj.new_password 新的密码
* @param {[string]} obj.service 传当前域名
*/
resetPwd = (obj = {}) => this.post('/api/usercenter/user/update-pwd', obj, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } })
/**
* 个人信息 - 修改密码
* @param {[string]} obj.old_password 验证码
* @param {[string]} obj.new_password 新的密码
* @param {[string]} obj.service 传当前域名
*/
updatePwd = (obj = {}) => this.post('/api/usercenter/user/change-pwd-by-cookie', obj, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } })
/**
* 清空所有cookies
*/
clearCookies = (obj = {}) => this.post('https://learn-pbcsf.ezijing.com/api/clear/cookie', obj, { headers: { 'Content-Type': 'multipart/form-data' } })
}
/* Logo 字体 */
@font-face {
font-family: "iconfont logo";
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834');
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix') format('embedded-opentype'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') format('svg');
}
.logo {
font-family: "iconfont logo";
font-size: 160px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
/* tabs */
.nav-tabs {
position: relative;
}
.nav-tabs .nav-more {
position: absolute;
right: 0;
bottom: 0;
height: 42px;
line-height: 42px;
color: #666;
}
#tabs {
border-bottom: 1px solid #eee;
}
#tabs li {
cursor: pointer;
width: 100px;
height: 40px;
line-height: 40px;
text-align: center;
font-size: 16px;
border-bottom: 2px solid transparent;
position: relative;
z-index: 1;
margin-bottom: -1px;
color: #666;
}
#tabs .active {
border-bottom-color: #f00;
color: #222;
}
.tab-container .content {
display: none;
}
/* 页面布局 */
.main {
padding: 30px 100px;
width: 960px;
margin: 0 auto;
}
.main .logo {
color: #333;
text-align: left;
margin-bottom: 30px;
line-height: 1;
height: 110px;
margin-top: -50px;
overflow: hidden;
*zoom: 1;
}
.main .logo a {
font-size: 160px;
color: #333;
}
.helps {
margin-top: 40px;
}
.helps pre {
padding: 20px;
margin: 10px 0;
border: solid 1px #e7e1cd;
background-color: #fffdef;
overflow: auto;
}
.icon_lists {
width: 100% !important;
overflow: hidden;
*zoom: 1;
}
.icon_lists li {
width: 100px;
margin-bottom: 10px;
margin-right: 20px;
text-align: center;
list-style: none !important;
cursor: default;
}
.icon_lists li .code-name {
line-height: 1.2;
}
.icon_lists .icon {
display: block;
height: 100px;
line-height: 100px;
font-size: 42px;
margin: 10px auto;
color: #333;
-webkit-transition: font-size 0.25s linear, width 0.25s linear;
-moz-transition: font-size 0.25s linear, width 0.25s linear;
transition: font-size 0.25s linear, width 0.25s linear;
}
.icon_lists .icon:hover {
font-size: 100px;
}
.icon_lists .svg-icon {
/* 通过设置 font-size 来改变图标大小 */
width: 1em;
/* 图标和文字相邻时,垂直对齐 */
vertical-align: -0.15em;
/* 通过设置 color 来改变 SVG 的颜色/fill */
fill: currentColor;
/* path 和 stroke 溢出 viewBox 部分在 IE 下会显示
normalize.css 中也包含这行 */
overflow: hidden;
}
.icon_lists li .name,
.icon_lists li .code-name {
color: #666;
}
/* markdown 样式 */
.markdown {
color: #666;
font-size: 14px;
line-height: 1.8;
}
.highlight {
line-height: 1.5;
}
.markdown img {
vertical-align: middle;
max-width: 100%;
}
.markdown h1 {
color: #404040;
font-weight: 500;
line-height: 40px;
margin-bottom: 24px;
}
.markdown h2,
.markdown h3,
.markdown h4,
.markdown h5,
.markdown h6 {
color: #404040;
margin: 1.6em 0 0.6em 0;
font-weight: 500;
clear: both;
}
.markdown h1 {
font-size: 28px;
}
.markdown h2 {
font-size: 22px;
}
.markdown h3 {
font-size: 16px;
}
.markdown h4 {
font-size: 14px;
}
.markdown h5 {
font-size: 12px;
}
.markdown h6 {
font-size: 12px;
}
.markdown hr {
height: 1px;
border: 0;
background: #e9e9e9;
margin: 16px 0;
clear: both;
}
.markdown p {
margin: 1em 0;
}
.markdown>p,
.markdown>blockquote,
.markdown>.highlight,
.markdown>ol,
.markdown>ul {
width: 80%;
}
.markdown ul>li {
list-style: circle;
}
.markdown>ul li,
.markdown blockquote ul>li {
margin-left: 20px;
padding-left: 4px;
}
.markdown>ul li p,
.markdown>ol li p {
margin: 0.6em 0;
}
.markdown ol>li {
list-style: decimal;
}
.markdown>ol li,
.markdown blockquote ol>li {
margin-left: 20px;
padding-left: 4px;
}
.markdown code {
margin: 0 3px;
padding: 0 5px;
background: #eee;
border-radius: 3px;
}
.markdown strong,
.markdown b {
font-weight: 600;
}
.markdown>table {
border-collapse: collapse;
border-spacing: 0px;
empty-cells: show;
border: 1px solid #e9e9e9;
width: 95%;
margin-bottom: 24px;
}
.markdown>table th {
white-space: nowrap;
color: #333;
font-weight: 600;
}
.markdown>table th,
.markdown>table td {
border: 1px solid #e9e9e9;
padding: 8px 16px;
text-align: left;
}
.markdown>table th {
background: #F7F7F7;
}
.markdown blockquote {
font-size: 90%;
color: #999;
border-left: 4px solid #e9e9e9;
padding-left: 0.8em;
margin: 1em 0;
}
.markdown blockquote p {
margin: 0;
}
.markdown .anchor {
opacity: 0;
transition: opacity 0.3s ease;
margin-left: 8px;
}
.markdown .waiting {
color: #ccc;
}
.markdown h1:hover .anchor,
.markdown h2:hover .anchor,
.markdown h3:hover .anchor,
.markdown h4:hover .anchor,
.markdown h5:hover .anchor,
.markdown h6:hover .anchor {
opacity: 1;
display: inline-block;
}
.markdown>br,
.markdown>p>br {
clear: both;
}
.hljs {
display: block;
background: white;
padding: 0.5em;
color: #333333;
overflow-x: auto;
}
.hljs-comment,
.hljs-meta {
color: #969896;
}
.hljs-string,
.hljs-variable,
.hljs-template-variable,
.hljs-strong,
.hljs-emphasis,
.hljs-quote {
color: #df5000;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-type {
color: #a71d5d;
}
.hljs-literal,
.hljs-symbol,
.hljs-bullet,
.hljs-attribute {
color: #0086b3;
}
.hljs-section,
.hljs-name {
color: #63a35c;
}
.hljs-tag {
color: #333333;
}
.hljs-title,
.hljs-attr,
.hljs-selector-id,
.hljs-selector-class,
.hljs-selector-attr,
.hljs-selector-pseudo {
color: #795da3;
}
.hljs-addition {
color: #55a532;
background-color: #eaffea;
}
.hljs-deletion {
color: #bd2c00;
background-color: #ffecec;
}
.hljs-link {
text-decoration: underline;
}
/* 代码高亮 */
/* PrismJS 1.15.0
https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */
/**
* prism.js default theme for JavaScript, CSS and HTML
* Based on dabblet (http://dabblet.com)
* @author Lea Verou
*/
code[class*="language-"],
pre[class*="language-"] {
color: black;
background: none;
text-shadow: 0 1px white;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
pre[class*="language-"]::-moz-selection,
pre[class*="language-"] ::-moz-selection,
code[class*="language-"]::-moz-selection,
code[class*="language-"] ::-moz-selection {
text-shadow: none;
background: #b3d4fc;
}
pre[class*="language-"]::selection,
pre[class*="language-"] ::selection,
code[class*="language-"]::selection,
code[class*="language-"] ::selection {
text-shadow: none;
background: #b3d4fc;
}
@media print {
code[class*="language-"],
pre[class*="language-"] {
text-shadow: none;
}
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
}
:not(pre)>code[class*="language-"],
pre[class*="language-"] {
background: #f5f2f0;
}
/* Inline code */
:not(pre)>code[class*="language-"] {
padding: .1em;
border-radius: .3em;
white-space: normal;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: slategray;
}
.token.punctuation {
color: #999;
}
.namespace {
opacity: .7;
}
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
color: #905;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #690;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
color: #9a6e3a;
background: hsla(0, 0%, 100%, .5);
}
.token.atrule,
.token.attr-value,
.token.keyword {
color: #07a;
}
.token.function,
.token.class-name {
color: #DD4A68;
}
.token.regex,
.token.important,
.token.variable {
color: #e90;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}
@font-face {font-family: "selfAllIcon";
src: url('iconfont.eot?t=1585881159034'); /* IE9 */
src: url('iconfont.eot?t=1585881159034#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAABL0AAsAAAAAIaQAABKlAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCGbgqveKYIATYCJANsCzgABCAFhREHgjAbtBszklW6I2T/9YF2hIqL33pkZeskki0qilLMcBKOil5m0SeZ2bXQpTAk9sOChXc5QXbNHyzMt4dSElBrZc/SA2IIJSFbQAcsGYRNhA6r6NR+wMbfZM7MSjYFyZD2DCWE74FkFZDzsb723E8QaDnhIgSOwUl+oLn9u7vB7m7NqDh6GNDDROjZMN2MGrGNGGzOlWLMggkGYPcwMBKxAobO+kSahT+aNj8f+I8wTrukgusHSbdOCUpzRwpCLn5bKJADAASHdnWQilZqSn3/gSZZeXAttZcxyxLcWBhSJEWSYnIppJz/El1/dP1SbgDsK+RAjT8lvO/oXw5RKGA3IyeMnHB+8L/meJRLk9BHHfS6/Gds6YOrRTLHaX+rMWrrOxNQqtNYYV76snWKJZ5pQJNjBQd3K3ZkS0JmBsXpGTFgUh3uSBVHVyMbbsuvH/6ZHIqJpLHnHlcdmL/PrDx0aEEhsK00ifkJnAYixlgkRINkRegWG2SsNEopd+K/k3TzF1GeR4qUKFepRoMh4022ynrHXHDNbZ9GOpva3A795EEWc3TZivWrPXpgnq3BWONNfBk9ecWpq5r+H3k0qpSqVyuWKFOsSLVMgxIVInVqNGkWVGnRqlQ5IYPG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PpsfNQkGP+8gVyqZVQqHVI88ipKCRpRSqjw74dMTklPZVs2vB9IIAUxzYKmJuCqH8k9iEeyDBK4u6xjhCrgVI06F6EAiW211IrRkF6rXFe3ipqFGjo9grJ5dIJh/wUpsYwiHg5kiKuEV5uWvEcMozQvT5/JG0IimAIDXFAHIumsKTStuN6xiamZuYWllbWNrZ2owV2TAw5aMBOeyL43kc8jHqhAg8cnUWFAhsnbjz/ZCOKgaq4HUY4+BexZXXSOJ1wM6BVMsYOgWYW88zNW76delRi4uwujCN7dLq9zs2UO8XdZvX9/qucf5PSPXFdU5cBZrzBRrSvOjip2WDjNlU4wDTiQZEFEYRZQFtsWKib8KCVG4kKaDusOjytY4vEdgkAAA==') format('woff2'),
url('iconfont.woff?t=1585881159034') format('woff'),
url('iconfont.ttf?t=1585881159034') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
url('iconfont.svg?t=1585881159034#selfAllIcon') format('svg'); /* iOS 4.1- */
}
.selfAllIcon {
font-family: "selfAllIcon" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.el-icon-self-fankuiyijian:before {
content: "\e68f";
}
.el-icon-self-icon-test:before {
content: "\e655";
}
.el-icon-self-shipinjinzhi:before {
content: "\e60b";
}
.el-icon-self-shipinbofang:before {
content: "\e60c";
}
.el-icon-self-tuichu:before {
content: "\e606";
}
.el-icon-self-star_full:before {
content: "\e627";
}
.el-icon-self-wujiaoxing:before {
content: "\e614";
}
.el-icon-self-guanbi:before {
content: "\e611";
}
.el-icon-self-xuexiao:before {
content: "\e632";
}
.el-icon-self-quanping:before {
content: "\e743";
}
.el-icon-self-shipin:before {
content: "\e60e";
}
.el-icon-self-iconset0481:before {
content: "\e768";
}
.el-icon-self-wenjian:before {
content: "\e650";
}
.el-icon-self-PPT:before {
content: "\e602";
}
.el-icon-self-13:before {
content: "\e6ce";
}
.el-icon-self-cc-book:before {
content: "\e615";
}
.el-icon-self-grade:before {
content: "\e66c";
}
.el-icon-self-xuexi-:before {
content: "\e609";
}
.el-icon-self-nav:before {
content: "\e66b";
}
.el-icon-self-mima:before {
content: "\e607";
}
.el-icon-self-character:before {
content: "\e62e";
}
.el-icon-self-statistic:before {
content: "\e601";
}
.el-icon-self-discover:before {
content: "\e67e";
}
.el-icon-self-settings:before {
content: "\e68a";
}
.el-icon-self-new:before {
content: "\e71e";
}
.el-icon-self-album:before {
content: "\e734";
}
{
"id": "948269",
"name": "self-all",
"font_family": "selfAllIcon",
"css_prefix_text": "el-icon-self-",
"description": "所有外包项目,图标库",
"glyphs": [
{
"icon_id": "1546564",
"name": "反馈意见",
"font_class": "fankuiyijian",
"unicode": "e68f",
"unicode_decimal": 59023
},
{
"icon_id": "8777427",
"name": "help",
"font_class": "icon-test",
"unicode": "e655",
"unicode_decimal": 58965
},
{
"icon_id": "11720124",
"name": "视频禁止",
"font_class": "shipinjinzhi",
"unicode": "e60b",
"unicode_decimal": 58891
},
{
"icon_id": "11720125",
"name": "视频播放",
"font_class": "shipinbofang",
"unicode": "e60c",
"unicode_decimal": 58892
},
{
"icon_id": "11717677",
"name": "退出",
"font_class": "tuichu",
"unicode": "e606",
"unicode_decimal": 58886
},
{
"icon_id": "551615",
"name": "五角星",
"font_class": "star_full",
"unicode": "e627",
"unicode_decimal": 58919
},
{
"icon_id": "2681717",
"name": "五角星",
"font_class": "wujiaoxing",
"unicode": "e614",
"unicode_decimal": 58900
},
{
"icon_id": "632985",
"name": "关闭",
"font_class": "guanbi",
"unicode": "e611",
"unicode_decimal": 58897
},
{
"icon_id": "646387",
"name": "刷新",
"font_class": "xuexiao",
"unicode": "e632",
"unicode_decimal": 58930
},
{
"icon_id": "1010014",
"name": "全屏",
"font_class": "quanping",
"unicode": "e743",
"unicode_decimal": 59203
},
{
"icon_id": "2198788",
"name": "视频",
"font_class": "shipin",
"unicode": "e60e",
"unicode_decimal": 58894
},
{
"icon_id": "554517",
"name": "播放",
"font_class": "iconset0481",
"unicode": "e768",
"unicode_decimal": 59240
},
{
"icon_id": "4251768",
"name": "文件",
"font_class": "wenjian",
"unicode": "e650",
"unicode_decimal": 58960
},
{
"icon_id": "5620349",
"name": "PPT",
"font_class": "PPT",
"unicode": "e602",
"unicode_decimal": 58882
},
{
"icon_id": "720044",
"name": "image-o",
"font_class": "13",
"unicode": "e6ce",
"unicode_decimal": 59086
},
{
"icon_id": "372115",
"name": "cc-book",
"font_class": "cc-book",
"unicode": "e615",
"unicode_decimal": 58901
},
{
"icon_id": "938307",
"name": "Grade",
"font_class": "grade",
"unicode": "e66c",
"unicode_decimal": 58988
},
{
"icon_id": "4657687",
"name": "学习",
"font_class": "xuexi-",
"unicode": "e609",
"unicode_decimal": 58889
},
{
"icon_id": "1174321",
"name": "nav",
"font_class": "nav",
"unicode": "e66b",
"unicode_decimal": 58987
},
{
"icon_id": "1418216",
"name": "密码",
"font_class": "mima",
"unicode": "e607",
"unicode_decimal": 58887
},
{
"icon_id": "3090318",
"name": "人物",
"font_class": "character",
"unicode": "e62e",
"unicode_decimal": 58926
},
{
"icon_id": "6918240",
"name": "statistic",
"font_class": "statistic",
"unicode": "e601",
"unicode_decimal": 58881
},
{
"icon_id": "30446",
"name": "discover",
"font_class": "discover",
"unicode": "e67e",
"unicode_decimal": 59006
},
{
"icon_id": "30480",
"name": "settings",
"font_class": "settings",
"unicode": "e68a",
"unicode_decimal": 59018
},
{
"icon_id": "90850",
"name": "new",
"font_class": "new",
"unicode": "e71e",
"unicode_decimal": 59166
},
{
"icon_id": "151470",
"name": "album",
"font_class": "album",
"unicode": "e734",
"unicode_decimal": 59188
}
]
}
{
"LoginModule": {
"CodeLogin": {
"iphone": "Mobile Phone number",
"inputIphone": "Please enter Mobile Phone number",
"rightIphoneStr": "Please enter the right format Mobile Phone number",
"code": "SMS verification code",
"sendCode": "Send code",
"inputCode": "Please enter SMS verification code",
"afterMiniutes": "s before resend",
"isRemember": "Remember Me",
"submitbtn": "Log In"
},
"ForgetLogin": {
"step1": "Step 1",
"step2": "Step 2",
"step3": "Step 3",
"inputStr": "Please enter Register Mobile Phone number Or Mail",
"rightStr": "Please enter the right Format Mobile Phone number Or Mail",
"checkRightStr": "Please check whether the Mobile Phone number or Email",
"sendCode": "Send",
"codeSuccess": "The verification code has been successfully sent. No more then five times every day.",
"codeStr": "Code arrive to :",
"iphoneCode": "Iphone Code",
"mailCode": "Mail Code",
"input4Code": "Input Four Number Code",
"afterMiniutes": "s before resend",
"prev": "Prev",
"next": "Next",
"newPwd": "New Password",
"placeholder": "Please enter 6-20 letters, numbers and punctuation marks, not just numbers",
"repeatNewPwd": "Repeat New Password",
"repeatPlaceholder": "Please repeat enter new password",
"checkPwd": "Input twice is not same",
"finish": "Finish",
"tipStr": "Password set success",
"goLogin": "Log In"
},
"NormalLogin": {
"account": "Account",
"inputAccount": "Please enter Email or UserID",
"password": "Password",
"inputPassword": "Please enter Password",
"isRemember": "Remember Me",
"submitbtn": "Log In"
},
"Others": {
"noSysRole": "You do not have system permissions, please contact the system administrator",
"outloginStr": "The account has been signed out, please change the account",
"formCheckStr": "Please check",
"tip": "Tips",
"right": "Confirm"
}
}
}
import Cookies from 'js-cookie'
import VueI18n from 'vue-i18n'
import language from './language'
import zhCNLocale from 'element-ui/lib/locale/lang/zh-CN'
import enLocale from 'element-ui/lib/locale/lang/en'
export default () => {
let _locale = 'zh-CN'
/* 国际化初始化 */
const _defaultLocale = 'zh-CN'
const _lang = Cookies.get('lang') || window.navigator.language || window.navigator.userLanguage || ''
if (_lang) {
if (language[_lang]) {
_locale = _lang
} else {
let flag = true
/* 做一下 兼容性处理 */
for (const k in language) {
const reg = new RegExp(k, 'gi')
if (reg.test(_lang)) {
_locale = k
flag = false
break
}
}
if (flag) {
/* 当前语言版本 - 不再我们的语言库中,那么默认 en */
_locale = _defaultLocale
Cookies.set('lang', _defaultLocale, { expires: 30, domain: '.ezijing.com' })
}
}
}
return new VueI18n({
locale: _locale, // 定义默认语言为中文
messages: {
'zh-CN': Object.assign(require('./zh-CN.json'), zhCNLocale),
en: Object.assign(require('./en.json'), enLocale)
}
})
}
/* 定义语言模型 - key 值定义 跟 languages i18n 中 保持一致 */
const language = {
'zh-CN': { show: '语言', arr: [{ 'zh-CN': '中文' }, { en: 'English' }] },
en: { show: 'Language', arr: [{ 'zh-CN': '中文' }, { en: 'English' }] }
}
export default language
{
"LoginModule": {
"CodeLogin": {
"iphone": "手机号",
"inputIphone": "请输入手机号",
"rightIphoneStr": "请输入正确格式的手机号",
"code": "短信验证码",
"sendCode": "发送验证码",
"inputCode": "请输入短信验证码",
"afterMiniutes": "s后重发",
"isRemember": "记住我",
"submitbtn": "登录"
},
"ForgetLogin": {
"step1": "步骤1",
"step2": "步骤2",
"step3": "步骤3",
"inputStr": "请输入注册手机号/邮箱",
"rightStr": "请输入正确格式的手机号/邮箱",
"checkRightStr": "请检查手机号或邮箱是否输入正确",
"sendCode": "发送验证码",
"codeSuccess": "验证码已成功发送,请耐心等待。每天最高发送5次",
"codeStr": "验证码已发送至:",
"iphoneCode": "手机验证码",
"mailCode": "邮箱验证码",
"input4Code": "请输入4位验证码",
"afterMiniutes": "s后重发",
"prev": "上一步",
"next": "下一步",
"newPwd": "新密码",
"placeholder": "请输入6-20个字母、数字及标点符号,不可仅数字",
"repeatNewPwd": "重复新密码",
"repeatPlaceholder": "请重新输入新密码",
"checkPwd": "两次输入密码不一致",
"finish": "完成",
"tipStr": "密码设置成功",
"goLogin": "登 录"
},
"NormalLogin": {
"account": "账号",
"inputAccount": "请输入手机号",
"password": "密码",
"inputPassword": "请输入密码",
"isRemember": "记住我",
"submitbtn": "登录"
},
"Others": {
"noSysRole": "您当前没有系统权限,请联络系统管理员",
"outloginStr": "账号已退出,请更换账号",
"formCheckStr": "请根据输入框提示,检查输入项。",
"tip": "提示",
"right": "确定"
}
}
}
import './index.scss'
import NormalLogin from './src/NormalLogin.vue'
import CodeLogin from './src/CodeLogin.vue'
import ForgetLogin from './src/ForgetLogin.vue'
const components = [
NormalLogin,
CodeLogin,
ForgetLogin
]
const install = function (Vue, opts = {}) {
/* 存在国际化 */
if (opts.i18n) {
const msgs = opts.i18n.messages
for (const k in msgs) {
opts.i18n.setLocaleMessage(k, Object.assign(msgs[k], require('./assets/languages/' + k + '.json')))
}
}
components.forEach(component => {
Vue.component(component.name, component)
})
}
/* istanbul ignore if */
if (typeof window !== 'undefined' && window.Vue) {
install(window.Vue)
}
export default {
install,
NormalLogin,
CodeLogin,
ForgetLogin
}
/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575px) {}
/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767px) {}
/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991px) {}
/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199px) {}
/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {}
<template>
<el-form ref="setAccountform" :model="setAccount" :rules="accountRules">
<el-form-item prop="user">
<el-input class="self-input" v-model="setAccount.user" type="text" :placeholder="$t('LoginModule.CodeLogin.iphone')" @keyup.enter.native="onSubmitSetAccount">
</el-input>
</el-form-item>
<el-form-item prop="pwd" style="margin-bottom: 4px;">
<el-input v-model="setAccount.pwd" :disabled="isSendDisable" type="text" :placeholder="$t('LoginModule.CodeLogin.code')" @keyup.enter.native="onSubmitSetAccount">
<el-button slot="suffix" size="mini" :disabled="isSendDisable || isSendCode" @click="sendCode">{{sendBtnText}}</el-button>
</el-input>
</el-form-item>
<el-form-item prop="isRemember" style="margin-bottom: 0px; text-align: left;">
<el-checkbox v-model="setAccount.isRemember" :label="$t('LoginModule.NormalLogin.isRemember')" name="type"></el-checkbox>
</el-form-item>
<el-form-item>
<el-button type="primary" class="login-btn" @click="onSubmitSetAccount">{{$t('LoginModule.CodeLogin.submitbtn')}}</el-button>
</el-form-item>
<slot name="text"></slot>
</el-form>
</template>
<script>
import Login from '../action'
export default {
name: 'CodeLogin',
componentName: 'CodeLogin',
props: {
attr: {
type: Object,
required: false,
default () {
return {}
}
},
query: {
type: Object,
required: false,
default () {
return {}
}
}
},
data () {
/* 账号输入正确时,才能获取验证码 */
const checkAccount = (rule, value, callback) => {
/* 手机格式 */
if (/^1[3-9]\d{9}$/.test(value)) {
this.isSendDisable = false
callback()
} else {
this.isSendDisable = true
callback(new Error(this.$t('LoginModule.CodeLogin.rightIphoneStr')))
}
}
return {
isSendDisable: true, // 是否可以发送
isSendCode: false, // 是否已发送验证码
timeInterval: null, // 定时器,倒计时
sendBtnText: this.$t('LoginModule.CodeLogin.sendCode'), // 按钮 文字
setAccount: {},
accountRules: {
user: [
{ required: true, message: this.$t('LoginModule.CodeLogin.inputIphone'), trigger: 'blur' },
{ validator: checkAccount, trigger: 'change' }
],
pwd: [
{ required: true, message: this.$t('LoginModule.CodeLogin.inputCode'), trigger: 'blur' }
]
}
}
},
beforeDestroy () { /* 清空倒计时 */ this.clearTime() },
methods: {
/* 发送验证码 */
sendCode () {
if (!this.isSendCode) {
// const loading = this.$loading({ lock: true, text: '', spinner: '', background: 'rgba(255, 255, 255, 0.9)' })
Login.sendCode({
/* 老版发送验证码 */
mobile: this.setAccount.user,
/* 新版发送验证码 */
account: this.setAccount.user
}).then(res => {
/* 发送验证码不管是否成功,都开始倒计时 */
let time = 60
this.isSendCode = true
this.sendBtnText = '60' + this.$t('LoginModule.CodeLogin.afterMiniutes')
this.timeInterval = setInterval(() => {
if (time-- > 0) {
this.sendBtnText = time + this.$t('LoginModule.CodeLogin.afterMiniutes')
} else {
this.isSendCode = false
this.sendBtnText = this.$t('LoginModule.CodeLogin.sendCode')
clearInterval(this.timeInterval)
}
}, 1000)
}).catch(error => {
this.$message.error(error.message)
})
}
},
/* 清空倒计时 */
clearTime () {
this.isSendCode = true
this.sendBtnText = this.$t('LoginModule.CodeLogin.sendCode')
clearInterval(this.timeInterval)
},
onSubmitSetAccount () {
this.$refs.setAccountform.validate((valid) => {
if (valid) {
Login.codeLogin({
/* 新版 */
account: this.setAccount.user,
password: this.setAccount.pwd,
type: 2,
RememberMe: this.setAccount.isRemember ? 'true' : 'false',
service: window.location.origin
}).then(data => {
if (data.code !== 0) { return }
if (data.url) {
/* 查询上次跳转信息,并跳转回去 */
if (this.query.rd) {
window.location.href = data.url + decodeURIComponent(this.query.rd)
} else {
window.location.href = data.url
}
} else {
this.$alert(this.$t('LoginModule.Others.noSysRole'), this.$t('LoginModule.Others.tip'), {
confirmButtonText: this.$t('LoginModule.Others.right'),
callback: action => {
Login.outLogin().then(res => {
this.$message({
type: 'info',
message: this.$t('LoginModule.Others.outloginStr')
})
})
}
})
}
}).catch(error => {
this.$message.error(error.message)
})
} else {
this.$message.error(this.$t('LoginModule.Others.formCheckStr'))
return false
}
})
}
}
}
</script>
<style lang="scss" scoped>
.login-btn { margin-top: 0; width: 100%; }
</style>
<template>
<div class="content-s">
<div class="step3">
<el-form ref="form3" label-width="100px" :model="accountSet" :rules="accountRules" label-position="top">
<el-row type="flex" class="row-bg" justify="center">
<el-col :xs="24" :md="10">
<el-form-item prop="account" :label="$t('LoginModule.NormalLogin.account')">
<el-input v-model="accountSet.account" type="text" :placeholder="$t('LoginModule.ForgetLogin.inputStr')"></el-input>
</el-form-item>
<el-form-item prop="code" :label="(accountSet.type ? $t('LoginModule.ForgetLogin.mailCode') : $t('LoginModule.ForgetLogin.iphoneCode'))">
<el-input v-model="accountSet.code" type="text" :placeholder="$t('LoginModule.ForgetLogin.input4Code')">
<el-button slot="append" type="primary" @click="sendCode">{{sendBtnText}}</el-button>
</el-input>
</el-form-item>
<el-form-item prop="newpwd" :label="$t('LoginModule.ForgetLogin.newPwd')">
<el-input v-model="accountSet.newpwd" type="password" :placeholder="$t('LoginModule.ForgetLogin.placeholder')"></el-input>
</el-form-item>
<el-form-item prop="repwd" :label="$t('LoginModule.ForgetLogin.repeatNewPwd')">
<el-input v-model="accountSet.repwd" type="password" :placeholder="$t('LoginModule.ForgetLogin.repeatPlaceholder')"></el-input>
</el-form-item>
<el-form-item>
<el-button style="width: 100%;" type="primary" @click="onSubmitForm">{{$t('LoginModule.ForgetLogin.finish')}}</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<slot name="go-back"></slot>
</div>
<el-dialog
title=""
:visible.sync="centerDialogVisible"
width="30%"
center append-to-body>
<i class="el-icon-success" style="display: block; font-size: 0.6rem; text-align: center; color: #67c23a;"></i>
<span style="display: block; margin-top: 0.2rem; text-align: center;">{{$t('LoginModule.ForgetLogin.tipStr')}}</span>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="goLogin">{{$t('LoginModule.ForgetLogin.goLogin')}}</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import Login from '../action'
export default {
name: 'ForgetLogin',
componentName: 'ForgetLogin',
props: {
attr: {
type: Object,
required: false,
default () {
return {}
}
},
query: {
type: Object,
required: false,
default () {
return {}
}
}
},
data () {
/* 检查账号格式 */
const checkAccount = (rule, value, callback) => {
if (!/^(1[3-9]\d{9}|[\w\.]+@\w+(\.\w+)+)$/.test(value)) { // eslint-disable-line
callback(new Error(this.$t('LoginModule.ForgetLogin.rightStr')))
} else {
/* 手机格式 */
if (/^(1[3-9]\d{9}$)/.test(value)) {
this.accountSet.type = 0
}
/* 邮箱格式 */
if (/^([\w\.]+@\w+(\.\w+)+)/.test(value)) { // eslint-disable-line
this.accountSet.type = 1
}
callback()
}
}
/* 检查密码 */
const checkPwd = (rule, value, callback) => {
if (value === this.accountSet.newpwd) {
callback()
} else {
callback(new Error(this.$t('LoginModule.ForgetLogin.checkPwd')))
}
}
return {
isSendCode: false, // 是否已发送验证码
timeInterval: null, // 定时器,倒计时
sendBtnText: this.$t('LoginModule.ForgetLogin.sendCode'), // 按钮 文字
accountSet: {
type: 0, // 0:表示手机格式,1:表示邮箱格式
account: '',
code: ''
},
accountRules: {
account: [
{ required: true, message: this.$t('LoginModule.ForgetLogin.inputStr'), trigger: 'blur' },
{ validator: checkAccount, trigger: 'change' }
],
code: [
{ required: true, message: this.$t('LoginModule.ForgetLogin.input4Code'), trigger: 'blur' },
{ pattern: /^(\d{4})$/, message: this.$t('LoginModule.ForgetLogin.input4Code'), trigger: 'change' }
],
newpwd: [
{ required: true, message: this.$t('LoginModule.ForgetLogin.newPwd'), trigger: 'blur' },
{ pattern: /^.*[^\d]+.*$/, message: this.$t('LoginModule.ForgetLogin.placeholder'), trigger: 'blur' }
],
repwd: [
{ required: true, message: this.$t('LoginModule.ForgetLogin.repeatPlaceholder'), trigger: 'blur' },
{ validator: checkPwd, trigger: 'change' }
]
},
centerDialogVisible: false // 修改密码成功弹框
}
},
beforeDestroy () { /* 清空倒计时 */ this.clearTime() },
methods: {
/* 发送验证码 */
sendCode () {
if (!this.isSendCode) {
Login.sendResetPwdCode({ account: this.accountSet.account }).then(res => {
if (res.code === 0) {
/* 发送验证码不管是否成功,都开始倒计时 */
let time = 60
this.isSendCode = true
this.sendBtnText = '60' + this.$t('LoginModule.ForgetLogin.afterMiniutes')
this.timeInterval = setInterval(() => {
if (time-- > 0) {
this.sendBtnText = time + this.$t('LoginModule.ForgetLogin.afterMiniutes')
} else {
this.isSendCode = false
this.sendBtnText = this.$t('LoginModule.ForgetLogin.sendCode')
clearInterval(this.timeInterval)
}
}, 1000)
this.$message({
type: 'success',
message: this.$t('LoginModule.ForgetLogin.codeSuccess'),
duration: 10000
})
} else {
return new Error(JSON.stringify(res))
}
})
}
},
/* 清空倒计时 */
clearTime () {
this.isSendCode = false
this.sendBtnText = this.$t('LoginModule.ForgetLogin.sendCode')
clearInterval(this.timeInterval)
},
/* 第三步 提交 */
onSubmitForm () {
this.$refs.form3.validate((valid) => {
if (valid) {
Login.resetPwd({
account: this.accountSet.account,
code: this.accountSet.code,
password: this.accountSet.newpwd,
passwordR: this.accountSet.repwd
}).then(data => {
if (data.code === 0) {
this.centerDialogVisible = true
} else {
return new Error(JSON.stringify(data))
}
})
} else {
this.$message.error(this.$t('LoginModule.Others.formCheckStr'))
return false
}
})
},
/**
* 关闭弹框时,跳转 登录页
*/
goLogin () {
this.centerDialogVisible = false
/* 跳转到 登录 */
this.$router.push({ path: '/login/index' })
}
}
}
</script>
<style lang="scss" scoped>
.content-s {
position: absolute;
left: 50%;
top: 22%;
padding: 20px 0;
width: calc(100% - 20px);
max-width: 1000px;
box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.3);
transform: translateX(-50%);
background: #fff;
}
/* forget 登录 */
.step1 { font-size: 16px; width: 90%; margin: 20px auto 0 auto; }
.step2 { font-size: 16px; width: 71%; margin: 20px auto 0 auto; }
.step2 .txt-title { margin-bottom: 0.3rem; color: #999; text-align: center; }
.step2 .operate { margin-top: 0.2rem; }
.step3 { font-size: 16px; margin: 10px 20px 0; text-align: left;}
::v-deep .el-form-item__label{ line-height:1; }
</style>
<template>
<el-form ref="setAccountform" :model="setAccount" :rules="accountRules">
<el-form-item prop="user">
<el-input class="self-input" v-model="setAccount.user" type="text" :placeholder="$t('LoginModule.NormalLogin.account')" @keyup.enter.native="onSubmitSetAccount">
<i slot="prefix" class="el-input__icon el-icon-self-character"></i>
</el-input>
</el-form-item>
<el-form-item prop="pwd" style="margin-bottom: 4px;">
<el-input v-model="setAccount.pwd" type="password" :placeholder="$t('LoginModule.NormalLogin.password')" @keyup.enter.native="onSubmitSetAccount">
<i slot="prefix" class="el-input__icon el-icon-self-mima"></i>
</el-input>
</el-form-item>
<el-form-item prop="isRemember" style="margin-bottom: 0px; text-align: left;">
<el-checkbox v-model="setAccount.isRemember" :label="$t('LoginModule.NormalLogin.isRemember')" name="type"></el-checkbox>
</el-form-item>
<el-form-item>
<el-button type="primary" class="login-btn" @click="onSubmitSetAccount">{{$t('LoginModule.NormalLogin.submitbtn')}}</el-button>
</el-form-item>
<slot name="text"></slot>
</el-form>
</template>
<script>
import Login from '../action'
export default {
name: 'NormalLogin',
componentName: 'NormalLogin',
props: {
attr: {
type: Object,
required: false,
default () {
return {}
}
},
query: {
type: Object,
required: false,
default () {
return {}
}
}
},
data () {
return {
// rememberMe:
setAccount: {},
accountRules: {
user: [
{ required: true, message: this.$t('LoginModule.NormalLogin.inputAccount'), trigger: 'blur' }
// { pattern: /^(1[3-9]\d{9}|[\w\.]+@\w+(\.\w+)+)$/, message: '请输入正确格式的手机号/邮箱', trigger: 'change' } // eslint-disable-line
],
pwd: [
{ required: true, message: this.$t('LoginModule.NormalLogin.inputPassword'), trigger: 'blur' }
]
}
}
},
mounted () {
// Login.clearCookies({}).then(res => res)
},
methods: {
onSubmitSetAccount () {
this.$refs.setAccountform.validate((valid) => {
if (valid) {
Login.userLogin({
/* 老版登录 */
// login_name: this.setAccount.user,
// password: md5('uokoaduw' + this.setAccount.pwd.split('').reverse().join('') + 'auhgniq'),
/* 新版登录 */
account: this.setAccount.user,
password: this.setAccount.pwd,
type: 1,
RememberMe: this.setAccount.isRemember ? 'true' : 'false',
service: window.location.origin
}).then(res => {
if (res.code !== 0) { return }
if (this.attr.url) {
window.location.href = this.attr.url
return
}
if (res.url) {
/* 查询上次跳转信息,并跳转回去 */
if (this.query.rd) {
window.location.href = res.url + decodeURIComponent(this.query.rd)
} else {
window.location.href = res.url
}
} else {
this.$alert(this.$t('LoginModule.Others.noSysRole'), this.$t('LoginModule.Others.tip'), {
confirmButtonText: this.$t('LoginModule.Others.right'),
callback: action => {
Login.outLogin().then(res => {
this.$message({
type: 'info',
message: this.$t('LoginModule.Others.outloginStr')
})
})
}
})
}
/* 重置账号、密码 */
// this.$refs['setAccountform'].resetFields()
}).catch(e => {
this.$message({
type: 'error',
message: e.message
})
})
} else {
this.$message.error(this.$t('LoginModule.Others.formCheckStr'))
return false
}
})
}
}
}
</script>
<style lang="scss" scoped>
.login-btn { margin-top: 0; width: 100%; }
</style>
<template>
<div class="p-con">
<div class="hd">
<img src="@/assets/images/logo.png" alt="logo">
<div class="txt">在线学习系统</div>
<!-- <s-language></s-language> -->
</div>
<div class="bd">
<div class="top50 container">
<el-row>
<el-col :xs="2" :sm="7" :md="3" :lg="3" :xl="3"><div style="height: 1px;"></div></el-col>
<el-col class="hidden-xs-only hidden-sm-only" :md="10" :lg="10" :xl="10">
<img src="@/assets/images/login-left-bg.png" alt="左侧-sofia logo">
</el-col>
<el-col :xs="20" :sm="10" :md="6" :lg="6" :xl="6">
<code-login>
<div class="text" slot="text">
<span class="code-login">
<template v-if="query.rd">
<router-link class="router-link-class" active-class="router-link-active-class" :to="{ path: '/login/index?rd=' + query.rd }">{{$t('Login.normalLogin')}}</router-link>
</template>
<template v-else>
<router-link class="router-link-class" active-class="router-link-active-class" :to="{ name: 'login-normal' }">{{$t('Login.normalLogin')}}</router-link>
</template>
</span>
<span class="forget-pwd">
<template v-if="query.rd">
<router-link class="router-link-class" active-class="router-link-active-class" :to="{ path: '/login/forget?rd=' + query.rd }">{{$t('Login.forgetPassword')}}</router-link>
</template>
<template v-else>
<router-link class="router-link-class" active-class="router-link-active-class" :to="{ name: 'login-forget' }">{{$t('Login.forgetPassword')}}</router-link>
</template>
<!-- <div class="router-link-class" @click="dialogMsg">{{$t('Login.forgetPassword')}}</div> -->
</span>
</div>
</code-login>
</el-col>
<el-col :xs="2" :sm="7" :md="5" :lg="5" :xl="5"><div style="height: 1px;"></div></el-col>
</el-row>
</div>
</div>
<div class="ft">
<div class="num">学习平台服务电话:010-62793299</div>
<div class="time">服务时间:9:00-18:00</div>
<div class="txt">Copyright © 2017 Zijing Education. All rights reserved. 清控紫荆(北京)教育科技股份有限公司 京ICP证150431号 京公网安备 11010802023681号</div>
</div>
</div>
</template>
<script>
import sLanguage from '@/components/languageSwitch/index.vue'
export default {
components: { sLanguage },
props: {
params: { type: Object, required: false, default () { return {} } },
query: { type: Object, required: false, default () { return {} } }
},
data () {
return {}
},
metaInfo () {
return {
title: this.$t('Login.title'),
meta: []
}
},
mounted () {},
methods: {
dialogMsg () {
this.$message({
type: 'success',
message: this.$t('Login.findPwdStr')
})
}
}
}
</script>
<style lang="scss" scoped>
.p-con { position: relative; width: 100%; height: 100%; background: #981838; color: #535353; text-align: center; }
/* 头部 */
.p-con .hd { position: absolute; top: 0; left: 0; right: 0; background: #ffffff; }
.p-con .hd img { display: block; margin: 0 auto; padding: 0.3rem 0 0.1rem 0; }
.p-con .hd .txt { margin: 0 auto; padding: 0 0 0.2rem 0; letter-spacing: 0.05rem; font-size: 0.32rem; font-weight: 700; }
/* 底部 */
.p-con .ft { position: fixed; bottom: 0; left: 0; right: 0; padding: 0.4rem 0 0.1rem 0; background: #e5e5e5; }
.p-con .ft .num { font-size: 0.14rem; line-height: 1.5; }
.p-con .ft .time { font-size: 0.14rem; line-height: 1.5; }
.p-con .ft .txt { padding: 0.1rem; color: #898989; font-size: 0.12rem; line-height: 1.5; }
/* 中间部分 */
.p-con .bd { position: relative; padding: 1.45rem 0 1.3rem 0; margin: 0 auto; height: 100%; min-height: 6rem; box-sizing: border-box; }
.p-con .bd .router-link-class { color: #ffffff; text-decoration: none; }
/* code 登录 */
.p-con .bd .top50 { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.p-con .bd .top50 img { display: block; margin: 0 auto; }
.p-con .bd .top50 .login-btn { margin-top: 0.1rem; background: #ffffff; border-color: #ffffff; color: #000; width: 100%; }
.p-con .bd .top50 .text { margin-top: -16px; color: #e5e5e5; font-size: 16px; line-height: 1.5; overflow: hidden; }
.p-con .bd .top50 .text .code-login { float: left; cursor: pointer; }
.p-con .bd .top50 .text .forget-pwd { float: right; cursor: pointer; }
/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575px) { .container { position: relative; margin: 0 auto; width: 100%; } }
/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767px) { .container { position: relative; margin: 0 auto; width: 576px; } }
/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991px) { .container { position: relative; margin: 0 auto; width: 768px; } }
/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199px) { .container { position: relative; margin: 0 auto; width: 992px; } }
/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) { .container { position: relative; margin: 0 auto; width: 1200px; } }
</style>
<template>
<div class="p-con">
<div class="hd">
<img src="@/assets/images/logo.png" alt="logo">
<div class="txt">在线学习系统</div>
</div>
<div class="bd">
<div class="top50 container">
<forget-login class="content-s-self">
<div class="go-back" slot="go-back">
<template v-if="query.rd">
<router-link class="router-link-class" style="color: #000;" active-class="router-link-active-class" :to="{ path: '/login/index?rd=' + query.rd }">返回登录</router-link>
</template>
<template v-else>
<router-link class="router-link-class" style="color: #000;" active-class="router-link-active-class" :to="{ name: 'login-normal' }">返回登录</router-link>
</template>
</div>
</forget-login>
</div>
</div>
<div class="ft">
<div class="num">学习平台服务电话:010-62793299</div>
<div class="time">服务时间:9:00-18:00</div>
<div class="txt">Copyright © 2017 Zijing Education. All rights reserved. 清控紫荆(北京)教育科技股份有限公司 京ICP证150431号 京公网安备 11010802023681号</div>
</div>
</div>
</template>
<script>
import sLanguage from '@/components/languageSwitch/index.vue'
export default {
components: { sLanguage },
props: {
params: { type: Object, required: false, default () { return {} } },
query: { type: Object, required: false, default () { return {} } }
},
data () {
return {}
},
metaInfo () {
return {
title: this.$t('Login.title'),
meta: []
}
},
mounted () {},
methods: {
dialogMsg () {
this.$message({
type: 'success',
message: this.$t('Login.findPwdStr')
})
}
}
}
</script>
<style lang="scss" scoped>
.p-con { position: relative; width: 100%; height: 100%; background: #981838; color: #535353; text-align: center; }
/* 头部 */
.p-con .hd { position: absolute; top: 0; left: 0; right: 0; background: #ffffff; }
.p-con .hd img { display: block; margin: 0 auto; padding: 0.3rem 0 0.1rem 0; }
.p-con .hd .txt { margin: 0 auto; padding: 0 0 0.2rem 0; letter-spacing: 0.05rem; font-size: 0.32rem; font-weight: 700; }
/* 底部 */
.p-con .ft { position: fixed; bottom: 0; left: 0; right: 0; padding: 0.4rem 0 0.1rem 0; background: #e5e5e5; }
.p-con .ft .num { font-size: 0.14rem; line-height: 1.5; }
.p-con .ft .time { font-size: 0.14rem; line-height: 1.5; }
.p-con .ft .txt { padding: 0.1rem; color: #898989; font-size: 0.12rem; line-height: 1.5; }
/* 中间部分 */
.p-con .bd { position: relative; padding: 1.45rem 0 1.3rem 0; margin: 0 auto; height: 100%; min-height: 6rem; box-sizing: border-box; }
.p-con .bd .router-link-class { color: #ffffff; text-decoration: none; }
/* forget 登录 */
.content-s-self { top: 50%; transform: translate(-50%, -50%); }
.go-back { margin-top: 0.2rem; text-align: left; }
/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575px) { .container { position: relative; margin: 0 auto; width: 100%; height: 100%; } }
/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767px) { .container { position: relative; margin: 0 auto; width: 576px; height: 100%; } }
/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991px) { .container { position: relative; margin: 0 auto; width: 768px; height: 100%; } }
/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199px) { .container { position: relative; margin: 0 auto; width: 992px; height: 100%; } }
/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) { .container { position: relative; margin: 0 auto; width: 1200px; height: 100%; } }
</style>
<template>
<div class="p-con">
<div class="hd">
<img src="@/assets/images/logo.png" alt="logo">
<div class="txt">在线学习系统</div>
<!-- <s-language></s-language> -->
</div>
<div class="bd">
<div class="top50 container">
<el-row>
<el-col :xs="2" :sm="7" :md="3" :lg="3" :xl="3"><div style="height: 1px;"></div></el-col>
<el-col class="hidden-xs-only hidden-sm-only" :md="10" :lg="10" :xl="10">
<img src="@/assets/images/login-left-bg.png" alt="左侧-sofia logo">
</el-col>
<el-col :xs="20" :sm="10" :md="6" :lg="6" :xl="6">
<normal-login>
<div class="text" slot="text">
<span class="code-login">
<template v-if="query.rd">
<router-link class="router-link-class" active-class="router-link-active-class" :to="{ path: '/login/code?rd=' + query.rd }">{{$t('Login.codeLogin')}}</router-link>
</template>
<template v-else>
<router-link class="router-link-class" active-class="router-link-active-class" :to="{ name: 'login-code' }">{{$t('Login.codeLogin')}}</router-link>
</template>
</span>
<span class="forget-pwd">
<template v-if="query.rd">
<router-link class="router-link-class" active-class="router-link-active-class" :to="{ path: '/login/forget?rd=' + query.rd }">{{$t('Login.forgetPassword')}}</router-link>
</template>
<template v-else>
<router-link class="router-link-class" active-class="router-link-active-class" :to="{ name: 'login-forget' }">{{$t('Login.forgetPassword')}}</router-link>
</template>
<!-- <div class="router-link-class" @click="dialogMsg">{{$t('Login.forgetPassword')}}</div> -->
</span>
</div>
</normal-login>
</el-col>
<el-col :xs="2" :sm="7" :md="5" :lg="5" :xl="5"><div style="height: 1px;"></div></el-col>
</el-row>
</div>
</div>
<div class="ft">
<div class="num">学习平台服务电话:010-62793299</div>
<div class="time">服务时间:9:00-18:00</div>
<div class="txt">Copyright © 2017 Zijing Education. All rights reserved. 清控紫荆(北京)教育科技股份有限公司 京ICP证150431号 京公网安备 11010802023681号</div>
</div>
</div>
</template>
<script>
import sLanguage from '@/components/languageSwitch/index.vue'
export default {
components: { sLanguage },
props: {
params: { type: Object, required: false, default () { return {} } },
query: { type: Object, required: false, default () { return {} } }
},
data () {
return {}
},
metaInfo () {
return {
title: this.$t('Login.title'),
meta: []
}
},
mounted () {},
methods: {
dialogMsg () {
this.$message({
type: 'success',
message: this.$t('Login.findPwdStr')
})
}
}
}
</script>
<style lang="scss" scoped>
.p-con { position: relative; width: 100%; height: 100%; background: #981838; color: #535353; text-align: center; }
/* 头部 */
.p-con .hd { position: absolute; top: 0; left: 0; right: 0; background: #ffffff; }
.p-con .hd img { display: block; margin: 0 auto; padding: 0.3rem 0 0.1rem 0; }
.p-con .hd .txt { margin: 0 auto; padding: 0 0 0.2rem 0; letter-spacing: 0.05rem; font-size: 0.32rem; font-weight: 700; }
/* 底部 */
.p-con .ft { position: fixed; bottom: 0; left: 0; right: 0; padding: 0.4rem 0 0.1rem 0; background: #e5e5e5; }
.p-con .ft .num { font-size: 0.14rem; line-height: 1.5; }
.p-con .ft .time { font-size: 0.14rem; line-height: 1.5; }
.p-con .ft .txt { padding: 0.1rem; color: #898989; font-size: 0.12rem; line-height: 1.5; }
/* 中间部分 */
.p-con .bd { position: relative; padding: 1.45rem 0 1.3rem 0; margin: 0 auto; height: 100%; min-height: 6rem; box-sizing: border-box; }
.p-con .bd .router-link-class { color: #ffffff; text-decoration: none; }
/* normal 登录 */
.p-con .bd .top50 { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.p-con .bd .top50 img { display: block; margin: 0 auto; }
.p-con .bd .top50 .login-btn { margin-top: 0.1rem; background: #ffffff; border-color: #ffffff; color: #000; width: 100%; }
.p-con .bd .top50 .text { margin-top: -16px; color: #e5e5e5; font-size: 16px; line-height: 1.5; overflow: hidden; }
.p-con .bd .top50 .text .code-login { float: left; cursor: pointer; }
.p-con .bd .top50 .text .forget-pwd { float: right; cursor: pointer; }
/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575px) { .container { position: relative; margin: 0 auto; width: 100%; } }
/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767px) { .container { position: relative; margin: 0 auto; width: 576px; } }
/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991px) { .container { position: relative; margin: 0 auto; width: 768px; } }
/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199px) { .container { position: relative; margin: 0 auto; width: 992px; } }
/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) { .container { position: relative; margin: 0 auto; width: 1200px; } }
</style>
<template>
<div class="play-paper">
<div class="play-paper-body">
<div class="play-paper-title">
<div>
<h3>{{chapterName}}</h3>
</div>
</div>
<div class="play-paper-content">
<ul class="play-read-files">
<li>
<a
:href="chapterRead.reading_attachment"
target="_blank"
v-html="chapterRead.reading_content"
>{{chapterRead.reading_content}}</a>
</li>
</ul>
</div>
</div>
</div>
</template>
<script>
export default {
props: {
chapterRead: { type: Object, require: false },
chapterName: { type: String, require: false }
}
}
</script>
<style scoped>
::v-deep p {
margin: 0;
}
</style>
<template>
<div class="play-ppt" ref="wrap">
<template v-if="ppts.length">
<div class="play-preview" ref="preview">
<template v-if="ppts[state.index] && ppts[state.index].ppt_url">
<img :src="ppts[state.index].ppt_url" class="play-ppt-img" style='vertical-align: middle' />
</template>
</div>
<div class="play-controls cl">
<div style="float: left;">
<template v-if="state.index >= 0">
<a href="#" @click="prev" style='margin: 0 20px 0 0; color: #fff;'><i class="el-icon-arrow-left"></i></a>
</template>
<template v-if="state.index + 1 < ppts.length">
<a href="#" @click="next"><i class="el-icon-arrow-right" style="color: #fff;"></i></a>
</template>
</div>
<div class="play-page">
<span class="play-now">{{state.index + 1}}</span>
/
<span class="play-total">{{ppts.length}}</span>
</div>
<div class="play-amazing">
<i :class="['el-icon-self-xuexiao', (state.sync ? 'active' : '')]" @click="onToggleSync"></i>
<i class="el-icon-self-quanping" @click="() => { this.$emit('onPptOnly') }"></i>
<i class="el-icon-self-shipin" @click="onSetVideoTime"></i>
<i class="el-icon-self-guanbi" @click="() => { this.$emit('onClose') }"></i>
</div>
</div>
</template>
</div>
</template>
<script>
/**
* ppt播放框
* 如果同步显示,则同步props.currentIndex到state.index,否则,仅使用state.index
*/
export default {
props: {
ppts: { type: Array, require: false },
currentIndex: { type: Number, require: false, default: 0 }
},
data () {
return {
state: {
index: this.currentIndex, // ppt展示序号
sync: true // 视频播放时,同步调整ppt展示
}
}
},
watch: {
currentIndex: {
handler () {
if (this.state.sync) {
this.state.index = this.currentIndex
}
}
}
},
methods: {
gotoIndex (index) {
this.state.index = index
},
getIndex (index) {
return Math.min(this.ppts.length - 1, Math.max(0, index))
},
prev (e) {
this.state.index = this.getIndex(this.state.index - 1)
this.state.sync = false
},
next (e) {
this.state.index = this.getIndex(this.state.index + 1)
this.state.sync = false
},
onToggleSync (e) {
this.state.sync = !this.state.sync
this.state.index = this.state.sync ? this.currentIndex : this.state.index
},
onSetVideoTime (e) {
this.$emit('onVideoSyncTime', this.ppts[this.state.index].ppt_point)
},
setSize (w, h) {
this.$refs.wrap.style.width = w + 'px'
this.$refs.wrap.style.height = h + 'px'
this.$refs.preview.style.lineHeight = (h - 44) + 'px'
}
}
}
</script>
<template>
<div id="playerWrap">
<div id="player">
<p>您还没有安装flash播放器,请 <a href="http://www.adobe.com/go/getflash" target="_blank">点击这里安装</a></p>
</div>
</div>
</template>
<style lang="scss" scoped>
#player p { color: #fff; text-align: center; padding: 50px 0; }
#player p a { color: #b01c40; text-decoration: underline; }
</style>
<script>
import swfobject from 'VideoJs'
// 播放器ID
const PLAYER_WRAP_ID = 'playerWrap'
const PLAYER_ID = 'player'
const SKIP_BEGIN_TIME = 7 // 跳过片头设置片头时间
let continueStart = 0 // 继续学习初始值
export default {
props: {
lastTime: { type: Number, require: false },
videoId: { type: String, require: false },
width: { type: Number, require: false },
height: { type: Number, require: false },
username: { type: String, require: false },
videoSrt: { type: String, require: false },
autoPlay: { type: Boolean, require: false, default: true },
chapterVideo: { type: Object, require: false }
},
mounted () {
this.definWindowFun()
// console.log(PLAYER_ID, this.videoId, this.autoPlay, this.videoSrt, this.username, this.width, this.height)
// this.renderPlayer(PLAYER_ID, this.videoId, this.autoPlay, this.videoSrt, this.username, this.width, this.height)
},
watch: {
videoId: {
handler () {
if (this.videoId) {
/* 注意 flash 初始化时,需要页面DOM存在 + videoId存在 */
continueStart = this.lastTime || 0 // 如果传递有上次播放时间,则记录缓存,以便player.start时使用
this.renderPlayer(PLAYER_ID, this.videoId, this.autoPlay, this.videoSrt, this.username, this.width, this.height)
}
}
}
},
methods: {
/* 定义windows下,播放事件和初始化回调 */
definWindowFun () {
const that = this
// 开始播放,如果设置了跳过片头则设置播放时间
window._playerStart = function () {
if (/skip=1/.test(document.cookie)) {
that.getPlayer().callAction('setCurrentTime', Math.max(continueStart, SKIP_BEGIN_TIME)) // 跳到第6秒开始播放
} else if (continueStart) {
that.getPlayer().callAction('setCurrentTime', continueStart)
}
}
// 播放过程中不断触发,传递当前播放到的时间
window._playerIng = function (time) {
$('#' + PLAYER_WRAP_ID).trigger('player.time', { time, duration: that.getPlayer().callAction('getDuration'), quality: that.getPlayer().callAction('getQuality'), isSeek: false })
}
// 拖动播放进度条
window._playerSeek = function () {
$('#' + PLAYER_WRAP_ID).trigger('player.seek', { time: that.getPlayer().callAction('getCurrentTime'), duration: that.getPlayer().callAction('getDuration'), quality: that.getPlayer().callAction('getQuality'), isSeek: true })
}
// 视频播放结束
window._playerFinish = function () {
that.$emit('handlePlayfinish', { time: that.getPlayer().callAction('getDuration') })
}
// 播放控件 - 初始化完成时,注册播放事件
window._playerCallback = function () {
const player = that.getPlayer()
if (player) {
// player.register('onLoadStart', '') // 开始loading加载
player.callAction('register', 'onCanplay', '_playerStart') // 开始播放视频内容
player.callAction('register', 'onPlaying', '_playerIng') // 播放中触发,300ms一次
// player.register('onPause', '') // 暂停
// player.register('onResume', '') // 恢复播放
player.callAction('register', 'onSeekComplete', '_playerSeek') // 拖动进度条
player.callAction('register', 'onEnded', '_playerFinish') // 结束
}
}
},
/* flash swf视频 对象渲染 采用 VideoJs插件渲染 */
renderPlayer (domId, vid, autoPlay, srt, username, width, height) {
autoPlay = typeof autoPlay === 'undefined' ? 1 : autoPlay - 0
// For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection.
const swfVersionStr = '11.1.0'
// To use express install, set to playerProductInstall.swf, otherwise the empty string.
const xiSwfUrlStr = 'playerProductInstall.swf'
const flashvars = {
autoStart: autoPlay,
vid: vid,
isShowSpeeder: 1,
videoType: 1, // 0为mp4模式 1为cc模式
callback: '_playerCallback'
}
if (srt) { flashvars.srtUrl = srt }
if (username) { flashvars.username = username }
// flashvars.videoType = 1; // 0为mp4模式 1为cc模式
const params = {
quality: 'high',
bgcolor: '#000000',
allowscriptaccess: 'always',
allowfullscreen: 'true'
}
const attributes = {
id: domId,
name: domId,
align: 'middle',
wmode: 'opaque'
}
// render
swfobject.embedSWF(
// require('player'),
'/static/videoJs/swf/Player1705192.swf',
domId,
parseInt(width),
parseInt(height),
swfVersionStr,
xiSwfUrlStr,
flashvars,
params,
attributes
)
// 绑定事件监听
this.listenPlayerEvents()
},
listenPlayerEvents () {
$('#' + PLAYER_WRAP_ID).off('player.time player.seek').on('player.time player.seek', (e, data) => {
this.$emit('handlePlayTime', data)
})
},
// ========= 提供播放后,其他组件可使用控制播放的方法 ===========
// 获取视频对象
getPlayer () {
return document.getElementById(PLAYER_ID)
},
getTime () {
const player = this.getPlayer()
if (player) {
return player.callAction('getCurrentTime')
} else {
return 0
}
},
// 设置视频跳转时间
setTimeTo (time) {
const player = this.getPlayer()
if (player) {
player.callAction('setCurrentTime', time + 2) // flash实际播放值会大概小个一两秒,因此添加偏移
}
},
// 执行“跳过片头”操作
skipBegin () {
const player = this.getPlayer()
if (player && player.callAction('getCurrentTime') < SKIP_BEGIN_TIME) {
player.callAction('setCurrentTime', SKIP_BEGIN_TIME)
}
},
// 设置视频尺寸
setSize (w, h) {
const player = this.getPlayer()
if (player) {
player.width = w
player.height = h
}
}
}
}
</script>
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论