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) => {
return request.postJson("/oil-identity/oilRefinery/loginOMSByPwd", params);
};
const loginOut = () => {
return request.get("/oil-identity/authorization/logout");
};
//路由
const getCustomerRouters = () => {
return request.get(
"/oil-identity/oilRefinery/getCustomerRouters/REFINERY_OMS_WEB"
);
};
export default { login, getCustomerRouters };
export default { login, loginOut, getCustomerRouters };

@ -1,29 +1,22 @@
<template>
<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" />
<div class="right-menu">
<el-dropdown class="avatar-container" trigger="click">
<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" />
</div>
<el-dropdown-menu slot="dropdown" class="user-dropdown">
<router-link to="/">
<el-dropdown-item>
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 @click.native="logout">
<span style="display: block">注销登录</span>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
@ -32,31 +25,34 @@
</template>
<script>
import { mapGetters } from 'vuex'
import Breadcrumb from '@/components/Breadcrumb'
import Hamburger from '@/components/Hamburger'
import { mapGetters } from "vuex";
import Breadcrumb from "@/components/Breadcrumb";
import Hamburger from "@/components/Hamburger";
import serve from "api/login.js";
export default {
components: {
Breadcrumb,
Hamburger
Hamburger,
},
computed: {
...mapGetters([
'sidebar',
'avatar'
])
...mapGetters(["sidebar", "avatar"]),
},
methods: {
toggleSideBar() {
this.$store.dispatch('app/toggleSideBar')
this.$store.dispatch("app/toggleSideBar");
},
async logout() {
await this.$store.dispatch('user/logout')
this.$router.push(`/login?redirect=${this.$route.fullPath}`)
}
}
}
logout() {
serve.loginOut().then((res) => {
if (res.code === 20000) {
localStorage.removeItem("token");
this.$router.push("/login");
}
});
},
},
};
</script>
<style lang="scss" scoped>
@ -65,18 +61,18 @@ export default {
overflow: hidden;
position: relative;
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 {
line-height: 46px;
height: 100%;
float: left;
cursor: pointer;
transition: background .3s;
-webkit-tap-highlight-color:transparent;
transition: background 0.3s;
-webkit-tap-highlight-color: transparent;
&:hover {
background: rgba(0, 0, 0, .025)
background: rgba(0, 0, 0, 0.025);
}
}
@ -103,10 +99,10 @@ export default {
&.hover-effect {
cursor: pointer;
transition: background .3s;
transition: background 0.3s;
&:hover {
background: rgba(0, 0, 0, .025)
background: rgba(0, 0, 0, 0.025);
}
}
}

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

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

@ -27,15 +27,6 @@
</el-select>
</el-form-item>
<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" />
</el-form-item>
</el-form>
@ -81,7 +72,7 @@ export default {
{ required: true, message: "请输入账户名称", trigger: "blur" },
],
accountType: [
{ required: true, message: "请输入账户名称", trigger: "blur" },
{ required: true, message: "请选择账户类型", trigger: "change" },
],
refineryId: [
{ required: true, validator: validatorRefineryId, trigger: "change" },

Loading…
Cancel
Save