no message
This commit is contained in:
parent
6e42586dcc
commit
11eb8000b3
@ -15,7 +15,9 @@
|
|||||||
<div :class="['avatar-box', userId === userid || user.online ? 'online' : '']" :style="boxStyle">
|
<div :class="['avatar-box', userId === userid || user.online ? 'online' : '']" :style="boxStyle">
|
||||||
<em :style="spotStyle"></em>
|
<em :style="spotStyle"></em>
|
||||||
<EAvatar v-if="showImg" :src="user.userimg" :size="avatarSize"/>
|
<EAvatar v-if="showImg" :src="user.userimg" :size="avatarSize"/>
|
||||||
<EAvatar v-else :size="avatarSize" class="avatar-text">{{nickname}}</EAvatar>
|
<EAvatar v-else :size="avatarSize" class="avatar-text">
|
||||||
|
<span :style="spotStyle">{{nickname}}</span>
|
||||||
|
</EAvatar>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="showName" class="avatar-name">{{user.nickname}}</div>
|
<div v-if="showName" class="avatar-name">{{user.nickname}}</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,22 +1,31 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="page-login">
|
<div class="page-login">
|
||||||
<PageTitle :title="$L('登录')"/>
|
<PageTitle :title="$L('登录')"/>
|
||||||
<div class="login-body">
|
<div class="login-body overlay-y">
|
||||||
<div class="login-logo"></div>
|
<div class="login-logo"></div>
|
||||||
<div class="login-box">
|
<div class="login-box">
|
||||||
<div class="login-title">Welcome Dootask</div>
|
<div class="login-title">Welcome Dootask</div>
|
||||||
<div class="login-subtitle">{{$L('输入您的凭证以访问您的帐户。')}}</div>
|
|
||||||
|
<div v-if="loginType=='reg'" class="login-subtitle">{{$L('输入您的信息以创建帐户。')}}</div>
|
||||||
|
<div v-else class="login-subtitle">{{$L('输入您的凭证以访问您的帐户。')}}</div>
|
||||||
|
|
||||||
<div class="login-input">
|
<div class="login-input">
|
||||||
<Input v-model="email" prefix="ios-mail-outline" :placeholder="$L('输入您的电子邮件')" size="large" @on-enter="onLogin" @on-blur="onBlur" />
|
<Input v-model="email" prefix="ios-mail-outline" :placeholder="$L('输入您的电子邮件')" size="large" @on-enter="onLogin" @on-blur="onBlur" />
|
||||||
<Input v-model="password" prefix="ios-lock-outline" :placeholder="$L('输入您的密码')" type="password" size="large" @on-enter="onLogin" />
|
<Input v-model="password" prefix="ios-lock-outline" :placeholder="$L('输入您的密码')" type="password" size="large" @on-enter="onLogin" />
|
||||||
|
|
||||||
|
<Input v-if="loginType=='reg'" v-model="password2" prefix="ios-lock-outline" :placeholder="$L('输入确认密码')" type="password" size="large" @on-enter="onLogin" />
|
||||||
|
|
||||||
<Input v-if="codeNeed" v-model="code" class="login-code" :placeholder="$L('输入图形验证码')" size="large" @on-enter="onLogin">
|
<Input v-if="codeNeed" v-model="code" class="login-code" :placeholder="$L('输入图形验证码')" size="large" @on-enter="onLogin">
|
||||||
<Icon type="ios-checkmark-circle-outline" class="login-icon" slot="prepend"></Icon>
|
<Icon type="ios-checkmark-circle-outline" class="login-icon" slot="prepend"></Icon>
|
||||||
<div slot="append" class="login-code-end" @click="reCode"><img :src="codeUrl"/></div>
|
<div slot="append" class="login-code-end" @click="reCode"><img :src="codeUrl"/></div>
|
||||||
</Input>
|
</Input>
|
||||||
<Button type="primary" :loading="loadIng > 0" size="large" long @click="onLogin">{{$L('登录')}}</Button>
|
<Button type="primary" :loading="loadIng > 0" size="large" long @click="onLogin">{{$L(loginType=='login'?'登录':'注册')}}</Button>
|
||||||
|
|
||||||
|
<div v-if="loginType=='reg'" class="login-switch">{{$L('已经有帐号?')}}<a href="javascript:void(0)" @click="loginType='login'">{{$L('登录帐号')}}</a></div>
|
||||||
|
<div v-else class="login-switch">{{$L('还没有帐号?')}}<a href="javascript:void(0)" @click="loginType='reg'">{{$L('注册帐号')}}</a></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="login-forgot">{{$L('忘记密码了?')}}<a href="#">{{$L('重置密码')}}</a></div>
|
<div class="login-forgot">{{$L('忘记密码了?')}}<a href="javascript:void(0)" @click="forgotPassword">{{$L('重置密码')}}</a></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -33,10 +42,15 @@ export default {
|
|||||||
loginType: 'login',
|
loginType: 'login',
|
||||||
email: '',
|
email: '',
|
||||||
password: '',
|
password: '',
|
||||||
|
password2: '',
|
||||||
code: '',
|
code: '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
forgotPassword() {
|
||||||
|
$A.modalWarning("请联系管理员!");
|
||||||
|
},
|
||||||
|
|
||||||
reCode() {
|
reCode() {
|
||||||
this.codeUrl = this.$store.state.method.apiUrl('users/login/codeimg?_=' + Math.random())
|
this.codeUrl = this.$store.state.method.apiUrl('users/login/codeimg?_=' + Math.random())
|
||||||
},
|
},
|
||||||
@ -69,6 +83,12 @@ export default {
|
|||||||
if (!this.password) {
|
if (!this.password) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (this.loginType == 'reg') {
|
||||||
|
if (this.password != this.password2) {
|
||||||
|
$A.noticeError("确认密码输入不一致");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
this.loadIng++;
|
this.loadIng++;
|
||||||
this.$store.dispatch("call", {
|
this.$store.dispatch("call", {
|
||||||
url: 'users/login',
|
url: 'users/login',
|
||||||
@ -80,6 +100,7 @@ export default {
|
|||||||
},
|
},
|
||||||
}).then(({data}) => {
|
}).then(({data}) => {
|
||||||
this.loadIng--;
|
this.loadIng--;
|
||||||
|
this.$store.state.method.clearLocal();
|
||||||
this.$store.dispatch("saveUserInfo", data);
|
this.$store.dispatch("saveUserInfo", data);
|
||||||
this.goNext();
|
this.goNext();
|
||||||
}).catch(({data, msg}) => {
|
}).catch(({data, msg}) => {
|
||||||
|
@ -1,8 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="page-manage">
|
<div class="page-manage">
|
||||||
<div class="manage-box-menu">
|
<div class="manage-box-menu">
|
||||||
<Dropdown class="manage-box-dropdown" trigger="click" @on-click="settingRoute">
|
<Dropdown
|
||||||
<div class="manage-box-title">
|
class="manage-box-dropdown"
|
||||||
|
trigger="click"
|
||||||
|
@on-click="settingRoute"
|
||||||
|
@on-visible-change="menuVisibleChange">
|
||||||
|
<div :class="['manage-box-title', visibleMenu ? 'menu-visible' : '']">
|
||||||
<div class="manage-box-avatar">
|
<div class="manage-box-avatar">
|
||||||
<UserAvatar :userid="userId" :size="36" tooltip-disabled/>
|
<UserAvatar :userid="userId" :size="36" tooltip-disabled/>
|
||||||
</div>
|
</div>
|
||||||
@ -15,8 +19,8 @@
|
|||||||
<DropdownMenu slot="list">
|
<DropdownMenu slot="list">
|
||||||
<DropdownItem
|
<DropdownItem
|
||||||
v-for="(item, key) in menu"
|
v-for="(item, key) in menu"
|
||||||
v-if="!item.admin||userIsAdmin"
|
|
||||||
:key="key"
|
:key="key"
|
||||||
|
:divided="!!item.divided"
|
||||||
:name="item.path">{{$L(item.name)}}</DropdownItem>
|
:name="item.path">{{$L(item.name)}}</DropdownItem>
|
||||||
<DropdownItem divided name="signout" style="color:#f40">{{$L('退出登录')}}</DropdownItem>
|
<DropdownItem divided name="signout" style="color:#f40">{{$L('退出登录')}}</DropdownItem>
|
||||||
</DropdownMenu>
|
</DropdownMenu>
|
||||||
@ -143,15 +147,8 @@ export default {
|
|||||||
|
|
||||||
columns: [],
|
columns: [],
|
||||||
|
|
||||||
menu: [
|
|
||||||
{path: 'personal', admin: false, name: '个人设置'},
|
|
||||||
{path: 'password', admin: false, name: '密码设置'},
|
|
||||||
{path: 'system', admin: true, name: '系统设置'},
|
|
||||||
{path: 'priority', admin: true, name: '任务等级'},
|
|
||||||
{path: 'archivedProject', admin: false, name: '已归档项目'}
|
|
||||||
],
|
|
||||||
|
|
||||||
openMenu: {},
|
openMenu: {},
|
||||||
|
visibleMenu: false,
|
||||||
|
|
||||||
archivedProjectShow: false,
|
archivedProjectShow: false,
|
||||||
|
|
||||||
@ -196,6 +193,27 @@ export default {
|
|||||||
num += unread;
|
num += unread;
|
||||||
})
|
})
|
||||||
return num;
|
return num;
|
||||||
|
},
|
||||||
|
|
||||||
|
menu() {
|
||||||
|
const {userIsAdmin} = this;
|
||||||
|
if (userIsAdmin) {
|
||||||
|
return [
|
||||||
|
{path: 'personal', name: '个人设置'},
|
||||||
|
{path: 'password', name: '密码设置'},
|
||||||
|
{path: 'system', name: '系统设置', divided: true},
|
||||||
|
{path: 'priority', name: '任务等级'},
|
||||||
|
{path: 'project', name: '项目管理'},
|
||||||
|
{path: 'user', name: '会员管理', divided: true},
|
||||||
|
{path: 'archivedProject', name: '已归档的项目'}
|
||||||
|
]
|
||||||
|
} else {
|
||||||
|
return [
|
||||||
|
{path: 'personal', name: '个人设置'},
|
||||||
|
{path: 'password', name: '密码设置'},
|
||||||
|
{path: 'archivedProject', name: '已归档的项目', divided: true}
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -280,22 +298,31 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
settingRoute(path) {
|
settingRoute(path) {
|
||||||
if (path === 'signout') {
|
switch (path) {
|
||||||
$A.modalConfirm({
|
case 'project':
|
||||||
title: '退出登录',
|
return;
|
||||||
content: '你确定要登出系统?',
|
case 'user':
|
||||||
onOk: () => {
|
return;
|
||||||
this.$store.dispatch("logout")
|
case 'archivedProject':
|
||||||
}
|
this.archivedProjectShow = true;
|
||||||
});
|
return;
|
||||||
return;
|
case 'signout':
|
||||||
} else if (path === 'archivedProject') {
|
$A.modalConfirm({
|
||||||
this.archivedProjectShow = true;
|
title: '退出登录',
|
||||||
return;
|
content: '你确定要登出系统?',
|
||||||
|
onOk: () => {
|
||||||
|
this.$store.dispatch("logout")
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
this.toggleRoute('setting/' + path);
|
this.toggleRoute('setting/' + path);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
menuVisibleChange(visible) {
|
||||||
|
this.visibleMenu = visible
|
||||||
|
},
|
||||||
|
|
||||||
classNameRoute(path, openMenu) {
|
classNameRoute(path, openMenu) {
|
||||||
return {
|
return {
|
||||||
"active": this.curPath == '/manage/' + path,
|
"active": this.curPath == '/manage/' + path,
|
||||||
|
4
resources/assets/js/store/actions.js
vendored
4
resources/assets/js/store/actions.js
vendored
@ -263,9 +263,11 @@ export default {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 登出(打开登录页面)
|
* 登出(打开登录页面)
|
||||||
|
* @param state
|
||||||
* @param dispatch
|
* @param dispatch
|
||||||
*/
|
*/
|
||||||
logout({dispatch}) {
|
logout({state, dispatch}) {
|
||||||
|
state.method.clearLocal();
|
||||||
dispatch("saveUserInfo", {}).then(() => {
|
dispatch("saveUserInfo", {}).then(() => {
|
||||||
const from = window.location.pathname == '/' ? '' : encodeURIComponent(window.location.href);
|
const from = window.location.pathname == '/' ? '' : encodeURIComponent(window.location.href);
|
||||||
$A.goForward({path: '/login', query: from ? {from: from} : {}}, true);
|
$A.goForward({path: '/login', query: from ? {from: from} : {}}, true);
|
||||||
|
8
resources/assets/js/store/state.js
vendored
8
resources/assets/js/store/state.js
vendored
@ -171,6 +171,14 @@ const method = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
clearLocal() {
|
||||||
|
try {
|
||||||
|
window.localStorage.clear();
|
||||||
|
} catch (e) {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
runNum(str, fixed) {
|
runNum(str, fixed) {
|
||||||
let _s = Number(str);
|
let _s = Number(str);
|
||||||
if (_s + "" === "NaN") {
|
if (_s + "" === "NaN") {
|
||||||
|
@ -10,6 +10,11 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
.avatar-text {
|
.avatar-text {
|
||||||
background-color: $primary-color;
|
background-color: $primary-color;
|
||||||
|
> span {
|
||||||
|
display: inline-block;
|
||||||
|
font-size: 15px;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
> em {
|
> em {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
19
resources/assets/sass/pages/page-login.scss
vendored
19
resources/assets/sass/pages/page-login.scss
vendored
@ -12,15 +12,20 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
padding: 32px 0;
|
||||||
|
width: 100%;
|
||||||
|
max-height: 100%;
|
||||||
|
overflow: auto;
|
||||||
.login-logo {
|
.login-logo {
|
||||||
width: 72px;
|
flex-shrink: 0;
|
||||||
height: 72px;
|
width: 68px;
|
||||||
|
height: 68px;
|
||||||
background: url("../images/logo.svg") no-repeat center center;
|
background: url("../images/logo.svg") no-repeat center center;
|
||||||
background-size: contain;
|
background-size: contain;
|
||||||
}
|
}
|
||||||
.login-box {
|
.login-box {
|
||||||
margin-top: 32px;
|
margin-top: 32px;
|
||||||
width: 450px;
|
width: 400px;
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
box-shadow: 0 0 10px #e6ecfa;
|
box-shadow: 0 0 10px #e6ecfa;
|
||||||
@ -37,13 +42,16 @@
|
|||||||
color: #AAAAAA;
|
color: #AAAAAA;
|
||||||
}
|
}
|
||||||
.login-input {
|
.login-input {
|
||||||
margin: 40px;
|
margin: 32px 40px;
|
||||||
> * {
|
> * {
|
||||||
margin-top: 26px;
|
margin-top: 26px;
|
||||||
}
|
}
|
||||||
.ivu-input {
|
.ivu-input {
|
||||||
border-color: #f1f1f1;
|
border-color: #f1f1f1;
|
||||||
}
|
}
|
||||||
|
.ivu-input-large {
|
||||||
|
font-size: 15px;
|
||||||
|
}
|
||||||
.login-code {
|
.login-code {
|
||||||
.ivu-input-group-prepend,
|
.ivu-input-group-prepend,
|
||||||
.ivu-input-group-append {
|
.ivu-input-group-append {
|
||||||
@ -64,6 +72,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.login-switch {
|
||||||
|
color: #aaaaaa;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.login-forgot {
|
.login-forgot {
|
||||||
|
4
resources/assets/sass/pages/page-manage.scss
vendored
4
resources/assets/sass/pages/page-manage.scss
vendored
@ -40,6 +40,10 @@
|
|||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
transition: box-shadow 0.3s;
|
||||||
|
&.menu-visible {
|
||||||
|
box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
|
||||||
|
}
|
||||||
.manage-box-avatar {
|
.manage-box-avatar {
|
||||||
width: 36px;
|
width: 36px;
|
||||||
height: 36px;
|
height: 36px;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user