登录和首页优化
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "element-starter",
|
||||
"description": "A Vue.js project",
|
||||
"name": "console-ui",
|
||||
"description": "console-ui",
|
||||
"author": "yi.shyang@ele.me",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
@@ -9,7 +9,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^0.18.0",
|
||||
"element-ui": "^2.3.4",
|
||||
"element-ui": "^2.10.0",
|
||||
"vue": "^2.5.16",
|
||||
"vue-axios": "^2.1.4",
|
||||
"vue-router": "^3.0.6",
|
||||
|
||||
@@ -78,6 +78,7 @@
|
||||
mounted: function () {
|
||||
app = this;
|
||||
global.vue.$app = this;
|
||||
this.getUserInfo();
|
||||
this.checkSystemUpgrade();
|
||||
},
|
||||
methods: {
|
||||
@@ -97,6 +98,15 @@
|
||||
toast.notOpen();
|
||||
}
|
||||
},
|
||||
userSignOut() {
|
||||
this.common.post(this.apilist1.userLogout, {}, function (json) {
|
||||
location.reload();
|
||||
});
|
||||
},
|
||||
getUserInfo() {
|
||||
this.common.post(this.apilist1.getUserBaseInfo, {}, function (json) {
|
||||
});
|
||||
},
|
||||
checkSystemUpgrade() {
|
||||
this.common.post(this.apilist1.systemUpgradeInfo, {}, function (json) {
|
||||
if (!!json.data) {
|
||||
|
||||
@@ -8,11 +8,11 @@ var _fn = {
|
||||
// HOST: 'http://local.zyplayer.com:8083/zyplayer-doc-manage',
|
||||
// HOST1: 'http://local.zyplayer.com:8083/zyplayer-doc-manage',
|
||||
// 也可以直接使用线上的服务调试
|
||||
// HOST: 'http://doc.zyplayer.com/zyplayer-doc-manage',
|
||||
// HOST1: 'http://doc.zyplayer.com/zyplayer-doc-manage',
|
||||
HOST: 'http://doc.zyplayer.com/zyplayer-doc-manage',
|
||||
HOST1: 'http://doc.zyplayer.com/zyplayer-doc-manage',
|
||||
// 打包时使用下面这两行,文件就放在根目录下,所以当前路劲就好
|
||||
HOST: './',
|
||||
HOST1: './',
|
||||
// HOST: './',
|
||||
// HOST1: './',
|
||||
|
||||
mixUrl: function (host, url) {
|
||||
var p;
|
||||
|
||||
@@ -24,7 +24,7 @@ export default {
|
||||
} else if (res.data.errCode == 400) {
|
||||
global.vue.$message('请先登录');
|
||||
var href = encodeURIComponent(window.location.href);
|
||||
window.location = apimix.apilist1.HOST + "/static/manage/login.html?redirect=" + href;
|
||||
global.vue.$router.push({path: '/user/login', query: {redirect: href}});
|
||||
} else if (res.data.errCode == 402) {
|
||||
global.vue.$router.push("/common/noAuth");
|
||||
} else if (res.data.errCode !== 200) {
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>二方库-集成代理版</span>
|
||||
<a target="_blank" href="http://doc.zyplayer.com/zyplayer-doc-manage/doc-wiki#/page/show?spaceId=1&pageId=76"><i class="el-icon-info" style="color: #999;"></i></a>
|
||||
<a target="_blank" href="http://doc.zyplayer.com/zyplayer-doc-manage/open-wiki.html?pageId=76&space=23f3f59a60824d21af9f7c3bbc9bc3cb"><i class="el-icon-info" style="color: #999;"></i></a>
|
||||
</div>
|
||||
<div class="product-list">
|
||||
<el-tooltip effect="dark" content="swagger的原生官方文档" placement="top-start">
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
<template>
|
||||
<el-form :model="loginParam" :rules="loginRules" ref="loginParam" label-position="left" label-width="0px"
|
||||
class="demo-ruleForm login-container">
|
||||
<h3 class="title">系统登录</h3>
|
||||
<el-form-item prop="userNo">
|
||||
<el-input type="text" v-model="loginParam.userNo" auto-complete="off" placeholder="账号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="password">
|
||||
<el-input type="password" v-model="loginParam.password" auto-complete="off" placeholder="密码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item style="width:100%;">
|
||||
<el-button type="primary" style="width:100%;" @click.native.prevent="loginSubmit" :loading="logining">登录
|
||||
</el-button>
|
||||
<!--<el-button @click.native.prevent="handleReset2">重置</el-button>-->
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div style="padding-top: 50px;">
|
||||
<el-form :model="loginParam" :rules="loginRules" ref="loginParam" label-position="left" label-width="0px"
|
||||
class="demo-ruleForm login-container">
|
||||
<h3 class="title">系统登录</h3>
|
||||
<el-form-item prop="username">
|
||||
<el-input type="text" v-model="loginParam.username" auto-complete="off" placeholder="账号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="password">
|
||||
<el-input type="password" v-model="loginParam.password" auto-complete="off" placeholder="密码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item style="width:100%;">
|
||||
<el-button type="primary" style="width:100%;" @click.native.prevent="loginSubmit" :loading="logining">登录
|
||||
</el-button>
|
||||
<!--<el-button @click.native.prevent="handleReset2">重置</el-button>-->
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -21,12 +23,13 @@
|
||||
data() {
|
||||
return {
|
||||
logining: false,
|
||||
redirect: '',
|
||||
loginParam: {
|
||||
userNo: '',
|
||||
username: '',
|
||||
password: ''
|
||||
},
|
||||
loginRules: {
|
||||
userNo: [
|
||||
username: [
|
||||
{required: true, message: '请输入账号', trigger: 'blur'},
|
||||
],
|
||||
password: [
|
||||
@@ -36,21 +39,20 @@
|
||||
checked: true
|
||||
};
|
||||
},
|
||||
mounted: function () {
|
||||
this.redirect = this.$route.query.redirect;
|
||||
},
|
||||
methods: {
|
||||
loginSubmit(ev) {
|
||||
loginSubmit() {
|
||||
var that = this;
|
||||
this.$refs.loginParam.validate((valid) => {
|
||||
if (!valid) return;
|
||||
that.common.post(that.apilist1.userLogin, that.loginParam, function (json) {
|
||||
// 设置cookie
|
||||
var token = escape(json.data);
|
||||
var exp = new Date();
|
||||
exp.setTime(exp.getTime() + 30 * 24 * 60 * 60 * 1000);
|
||||
document.cookie = "accessToken=" + token + ";expires=" + exp.toGMTString();
|
||||
that.common.setAccessToken(token);
|
||||
// 跳转
|
||||
that.global.user.isLogin = true;
|
||||
that.$router.push("/user/wxLogin");
|
||||
if(!!that.redirect) {
|
||||
location.href = decodeURIComponent(that.redirect);
|
||||
} else {
|
||||
that.$router.back();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -64,7 +66,7 @@
|
||||
border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
background-clip: padding-box;
|
||||
margin: 80px auto;
|
||||
margin: 0 auto;
|
||||
width: 350px;
|
||||
padding: 35px 35px 15px 35px;
|
||||
background: #fff;
|
||||
|
||||
@@ -34,7 +34,7 @@ module.exports = (options = {}) => ({
|
||||
use: [{
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 10000
|
||||
limit: 800000
|
||||
}
|
||||
}]
|
||||
}
|
||||
|
||||
@@ -1432,14 +1432,16 @@ electron-to-chromium@^1.2.7:
|
||||
version "1.3.8"
|
||||
resolved "http://registry.npm.taobao.org/electron-to-chromium/download/electron-to-chromium-1.3.8.tgz#b2c8a2c79bb89fbbfd3724d9555e15095b5f5fb6"
|
||||
|
||||
element-ui@^2.3.4:
|
||||
version "2.3.4"
|
||||
resolved "https://registry.yarnpkg.com/element-ui/-/element-ui-2.3.4.tgz#d6d6b057a4acf4caa5e9fd9f1a78bd89c8845e4f"
|
||||
element-ui@^2.10.0:
|
||||
version "2.10.0"
|
||||
resolved "https://registry.npm.taobao.org/element-ui/download/element-ui-2.10.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Felement-ui%2Fdownload%2Felement-ui-2.10.0.tgz#e6129f6b6d6ffe0dbad125a4a8d17d447a5f639c"
|
||||
integrity sha1-5hKfa21v/g260SWkqNF9RHpfY5w=
|
||||
dependencies:
|
||||
async-validator "~1.8.1"
|
||||
babel-helper-vue-jsx-merge-props "^2.0.0"
|
||||
deepmerge "^1.2.0"
|
||||
normalize-wheel "^1.0.1"
|
||||
resize-observer-polyfill "^1.5.0"
|
||||
throttle-debounce "^1.0.1"
|
||||
|
||||
elliptic@^6.0.0:
|
||||
@@ -3319,6 +3321,11 @@ requires-port@1.0.x, requires-port@1.x.x:
|
||||
version "1.0.0"
|
||||
resolved "http://registry.npm.taobao.org/requires-port/download/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff"
|
||||
|
||||
resize-observer-polyfill@^1.5.0:
|
||||
version "1.5.1"
|
||||
resolved "https://registry.npm.taobao.org/resize-observer-polyfill/download/resize-observer-polyfill-1.5.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fresize-observer-polyfill%2Fdownload%2Fresize-observer-polyfill-1.5.1.tgz#0e9020dd3d21024458d4ebd27e23e40269810464"
|
||||
integrity sha1-DpAg3T0hAkRY1OvSfiPkAmmBBGQ=
|
||||
|
||||
resolve@^1.4.0:
|
||||
version "1.5.0"
|
||||
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.5.0.tgz#1f09acce796c9a762579f31b2c1cc4c3cddf9f36"
|
||||
|
||||
Reference in New Issue
Block a user