个人中心

dev
yujialong 3 years ago
commit 9e36d29eac
  1. 6
      package-lock.json
  2. 2
      package.json
  3. 13
      src/main.js
  4. 7
      src/router/index.js
  5. 52
      src/utils/api.js
  6. 11
      src/utils/http.js
  7. 0
      src/utils/preventReClick.js
  8. 84
      src/views/Login.vue
  9. 29
      src/views/oder/Order.vue

6
package-lock.json generated

@ -12680,9 +12680,9 @@
"integrity": "sha512-W+y2EAI/BxS4Vlcca9scQv8ifeBFck56DRtSwWJ2H4Cw1GLNUYxiZxUHHkuzuI5JPW/cYtL1bPO5xPyEXx4LmQ==" "integrity": "sha512-W+y2EAI/BxS4Vlcca9scQv8ifeBFck56DRtSwWJ2H4Cw1GLNUYxiZxUHHkuzuI5JPW/cYtL1bPO5xPyEXx4LmQ=="
}, },
"vue-router": { "vue-router": {
"version": "3.1.3", "version": "3.5.2",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.1.3.tgz", "resolved": "https://registry.nlark.com/vue-router/download/vue-router-3.5.2.tgz",
"integrity": "sha512-8iSa4mGNXBjyuSZFCCO4fiKfvzqk+mhL0lnKuGcQtO1eoj8nq3CmbEG8FwK5QqoqwDgsjsf1GDuisDX4cdb/aQ==" "integrity": "sha1-X1Xj8lGXDjbD6NiKfNLWejUK3lw="
}, },
"vue-schart": { "vue-schart": {
"version": "2.0.0", "version": "2.0.0",

@ -19,7 +19,7 @@
"vue-cropperjs": "^3.0.0", "vue-cropperjs": "^3.0.0",
"vue-pdf": "^4.3.0", "vue-pdf": "^4.3.0",
"vue-quill-editor": "^3.0.6", "vue-quill-editor": "^3.0.6",
"vue-router": "^3.0.3", "vue-router": "^3.5.1",
"vue-schart": "^2.0.0", "vue-schart": "^2.0.0",
"vuedraggable": "^2.17.0", "vuedraggable": "^2.17.0",
"vuex": "^3.1.2" "vuex": "^3.1.2"

@ -14,7 +14,7 @@ import store from './store'
import config from '@/config' import config from '@/config'
import { systemStatus, systemTypeStatus, systemAttributionStatus, courseTypeStatus, import { systemStatus, systemTypeStatus, systemAttributionStatus, courseTypeStatus,
hoursStatus, roleStatus, orderTypeFn, orderStatusFn, orderNatureFn, Percentage, removeByValue, isIE, encodeString, formatDate } from './utils/core'; hoursStatus, roleStatus, orderTypeFn, orderStatusFn, orderNatureFn, Percentage, removeByValue, isIE, encodeString, formatDate } from './utils/core';
import preventReClick from './store/preventReClick' //防多次点击,重复提交 import preventReClick from './utils/preventReClick' //防多次点击,重复提交
Vue.prototype.api = api; Vue.prototype.api = api;
@ -42,16 +42,7 @@ Vue.prototype.formatDate = formatDate;
Vue.config.productionTip = false; Vue.config.productionTip = false;
Vue.use(ElementUI); Vue.use(ElementUI);
//使用钩子函数对路由进行权限跳转
router.beforeEach((to, from, next) => {
document.title = `${to.meta.title} | ${config.title}`;
const role = localStorage.getItem('ms_username');
if (!role && to.path !== '/login') {
next('/login');
} else {
next();
}
});
new Vue({ new Vue({
router, router,

@ -113,7 +113,12 @@ let router = new Router({
router.beforeEach(function(to,from,next){ router.beforeEach(function(to,from,next){
// 根据路由元信息设置文档标题 // 根据路由元信息设置文档标题
window.document.title = to.meta.title || '中台' window.document.title = to.meta.title || '中台'
next() //使用钩子函数对路由进行权限跳转
if (!sessionStorage.getItem('token') && to.path !== '/login') {
next('/login');
} else {
next();
}
}) })
export default router export default router

@ -1,11 +1,23 @@
let host = 'http://39.108.250.202' // let host = 'http://39.108.250.202'
let host1 = 'http://192.168.31.151:9000'//榕 let host1 = 'http://192.168.31.151:9000'//榕
let host2 = 'http://192.168.31.125:9000'//林 let host2 = 'http://192.168.31.125:9000'//林
let host3 = 'http://192.168.31.140:9000'//7 let host3 = 'http://192.168.31.140:9000'//7
let host = 'http://192.168.31.137:9000'// 陈赓
export default { export default {
logins: `${host}/liuwanr/userInfo/adminLogins`, //登录 logins: `${host}/users/user/login`, //登录
verification:`${host}/users/user/captcha`,// 验证码
// 订单管理
orderAdd:`${host}/nakadai/order/add`,// 订单添加
orderDelete:`${host}/nakadai/order/delete`,// 删除定单
orderDetail:`${host}/nakadai/order/get`,// 订单详情
orderList:`${host}/nakadai/order/list`,// 订单列表
orderUpdate:`${host}/nakadai/order/update`,// 订单更新
addUser: `${host}/liuwanr/userInfo/addUser`, //增加用户新版
queryUser: `${host}/liuwanr/userInfo/queryUserInfo`, //查询用户新版 queryUser: `${host}/liuwanr/userInfo/queryUserInfo`, //查询用户新版
deleteUser: `${host}/liuwanr/userInfo/deleteUserInfo`, //删除用户新版 deleteUser: `${host}/liuwanr/userInfo/deleteUserInfo`, //删除用户新版
queryAccountIsExist: `${host}/liuwanr/userInfo/queryServerAccountIsExist`, //查询账号是否存在 queryAccountIsExist: `${host}/liuwanr/userInfo/queryServerAccountIsExist`, //查询账号是否存在
@ -102,23 +114,23 @@ export default {
downloadFiles: `${host}/liuwanr/aliyun/downloadFiles`, //下载文件 downloadFiles: `${host}/liuwanr/aliyun/downloadFiles`, //下载文件
// 数据管理 // 数据管理
getIdQueryTable:`${host1}/data/table/getIdQueryTable`, getIdQueryTable:`${host}/data/table/getIdQueryTable`,
getTableByClassification:`${host1}/data/table/getTableByClassification`, getTableByClassification:`${host}/data/table/getTableByClassification`,
getTableByCondition:`${host1}/data/table/getTableByCondition`, getTableByCondition:`${host}/data/table/getTableByCondition`,
originalList:`${host1}/data/table/originalList`, originalList:`${host}/data/table/originalList`,
originalListById:`${host1}/data/table/originalListById`, originalListById:`${host}/data/table/originalListById`,
saveCategory:`${host1}/data/table/saveCategory`, saveCategory:`${host}/data/table/saveCategory`,
saveTable:`${host1}/data/table/saveTable`, saveTable:`${host}/data/table/saveTable`,
updateCategory:`${host1}/data/table/updateCategory`, updateCategory:`${host}/data/table/updateCategory`,
deleteCategory:`${host1}/data/table/deleteCategory`, deleteCategory:`${host}/data/table/deleteCategory`,
deleteTable:`${host1}/data/table/deleteTable`, deleteTable:`${host}/data/table/deleteTable`,
previewData:`${host2}/data/preview`, previewData:`${host}/data/preview`,
// 产品管理 // 产品管理
deleteProduct:`${host1}/data/product/delete`, deleteProduct:`${host}/data/product/delete`,
findById:`${host1}/data/product/findById`, findById:`${host}/data/product/findById`,
listByEntity:`${host1}/data/product/listByEntity`, listByEntity:`${host}/data/product/listByEntity`,
saveProduct:`${host1}/data/product/save`, saveProduct:`${host}/data/product/save`,
updateProduct:`${host1}/data/product/update`, updateProduct:`${host}/data/product/update`,
saveRecord:`${host1}/data/dataRecord/saveRecord`, saveRecord:`${host}/data/dataRecord/saveRecord`,
} }

@ -21,7 +21,7 @@ axios.defaults.headers.post['Content-Type'] = 'application/json;charset=UTF-8';
// 请求拦截器 // 请求拦截器
axios.interceptors.request.use(config => { axios.interceptors.request.use(config => {
let token = store.state.loginToken let token = sessionStorage.getItem('token')
if(token){ if(token){
config.headers.token = token config.headers.token = token
} }
@ -102,7 +102,8 @@ axios.interceptors.request.use(config => {
function logouts(){ function logouts(){
store.replaceState({}) store.replaceState({})
localStorage.removeItem('ms_username') localStorage.clear()
sessionStorage.clear()
location.reload() location.reload()
} }
@ -276,9 +277,9 @@ export function post(url, params) {
this.$message.error( this.$message.error(
res.data.errmessage res.data.errmessage
); );
router.replace({ // router.replace({
path: '/404', // path: '/404',
}); // });
break; break;
case 403: case 403:
this.$message.error( this.$message.error(

@ -10,19 +10,30 @@
<div class="ms-title"> <div class="ms-title">
<p class="title">账号登录</p> <p class="title">账号登录</p>
<el-form :model="param" :rules="rules" ref="login" label-width="0px" style="margin-top: 40px"> <el-form :model="param" :rules="rules" ref="login" label-width="0px" style="margin-top: 40px">
<el-form-item prop="username"> <el-form-item prop="account">
<el-input v-model="param.username" placeholder="username"></el-input> <el-input @blur="blur" v-model="param.account" placeholder="请输入账号"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="password"> <el-form-item prop="password">
<el-input <el-input
type="password" type="password"
placeholder="password" placeholder="请输入密码"
v-model="param.password" v-model="param.password"
>
</el-input>
</el-form-item>
<el-form-item prop="code">
<el-input
placeholder="请输入验证码"
v-model="param.code"
@keyup.enter.native="submitForm()" @keyup.enter.native="submitForm()"
> >
</el-input> </el-input>
<img style="cursor: pointer;" @click="blur" :src="verificationIMG" class="verification" alt="">
</el-form-item> </el-form-item>
<div style="width:100%;display:flex;justify-content: flex-end;">
<el-button type="text" class="forget">忘记密码?</el-button> <el-button type="text" class="forget">忘记密码?</el-button>
</div>
<div class="login-btn"> <div class="login-btn">
<el-button type="primary" @click="submitForm()">马上登录</el-button> <el-button type="primary" @click="submitForm()">马上登录</el-button>
</div> </div>
@ -39,54 +50,67 @@ export default {
data: function() { data: function() {
return { return {
param: { param: {
username: '13444444444', account: '0621Stu',
password: '111aaa', password: '111aaa',
code:'',
platform:3,
random:''
}, },
rules: { rules: {
username: [{ required: true, message: '请输入用户名', trigger: 'blur' }], account: [{ required: true, message: '请输入用户名', trigger: 'blur' }],
password: [{ required: true, message: '请输入密码', trigger: 'blur' }], password: [{ required: true, message: '请输入密码', trigger: 'blur' }],
code: [{ required: true, message: '请输入验证码', trigger: 'blur' }],
}, },
activeName: 'first' activeName: 'first',
verificationIMG:''
}; };
}, },
components: { components: {
vFooter vFooter
}, },
created(){
this.blur()
},
methods: { methods: {
submitForm() { submitForm() {
this.$refs.login.validate(valid => { this.$refs.login.validate(valid => {
if (valid) { if (valid) {
let data = { this.$post(this.api.logins,this.param).then(res => {
account: this.param.username, this.$message.success(res.message);
password: this.param.password, sessionStorage.setItem('token',res.data.token)
source: 0 this.$router.push({
} path:'/customer'
this.$post(this.api.logins,data).then(res => { });
if(res.message.retvalue.roleId == 1){
let user = res.message.retvalue
this.$message.success('登录成功');
localStorage.setItem('ms_username', this.param.username); localStorage.setItem('ms_username', this.param.username);
this.$store.commit("userLoginData", { userLogin_id : user.userId,userName: user.userName,roleId: user.roleId}); //
this.$store.commit("tokenData", {loginToken: res.message.retvalue.loginToken}) // let user = res.message.retvalue
this.$router.push('/customer'); // this.$store.commit("userLoginData", { userLogin_id : user.userId,userName: user.userName,roleId: user.roleId});
}else{ }).catch(res => {
this.$message.error('该用户没有权限'); this.$message.error(res.message)
} });
}).catch(res => {});
} else { } else {
this.$message.error('请输入账号和密码'); this.$message.error('请输入账号/密码/验证码');
return false; return false;
} }
}); });
}, },
handleClick(tab, event) { handleClick(tab, event) {
console.log(tab, event); console.log(tab, event);
},
blur(){
if(!this.param.account){
return this.verificationIMG = ''
}
this.param.random = Math.floor(Math.random()*999999999)
this.verificationIMG = this.api.verification+'?random='+`${this.param.random}`
} }
}, },
}; };
</script> </script>
<style scoped> <style scoped lang="scss">
.login-wrap { .login-wrap {
position: relative; position: relative;
width: 100%; width: 100%;
@ -133,11 +157,13 @@ export default {
font-weight:bold; font-weight:bold;
} }
.forget{ .forget{
width: 100%;
margin-bottom: 28px; margin-bottom: 28px;
text-align: right; text-align: right;
color: #999; color: #999;
font-weight:bold; font-weight:bold;
&:hover{
color: #0092FF;
}
} }
.thirdParty{ .thirdParty{
width: 100%; width: 100%;
@ -180,5 +206,11 @@ img{
width:80px; width:80px;
margin-right: 30px; margin-right: 30px;
} }
.verification{
position: absolute;
top: 1px;
right: 1px;
width: 160px;
height: 78px;
}
</style> </style>

@ -69,11 +69,11 @@
</el-table-column> </el-table-column>
<el-table-column prop="customerName" label="客户名称" align="center"> <el-table-column prop="customerName" label="客户名称" align="center">
</el-table-column> </el-table-column>
<!-- <el-table-column prop="orderName" label="产品内容" align="center"> <el-table-column prop="orderName" label="产品内容" align="center">
</el-table-column> --> </el-table-column>
<el-table-column prop="orderAmount" label="订单金额" align="center"> <el-table-column prop="orderAmount" label="订单金额" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="orderDate" label="订单日期" align="center"> <el-table-column prop="createTime" label="订单日期" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="orderType" label="订单类型" align="center"> <el-table-column prop="orderType" label="订单类型" align="center">
</el-table-column> </el-table-column>
@ -84,9 +84,9 @@
<el-table-column label="操作" align="center"> <el-table-column label="操作" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="edit(scope.row)">编辑</el-button> <el-button type="text" @click="edit(scope.row)">编辑</el-button>
<el-button type="text" @click="handle('watch',scope.row)">查看</el-button>
<el-button type="text" @click="handleDelete(scope.row)">删除</el-button> <el-button type="text" @click="handleDelete(scope.row)">删除</el-button>
<!-- 接口无 --> <el-button type="text" @click="handleRenew(scope.row)">续费</el-button>
<el-button v-if="false" type="text" @click="handleRenew(scope.row)">续费</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -140,28 +140,29 @@ export default {
totals: 1 totals: 1
}; };
}, },
mounted() { created() {
this.getData() this.getData()
}, },
methods: { methods: {
getData() { getData() {
let data = { let data = {
provinceId: this.form.provinces,
cityId: this.form.city, cityId: this.form.city,
orderType: this.form.orderType, customerName:this.keyword,
orderStatus: this.form.orderStatus, orderStatus: this.form.orderStatus,
searchContent: this.keyword, orderType: this.form.orderType,
pageNo: this.pageNo, pageNo: this.pageNo,
pageSize: this.pageSize pageSize: this.pageSize,
provinceId: this.form.provinces,
} }
this.$get(this.api.queryOrder,data).then(res => { this.$post(this.api.orderList,data).then(res => {
res.message.rows.forEach(e => { console.log(res,'list');
res.orderPage.records.forEach(e => {
e.orderType = this.orderTypeFn(e.orderType) e.orderType = this.orderTypeFn(e.orderType)
e.orderStatus = this.orderStatusFn(e.orderStatus) e.orderStatus = this.orderStatusFn(e.orderStatus)
e.orderNature = this.orderNatureFn(e.orderNature) e.orderNature = this.orderNatureFn(e.orderNature)
}) })
this.orderData = res.message.rows this.orderData = res.orderPage.records
this.totals = res.message.total this.totals =res.orderPage.total
}).catch(res => {}); }).catch(res => {});
}, },
// //

Loading…
Cancel
Save