pull/1/head
xiaozhiyong 2 years ago
parent 726dc111b6
commit be17b0295d
  1. 7
      src/api/login.js
  2. 68
      src/layout/components/Navbar.vue
  3. 7
      src/settings.js
  4. 15
      src/views/login/index.vue
  5. 11
      src/views/refineryAccount/components/add.vue

@ -3,10 +3,15 @@ import request from "utils/axios.js";
const login = (params) => { const login = (params) => {
return request.postJson("/oil-identity/oilRefinery/loginOMSByPwd", params); return request.postJson("/oil-identity/oilRefinery/loginOMSByPwd", params);
}; };
const loginOut = () => {
return request.get("/oil-identity/authorization/logout");
};
//路由 //路由
const getCustomerRouters = () => { const getCustomerRouters = () => {
return request.get( return request.get(
"/oil-identity/oilRefinery/getCustomerRouters/REFINERY_OMS_WEB" "/oil-identity/oilRefinery/getCustomerRouters/REFINERY_OMS_WEB"
); );
}; };
export default { login, getCustomerRouters }; export default { login, loginOut, getCustomerRouters };

@ -1,29 +1,22 @@
<template> <template>
<div class="navbar"> <div class="navbar">
<hamburger :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" /> <hamburger
:is-active="sidebar.opened"
class="hamburger-container"
@toggleClick="toggleSideBar"
/>
<breadcrumb class="breadcrumb-container" /> <breadcrumb class="breadcrumb-container" />
<div class="right-menu"> <div class="right-menu">
<el-dropdown class="avatar-container" trigger="click"> <el-dropdown class="avatar-container" trigger="click">
<div class="avatar-wrapper"> <div class="avatar-wrapper">
<img :src="avatar+'?imageView2/1/w/80/h/80'" class="user-avatar"> <img :src="avatar + '?imageView2/1/w/80/h/80'" class="user-avatar" />
<i class="el-icon-caret-bottom" /> <i class="el-icon-caret-bottom" />
</div> </div>
<el-dropdown-menu slot="dropdown" class="user-dropdown"> <el-dropdown-menu slot="dropdown" class="user-dropdown">
<router-link to="/"> <el-dropdown-item @click.native="logout">
<el-dropdown-item> <span style="display: block">注销登录</span>
Home
</el-dropdown-item>
</router-link>
<a target="_blank" href="https://github.com/PanJiaChen/vue-admin-template/">
<el-dropdown-item>Github</el-dropdown-item>
</a>
<a target="_blank" href="https://panjiachen.github.io/vue-element-admin-site/#/">
<el-dropdown-item>Docs</el-dropdown-item>
</a>
<el-dropdown-item divided @click.native="logout">
<span style="display:block;">Log Out</span>
</el-dropdown-item> </el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
@ -32,31 +25,34 @@
</template> </template>
<script> <script>
import { mapGetters } from 'vuex' import { mapGetters } from "vuex";
import Breadcrumb from '@/components/Breadcrumb' import Breadcrumb from "@/components/Breadcrumb";
import Hamburger from '@/components/Hamburger' import Hamburger from "@/components/Hamburger";
import serve from "api/login.js";
export default { export default {
components: { components: {
Breadcrumb, Breadcrumb,
Hamburger Hamburger,
}, },
computed: { computed: {
...mapGetters([ ...mapGetters(["sidebar", "avatar"]),
'sidebar',
'avatar'
])
}, },
methods: { methods: {
toggleSideBar() { toggleSideBar() {
this.$store.dispatch('app/toggleSideBar') this.$store.dispatch("app/toggleSideBar");
}, },
async logout() { logout() {
await this.$store.dispatch('user/logout') serve.loginOut().then((res) => {
this.$router.push(`/login?redirect=${this.$route.fullPath}`) if (res.code === 20000) {
} localStorage.removeItem("token");
} this.$router.push("/login");
} }
});
},
},
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -65,18 +61,18 @@ export default {
overflow: hidden; overflow: hidden;
position: relative; position: relative;
background: #fff; background: #fff;
box-shadow: 0 1px 4px rgba(0,21,41,.08); box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
.hamburger-container { .hamburger-container {
line-height: 46px; line-height: 46px;
height: 100%; height: 100%;
float: left; float: left;
cursor: pointer; cursor: pointer;
transition: background .3s; transition: background 0.3s;
-webkit-tap-highlight-color:transparent; -webkit-tap-highlight-color: transparent;
&:hover { &:hover {
background: rgba(0, 0, 0, .025) background: rgba(0, 0, 0, 0.025);
} }
} }
@ -103,10 +99,10 @@ export default {
&.hover-effect { &.hover-effect {
cursor: pointer; cursor: pointer;
transition: background .3s; transition: background 0.3s;
&:hover { &:hover {
background: rgba(0, 0, 0, .025) background: rgba(0, 0, 0, 0.025);
} }
} }
} }

@ -1,6 +1,5 @@
module.exports = { module.exports = {
title: "油批运营管理系统",
title: 'Vue Admin Template',
/** /**
* @type {boolean} true | false * @type {boolean} true | false
@ -12,5 +11,5 @@ module.exports = {
* @type {boolean} true | false * @type {boolean} true | false
* @description Whether show the logo in sidebar * @description Whether show the logo in sidebar
*/ */
sidebarLogo: false sidebarLogo: false,
} };

@ -9,7 +9,7 @@
label-position="left" label-position="left"
> >
<div class="title-container"> <div class="title-container">
<h3 class="title">Login Form</h3> <h3 class="title">油批运营管理平台</h3>
</div> </div>
<el-form-item prop="username"> <el-form-item prop="username">
@ -19,7 +19,7 @@
<el-input <el-input
ref="username" ref="username"
v-model="loginForm.username" v-model="loginForm.username"
placeholder="Username" placeholder="用户名"
name="username" name="username"
type="text" type="text"
tabindex="1" tabindex="1"
@ -36,7 +36,7 @@
ref="password" ref="password"
v-model="loginForm.password" v-model="loginForm.password"
:type="passwordType" :type="passwordType"
placeholder="Password" placeholder="密码"
name="password" name="password"
tabindex="2" tabindex="2"
auto-complete="on" auto-complete="on"
@ -54,13 +54,8 @@
type="primary" type="primary"
style="width: 100%; margin-bottom: 30px" style="width: 100%; margin-bottom: 30px"
@click.native.prevent="handleLogin" @click.native.prevent="handleLogin"
>Login</el-button >登录</el-button
> >
<div class="tips">
<span style="margin-right: 20px">username: admin</span>
<span> password: any</span>
</div>
</el-form> </el-form>
</div> </div>
</template> </template>
@ -79,7 +74,7 @@ export default {
}; };
return { return {
loading: false, loading: false,
passwordType: "", passwordType: "password",
companyList: [], companyList: [],
loginForm: { loginForm: {
username: "", username: "",

@ -27,15 +27,6 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="炼厂名称" prop="refineryId"> <el-form-item label="炼厂名称" prop="refineryId">
<!-- <el-autocomplete
label
v-model="form.refineryId"
:fetch-suggestions="querySearchAsync"
value-key="refineryName"
value="id"
placeholder="请选择炼厂"
></el-autocomplete> -->
<autocomplete :params="form" :config="configAutocomplete" /> <autocomplete :params="form" :config="configAutocomplete" />
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -81,7 +72,7 @@ export default {
{ required: true, message: "请输入账户名称", trigger: "blur" }, { required: true, message: "请输入账户名称", trigger: "blur" },
], ],
accountType: [ accountType: [
{ required: true, message: "请输入账户名称", trigger: "blur" }, { required: true, message: "请选择账户类型", trigger: "change" },
], ],
refineryId: [ refineryId: [
{ required: true, validator: validatorRefineryId, trigger: "change" }, { required: true, validator: validatorRefineryId, trigger: "change" },

Loading…
Cancel
Save