Compare commits

..

10 Commits

  1. 1
      README.md
  2. 43
      public/index.html
  3. 98
      src/api/index.js
  4. BIN
      src/assets/img/index/customer.png
  5. BIN
      src/assets/img/index/index0.png
  6. BIN
      src/assets/img/index/sug.png
  7. BIN
      src/assets/img/index/tel-1.png
  8. BIN
      src/assets/img/index/tel-2.png
  9. BIN
      src/assets/img/index/tel.png
  10. BIN
      src/assets/img/index/top-1.png
  11. BIN
      src/assets/img/index/top.png
  12. BIN
      src/assets/img/index/wechat-1.png
  13. BIN
      src/assets/img/index/wechat.png
  14. 77
      src/layouts/footer/index.vue
  15. 312
      src/layouts/header/index.vue
  16. 6
      src/libs/util.js
  17. 1178
      src/pages/account/login/index.vue
  18. 16
      src/pages/data/list/index.vue
  19. 186
      src/pages/index/list/index.vue
  20. 2
      src/pages/role/list/index.vue
  21. 2241
      src/pages/screen/list/index.vue
  22. 2
      src/pages/user/list/index.vue
  23. 309
      src/plugins/requests/index.js
  24. 152
      src/setting.js
  25. 177
      src/store/modules/user.js
  26. 3
      vue.config.js

@ -0,0 +1 @@
# 数据前瞻平台前端

@ -1,18 +1,31 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
<link rel="stylesheet" href="//at.alicdn.com/t/font_830376_qzecyukz0s.css">
<title>数据前瞻</title>
</head>
<body>
<noscript>
<strong>We're sorry but vms doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="keywords" content="数据前瞻,数据平台,金融数据,宏观数据,行业经济数据" />
<meta
name="description"
content="数据前瞻涵盖股票数据,期货数据,债券数据,期权数据,利率数据,公募数据和宏观数据,拥有超40年的历史数据,可为您解读、预测、分析,模拟市场趋势、经济周期和世界事件影响提供必要的数据支持。我们的数据均来源于各大专业财经权威网站和数据官方发布平台,并经过专业的数据分类和整理,可让用户轻松便捷地搜索并批量下载到自己研究所需的数据,极大地减轻自己搜索整理数据的时间,提高研究效率, 从而高效的输出研究成果。"
/>
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<link rel="stylesheet" href="//at.alicdn.com/t/font_830376_qzecyukz0s.css" />
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement('script');
hm.src = 'https://hm.baidu.com/hm.js?26fbe82e56d2f1aeeb09fe697c4434d5';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<title>数据前瞻——准确、海量、易用的财经数据平台</title>
</head>
<body>
<noscript>
<strong>We're sorry but vms doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

@ -3,19 +3,20 @@ const host = Setting.apiBaseURL
export default {
// 登录注册
logins: `users/users/user/login`,
verification:`${host}users/users/user/captcha`,
logins: `users/users/user/login`,
verification: `${host}users/users/user/captcha`,
sendPhoneVerificationCode: `users/users/user/sendPhoneVerificationCode`,
getToken: `users/users/user/getToken`,
getOtherAccountByPhone: `users/users/user/getOtherAccountByPhone`,
unbindAccounts: `users/users/user/unbindAccounts`,
logout: `users/users/user/logout`,
// 加密货币
market: `/topic/market`,
getTopList: `${Setting.cryptoBaseURL}currency/market/getTopList`,
platformLogList: `nakadai/log/platformLogList`,
logNotification: `nakadai/log/logNotification`,
platformLogList: `nakadai/nakadai/log/platformLogList`,
logNotification: `nakadai/nakadai/log/logNotification`,
// 公用接口
queryProvince: `nakadai/nakadai/province/queryProvince`,
queryCity: `nakadai/nakadai/city/queryCity`,
@ -29,70 +30,69 @@ export default {
// 个人中心
uploadUserAvatars: `${host}users/users/userAccount/updateUserAvatars`,
userInfo:`users/users/userInfo/getUserInfo`,
updateUser:`users/users/userInfo/updateUser`,
findPasswordByEmail:`users/users/userAccount/findPasswordByEmail`,
findPasswordByPhone:`users/users/userAccount/findPasswordByPhone`,
userInfo: `users/users/userInfo/getUserInfo`,
updateUser: `users/users/userInfo/updateUser`,
findPasswordByEmail: `users/users/userAccount/findPasswordByEmail`,
findPasswordByPhone: `users/users/userAccount/findPasswordByPhone`,
// 用户管理
saveUser: `users/users/data/user/save`,
getDetailByAccount: `occupationlab/architecture/getDetailByAccount`,
getDetailByAccount: `occupationlab/occupationlab/architecture/getDetailByAccount`,
getUserList: `users/users/data/user/getUserList`,
getUserTotalBySchoolId: `users/users/data/user/getUserTotalBySchoolId`,
checkAccount:`occupationlab/architecture/checkWorkNumOrAccount`,
getDetail:`users/users/data/user/getDetail`,
modifyUser:`users/users/data/user/modify`,
export_failure:`${host}users/users/data/user/export_failure`,
uploadFile:`${host}users/users/data/user/uploadFile`,
deleteUser:`users/users/data/user/delete`,
checkAccount: `occupationlab/occupationlab/architecture/checkWorkNumOrAccount`,
getDetail: `users/users/data/user/getDetail`,
modifyUser: `users/users/data/user/modify`,
export_failure: `${host}users/users/data/user/export_failure`,
uploadFile: `${host}users/users/data/user/uploadFile`,
deleteUser: `users/users/data/user/delete`,
resetPwd: `users/users/userAccount/resetPwd`,
sendPhoneOrEmailCode: `users/users/userAccount/sendPhoneOrEmailCode`,
unbindMobilePhone: `users/users/userAccount/unbindMobilePhone`,
bindPhoneOrEmail: `users/users/userAccount/bindPhoneOrEmail`,
examinePassword: `users/users/userAccount/examinePassword`,
isClient: `${host}users/users/user/isClient`,
deleteProfile: `users/users/userInfo/deleteProfile`,
checkEmailOrPhone: `occupationlab/architecture/checkEmailOrPhone`,
checkEmailOrPhone: `occupationlab/occupationlab/architecture/checkEmailOrPhone`,
accountIsDisabled: `users/users/user/accountIsDisabled`,
userTemplate: `http://39.108.250.202/template/%E6%95%B0%E6%8D%AE%E5%B9%B3%E5%8F%B0%E7%94%A8%E6%88%B7%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx`,
userTemplate: `http://121.37.12.51/template/%E6%95%B0%E6%8D%AE%E5%B9%B3%E5%8F%B0%E7%94%A8%E6%88%B7%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx`,
// 角色管理
batchRemove:`users/role/batchRemove`,
getRole:`users/role/obtainDetails`,
getName:`data/data/role/getName`,
listRole:`users/role/list`,
removeRole:`data/data/role/remove`,
saveOrUpdate:`users/role/saveOrUpdate`,
getPermissions:`users/user-role/getUserRolesPermissionMenu`,
batchRemove: `users/users/role/batchRemove`,
getRole: `users/users/role/obtainDetails`,
getName: `data/data/role/getName`,
listRole: `users/users/role/list`,
removeRole: `data/data/role/remove`,
saveOrUpdate: `users/users/role/saveOrUpdate`,
getPermissions: `users/users/user-role/getUserRolesPermissionMenu`,
// 权限菜单管理
doAssign:`data/data/permission/doAssign`,
queryAllMenus:`users/users/permission/queryAllMenus`,
savePer:`users/user-role/rolePermissionService`,
toAssign:`data/data/permission/toAssign`,
doAssign: `data/data/permission/doAssign`,
queryAllMenus: `users/users/permission/queryAllMenus`,
savePer: `users/users/user-role/rolePermissionService`,
toAssign: `data/data/permission/toAssign`,
// 表展示
getIdQueryTable:`data/data/table/getIdQueryTable`,
getTableByClassification:`data/data/table/getTableByClassification`,
getTableByCondition:`data/data/table/getTableByCondition`,
downloadData:`${host}data/data/download`,
previewData:`data/data/preview`,
visualPreview:`data/data/visualPreview`,
downloadRecord:`data/data/myDownload/downloadRecord`,
getDownloadRecord:`data/data/myDownload/getDownloadRecord`,
downloadAgain:`data/data/downloadAgain`,
isDownload:`data/data/product/isDownload`,
getTableTime:`data/data/tableTime/getTableTime`,
getLevel: `data/category/getLevel`,
getIdQueryTable: `data/data/table/getIdQueryTable`,
getTableByClassification: `data/data/table/getTableByClassification`,
getTableByCondition: `data/data/table/getTableByCondition`,
downloadData: `${host}data/data/download`,
previewData: `data/data/preview`,
visualPreview: `data/data/visualPreview`,
downloadRecord: `data/data/myDownload/downloadRecord`,
getDownloadRecord: `data/data/myDownload/getDownloadRecord`,
downloadAgain: `data/data/downloadAgain`,
isDownload: `data/data/product/isDownload`,
getTableTime: `data/data/tableTime/getTableTime`,
getLevel: `data/data/category/getLevel`,
multipleTablePreview: `data/data/multipleTablePreview`,
// 数据操作记录
queryAccumulate:`data/data/dataRecord/queryAccumulate`,
queryDatabaseInfo:`data/data/dataRecord/queryDatabaseInfo`,
queryDatabaseInfoByMonth:`data/data/dataRecord/queryDatabaseInfoByMonth`,
saveRecord:`data/data/dataRecord/saveRecord`,
databaseInfoExport:`${host}data/data/dataRecord/databaseInfoExport`,
databaseInfoByMonthExport:`${host}data/data/dataRecord/databaseInfoByMonthExport`,
onlineNumber:`data/data/dataRecord/onlineNumber`,
getProductInfoBySchoolId:`data/data/product/getProductInfoBySchoolId`,
queryAccumulate: `data/data/dataRecord/queryAccumulate`,
queryDatabaseInfo: `data/data/dataRecord/queryDatabaseInfo`,
queryDatabaseInfoByMonth: `data/data/dataRecord/queryDatabaseInfoByMonth`,
saveRecord: `data/data/dataRecord/saveRecord`,
databaseInfoExport: `${host}data/data/dataRecord/databaseInfoExport`,
databaseInfoByMonthExport: `${host}data/data/dataRecord/databaseInfoByMonthExport`,
onlineNumber: `data/data/dataRecord/onlineNumber`,
getProductInfoBySchoolId: `data/data/product/getProductInfoBySchoolId`,
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 602 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 919 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 861 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 543 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 587 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 884 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 977 B

@ -6,58 +6,59 @@
* @Description: In User Settings Edit
-->
<template>
<div class="footer">
<div class="info">
<span class="m-r-20">客服邮箱service@huorantech.cn</span>
<span>联系人孙经理 18565785395</span>
</div>
<div class="copyright">
<span>© Copyright 2021 Dataforward 数据前瞻</span>
<a href="https://beian.miit.gov.cn/#/Integrated/index" target="_blank">粤ICP备20072679号</a>
</div>
<div class="footer">
<div class="info">
<!-- <span class="m-r-20">客服邮箱service@huorantech.cn</span> -->
<span>联系人金经理 15218726836</span>
</div>
<div class="copyright">
<span>© Copyright 2021 Dataforward 数据前瞻</span>
<a href="https://beian.miit.gov.cn/#/Integrated/index"
target="_blank">粤ICP备20072679号</a>
</div>
</div>
</template>
<script>
export default {
data() {
return {
data () {
return {
};
},
mounted(){
};
},
mounted () {
},
methods: {
},
methods: {
},
},
};
</script>
<style lang="scss" scoped>
.footer{
padding: 17px 0 9px;
.footer {
padding: 17px 0 9px;
text-align: center;
background-color: #0f1d2e;
.info {
margin-bottom: 7px;
font-size: 14px;
line-height: 20px;
color: #d7dfe7;
}
.copyright {
font-size: 12px;
text-align: center;
background-color: #0F1D2E;
.info{
margin-bottom: 7px;
font-size: 14px;
line-height: 20px;
color: #D7DFE7;
line-height: 17px;
span {
margin-right: 20px;
color: #757f8a;
}
.copyright{
a {
color: #757f8a;
font-size: 12px;
text-align: center;
line-height: 17px;
span{
margin-right: 20px;
color: #757F8A;
}
a{
color:#757F8A;
font-size: 12px;
&:hover{
color: #c7c7c7;
}
&:hover {
color: #c7c7c7;
}
}
}
}
</style>

@ -1,52 +1,55 @@
<template>
<div class="header">
<a class="logo" @click="toIndex">
<img src="@/assets/img/logo.png" alt="">
</a>
<div class="inner">
<div style="height: 64px;"></div>
<navbar ref="nav" @hideSetting="hideSetting"></navbar>
<div class="action" v-if="token">
<img v-if="showSetting" class="icon m-r-20" src="../../assets/img/setting.png" alt="" @click="toManager">
<el-dropdown class="user-wrap" @command="userCommand">
<div class="user">
<el-avatar :size="40" :src="avatar"></el-avatar>
<span class="username">{{userName}}</span>
</div>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="person" v-if="!isCustomer">个人资料</el-dropdown-item>
<template v-else>
<el-dropdown-item command="resetPw">修改密码</el-dropdown-item>
<el-dropdown-item command="myDownload">我的下载</el-dropdown-item>
</template>
<el-dropdown-item command="logout">退出登录</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
<div class="login" v-else-if="!isLogin" @click="toLogin">
<img src="@/assets/img/user.png" alt="">
<span>登录</span>
</div>
</div>
<el-dialog title="修改密码" :visible.sync="passwordVisible" :close-on-click-modal="false" :append-to-body="true" @close="closePassword" width="30%">
<el-form ref="passwordForm" label-width="82px">
<el-form-item label="原密码">
<el-input type="password" v-model="passwordForm.password" placeholder="请输入原密码"></el-input>
</el-form-item>
<el-form-item label="新密码">
<el-input type="password" v-model="passwordForm.newPassword" placeholder="请输入新密码" @keyup.enter.native="editPassword"></el-input>
</el-form-item>
<el-form-item label="确认新密码">
<el-input type="password" v-model="passwordForm.reNewPassword" placeholder="请确认新密码" @keyup.enter.native="editPassword"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="passwordVisible = false"> </el-button>
<el-button size="small" type="primary" @click="editPassword"> </el-button>
</span>
</el-dialog>
<div class="header">
<a class="logo" @click="toIndex">
<img src="@/assets/img/logo.png" alt="">
</a>
<div class="inner">
<div style="height: 64px;"></div>
<navbar ref="nav" @hideSetting="hideSetting"></navbar>
<div class="action" v-if="token">
<img v-if="showSetting" class="icon m-r-20" src="../../assets/img/setting.png" alt="" @click="toManager">
<el-dropdown class="user-wrap" @command="userCommand">
<div class="user">
<el-avatar :size="40" :src="avatar"></el-avatar>
<span class="username">{{ userName }}</span>
</div>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="person" v-if="!isCustomer">个人资料</el-dropdown-item>
<template v-else>
<el-dropdown-item command="resetPw">修改密码</el-dropdown-item>
<el-dropdown-item command="myDownload">我的下载</el-dropdown-item>
</template>
<el-dropdown-item command="logout">退出登录</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
<div class="login" v-else-if="!isLogin" @click="toLogin">
<img src="@/assets/img/user.png" alt="">
<span>登录</span>
</div>
</div>
<el-dialog title="修改密码" :visible.sync="passwordVisible" :close-on-click-modal="false" :append-to-body="true"
@close="closePassword" width="30%">
<el-form ref="passwordForm" label-width="82px">
<el-form-item label="原密码">
<el-input type="password" v-model="passwordForm.password" placeholder="请输入原密码"></el-input>
</el-form-item>
<el-form-item label="新密码">
<el-input type="password" v-model="passwordForm.newPassword" placeholder="请输入新密码"
@keyup.enter.native="editPassword"></el-input>
</el-form-item>
<el-form-item label="确认新密码">
<el-input type="password" v-model="passwordForm.reNewPassword" placeholder="请确认新密码"
@keyup.enter.native="editPassword"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="passwordVisible = false"> </el-button>
<el-button size="small" type="primary" @click="editPassword"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import navbar from '../navbar'
@ -54,7 +57,7 @@ import { mapState, mapMutations, mapActions } from 'vuex'
import Setting from '@/setting'
import util from '@/libs/util'
export default {
data() {
data () {
return {
token: util.local.get(Setting.tokenKey),
isLogin: this.$route.path == '/login',
@ -79,7 +82,7 @@ export default {
'routes'
])
},
mounted() {
mounted () {
// ,store,,
if (this.customer) {
let customer = atob(decodeURI(this.customer)) == 'false' ? false : true
@ -104,7 +107,7 @@ export default {
'setInfo', 'logout', 'setManager', 'setCustomer'
]),
//
getUserInfo() {
getUserInfo () {
this.$get(this.api.userInfo).then(res => {
let userInfo = res.userInfo ? res.userInfo : {}
let userAccount = res.userAccount
@ -114,16 +117,12 @@ export default {
avatar: userInfo.userAvatars,
userName: userInfo.userName
})
//
userInfo.userName || this.$get(this.api.isClient).then(res => {
res.customerName && this.setInfo({userName: res.customerName})
}).catch(res => {})
}).catch(err => { })
},
hideSetting() {
hideSetting () {
this.showSetting = false
},
toIndex() {
toIndex () {
//
if (this.$route.path === '/index/list') {
location.reload()
@ -132,11 +131,11 @@ export default {
this.showSetting = true
}
},
toLogin() {
toLogin () {
window.open(this.$router.resolve('/login').href)
},
//
toManager() {
toManager () {
let routes = this.routes
if (routes.length) {
let route = this.$router.resolve({
@ -154,7 +153,7 @@ export default {
util.warningMsg('该角色未开放模块,请联系管理员')
}
},
userCommand(command) {
userCommand (command) {
if (command == 'person') {
this.$router.push('/setting/person').catch(err => { })
} else if (command == 'resetPw') {
@ -165,10 +164,10 @@ export default {
this.logout()
}
},
showPassword() {
showPassword () {
this.passwordVisible = true
},
editPassword() {
editPassword () {
if (!this.passwordForm.password) return util.warningMsg('请输入原密码')
if (!this.passwordForm.newPassword) return util.warningMsg('请输入新密码')
if (!this.passwordForm.reNewPassword) return util.warningMsg('请确认新密码')
@ -183,7 +182,7 @@ export default {
this.passwordVisible = false
}).catch(err => { })
},
closePassword() {
closePassword () {
this.passwordForm = {
password: '',
newPassword: '',
@ -195,102 +194,125 @@ export default {
</script>
<style lang="scss" scoped>
$height: 64px;
.header{
z-index: 10;
position: fixed;
.header {
z-index: 10;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: $height;
background-color: #fff;
box-shadow: 0px 0px 6px 0px rgba(178, 178, 178, 0.32);
.inner {
display: flex;
justify-content: space-between;
align-items: center;
min-width: $min-width;
padding: 0 80px 0 10px;
margin: 0 auto;
}
.logo {
position: absolute;
top: 0;
left: 0;
width: 100%;
left: 80px;
font-size: 28px;
color: #568DF2;
line-height: $height;
cursor: pointer;
}
.search {
z-index: 2;
position: absolute;
top: 0;
left: 70%;
transform: translate(-50%);
display: flex;
justify-content: space-between;
align-items: center;
width: 300px;
height: $height;
padding: 7px 20px;
margin: 0 auto;
background-color: #fff;
box-shadow: 0px 0px 6px 0px rgba(178, 178, 178, 0.32);
.inner{
display: flex;
justify-content: space-between;
align-items: center;
min-width: $min-width;
padding: 0 80px 0 10px;
margin: 0 auto;
input {
width: 195px;
margin-left: 10px;
font-size: 14px;
color: #333;
background-color: transparent;
border: 0;
&::-webkit-input-placeholder {
color: #999
}
&::-moz-placeholder {
color: #999
}
&:-moz-placeholder {
color: #999
}
&:focus {
outline: none;
}
}
.logo{
position: absolute;
top: 0;
left: 80px;
font-size: 28px;
color: #568DF2;
line-height: $height;
cursor: pointer;
.remove {
cursor: pointer;
}
.search{
z-index: 2;
position: absolute;
top: 0;
left: 70%;
transform: translate(-50%);
display: flex;
justify-content: space-between;
align-items: center;
width: 300px;
height: $height;
padding: 7px 20px;
margin: 0 auto;
background-color: #fff;
input{
width: 195px;
margin-left: 10px;
font-size: 14px;
color: #333;
background-color: transparent;
border: 0;
&::-webkit-input-placeholder{color: #999}
&::-moz-placeholder{color: #999}
&:-moz-placeholder{color: #999}
&:focus{
outline: none;
}
}
.remove{
cursor: pointer;
}
.search-icon{
width: 18px;
}
.search-icon {
width: 18px;
}
.action{
display: inline-flex;
align-items: center;
.icon{
cursor: pointer;
}
.user-wrap {
display: inline-flex;
align-items: center;
}
.user{
display: inline-flex;
align-items: center;
cursor: pointer;
.username{
margin-left: 10px;
color: #000;
font-size: 16px;
}
}
}
.action {
display: inline-flex;
align-items: center;
.icon {
cursor: pointer;
}
.login{
.user-wrap {
display: inline-flex;
align-items: center;
.user {
display: inline-flex;
align-items: center;
cursor: pointer;
&:hover{
opacity: .9;
}
span{
margin-left: 5px;
color: #666;
font-size: 14px;
.username {
margin-left: 10px;
color: #000;
font-size: 16px;
}
}
}
}
.login {
display: inline-flex;
align-items: center;
cursor: pointer;
&:hover {
opacity: .9;
}
span {
margin-left: 5px;
color: #666;
font-size: 14px;
}
}
}
</style>

@ -121,15 +121,15 @@ const util = {
},
// 成功提示
successMsg(message,duration = 1500) {
return Message.success({message,showClose: true,offset: (document.documentElement.clientHeight - 40) / 2,duration})
return Message.success({message,showClose: true,duration})
},
// 警告提示
warningMsg(message,duration = 1500) {
return Message.warning({message,showClose: true,offset: (document.documentElement.clientHeight - 40) / 2,duration})
return Message.warning({message,showClose: true,duration})
},
// 错误提示
errorMsg(message,duration = 1500) {
return Message.error({message,showClose: true,offset: (document.documentElement.clientHeight - 40) / 2,duration})
return Message.error({message,showClose: true,duration})
},
}

File diff suppressed because it is too large Load Diff

@ -18,17 +18,17 @@
<div class="source"><img src="@/assets/img/data2.png" alt=""> 数据来源{{dataSource}}</div>
<div class="page-content">
<el-table :data="listData" class="table" ref="table" stripe header-align="center" row-key="id" highlight-current-row @current-change="previewCurrentChange">
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="showName" label="数据表名称" min-width="300" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column prop="showName" label="数据表名称" min-width="220" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="dataTotal" label="数据总量" width="90" align="center"></el-table-column>
<el-table-column prop="timeRange" label="起止时间" width="220" align="center"></el-table-column>
<el-table-column prop="timeRange" label="起止时间" width="175" align="center"></el-table-column>
<el-table-column prop="dataSize" label="数据大小" width="90" align="center">
<template slot-scope="scope">
{{scope.row.dataSize}}M
</template>
</el-table-column>
<el-table-column prop="updateTime" label="更新时间" width="170" align="center"></el-table-column>
<el-table-column label="操作" width="200" align="center">
<el-table-column prop="updateTime" label="更新时间" width="155" align="center"></el-table-column>
<el-table-column label="操作" width="100" align="center">
<template slot-scope="scope">
<el-button type="text" @click="preview(scope.row)" v-auth>预览</el-button>
<el-button type="text" @click="download(scope.row)" v-auth>下载</el-button>
@ -487,7 +487,8 @@ export default {
display: flex;
padding-bottom: 20px !important;
/deep/.left{
height: calc(100vh - 166px);
width: 239px;
height: calc(100vh - 190px);
margin-right: 20px;
overflow: auto;
&::-webkit-scrollbar {
@ -553,8 +554,7 @@ export default {
}
}
.right{
flex: 1;
max-width: calc(100% - 220px);
width: calc(100% - 260px);
.page{
margin-bottom: 20px;
.source {

@ -1,12 +1,13 @@
<template>
<div class="wrap" :class="{index: !keyword, result: keyword}">
<div class="wrap index" :class="{result: keyword}">
<img class="screen" src="@/assets/img/index/index0.png" alt="首页">
<div class="banner">
<video class="video" ref="video" autoplay muted loop>
<source src="@/assets/video/sky.mp4" type="video/mp4">
您的浏览器不支持 video 标签
</video>
<div class="banner-inner">
<div class="title" v-if="!keyword">准确多元海量数据</div>
<div class="banner-title">准确多元海量数据</div>
<div class="search-wrap">
<div class="search">
<input ref="keyword" v-model="keyword" type="text" placeholder="请输入关键词">
@ -24,22 +25,22 @@
</div>
<div class="list-wrap" v-if="keyword">
<div class="tips">
<p class="result"><img src="@/assets/img/index/search.png" alt=""> 搜索结果</p>
<p class="result-title"><img src="@/assets/img/index/search.png" alt=""> 搜索结果</p>
<p class="num">搜索完成共有{{total}}个结果匹配</p>
</div>
<el-table :data="listData" class="table" ref="table" stripe header-align="center">
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column prop="showName" label="数据表名称" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="timeRange" label="起止日期" width="220" align="center"></el-table-column>
<el-table-column prop="dataTotal" label="数据总量" align="center"></el-table-column>
<el-table-column prop="dataSize" label="数据大小" align="center">
<el-table-column prop="timeRange" label="起止日期" width="180" align="center"></el-table-column>
<el-table-column prop="dataTotal" label="数据总量" width="90" align="center"></el-table-column>
<el-table-column prop="dataSize" label="数据大小" width="80" align="center">
<template slot-scope="scope">
{{scope.row.dataSize}}M
</template>
</el-table-column>
<el-table-column prop="createTime" label="更新时间" align="center"></el-table-column>
<el-table-column label="操作" width="180">
<el-table-column prop="createTime" label="更新时间" width="155" align="center"></el-table-column>
<el-table-column label="操作" width="100">
<template slot-scope="scope">
<el-button type="text" @click="preview(scope.row)">预览</el-button>
<el-button type="text" @click="download(scope.row)">下载</el-button>
@ -231,6 +232,40 @@
<el-button size="small" type="primary" @click="confirmDown">确定</el-button>
</span>
</el-dialog>
<div class="tool">
<div class="item wechat"></div>
<div class="popup wechat-popup">
<p class="tips">微信扫码添加职站售前咨询</p>
<p class="des">提供付费咨询及解决方案</p>
<img width="150" src="@/assets/img/index/customer.png" alt="">
</div>
<div class="item tel"></div>
<div class="popup tel-popup">
<div class="tel-inner">
<div class="line">
<div>
<img class="icon" src="@/assets/img/index/tel-2.png" alt="">
</div>
<div class="text">
<p class="title">售前咨询</p>
<p class="tel-num" style="margin-bottom: 5px">刘老师</p>
<p class="tel-num">18019930142</p>
</div>
</div>
<div class="line">
<div>
<img class="icon" src="@/assets/img/index/sug.png" alt="">
</div>
<div class="text">
<p class="title" @click="toQues">咨询建议与反馈</p>
<p class="des">您的每一条建议声音我们都认真对待</p>
</div>
</div>
</div>
</div>
<div class="item topping" @click="topping"></div>
</div>
</div>
</template>
@ -346,15 +381,13 @@ export default {
},
//
getHot(){
this.$get(this.api.queryDatabaseInfo).then(res => {
let list = res.data
list.map(n => n.download)
this.$get(this.api.queryDatabaseInfo).then(({ data }) => {
//
list.sort((a,b) => {
return b.download - a.download
data.sort((a,b) => {
return b.downloads - a.downloads
})
//
this.hotData = list.slice(0,3)
this.hotData = data.slice(0,3)
}).catch(res => {})
},
initData(){
@ -375,7 +408,7 @@ export default {
// ,
if(this.token){
if (this.routes.find(e => e.path === '/data/list')) {
this.$router.push(`/data?typeId=${row.categoryTwoId}`)
this.$router.push(`/data?typeId=${row.secondId}`)
} else {
this.keyword = row.categoryTwo
}
@ -390,6 +423,15 @@ export default {
this.active = i
document.querySelector(`#part${i}`).scrollIntoView()
},
//
topping() {
document.documentElement.scrollTop = 0
document.body.scrollTop = 0
},
//
toQues() {
window.open('https://www.wjx.cn/vm/wB0RcMm.aspx')
},
preview(row) {
//
if(this.token){
@ -572,6 +614,10 @@ export default {
.wrap{
position: relative;
background-color: #F3F6FA;
.screen {
position: absolute;
top: -1000px;
}
.banner{
position: relative;
height: 518px;
@ -586,7 +632,7 @@ export default {
left: 50%;
transform: translateX(-50%);
}
.title{
.banner-title{
margin-bottom: 37px;
font-size: 45px;
color: #fff;
@ -654,12 +700,11 @@ export default {
}
}
&.result{
.banner{
padding: 46px 0;
}
.tips{
margin-bottom: 22px;
.result{
.result-title{
display: flex;
align-items: center;
margin: 30px 0 10px;
font-size: 17px;
color: $main-color;
@ -998,4 +1043,103 @@ export default {
overflow: auto;
}
}
.tool {
z-index: 10;
position: fixed;
bottom: 100px;
right: 30px;
.item {
width: 45px;
height: 45px;
margin-bottom: 10px;
border: 1px solid #e5e5e5;
cursor: pointer;
}
.wechat {
background: #fff url(../../../assets/img/index/wechat.png) center center/auto no-repeat;
&:hover {
background-image: url(../../../assets/img/index/wechat-1.png);
background-color: #006EFF;
& + .popup {
display: block;
}
}
}
.tel {
background: #fff url(../../../assets/img/index/tel.png) center center/auto no-repeat;
&:hover {
background-image: url(../../../assets/img/index/tel-1.png);
background-color: #006EFF;
& + .popup {
display: block;
}
}
}
.topping {
background: #fff url(../../../assets/img/index/top.png) center center/auto no-repeat;
&:hover {
background-image: url(../../../assets/img/index/top-1.png);
background-color: #006EFF;
}
}
.popup {
position: absolute;
display: none;
}
.wechat-popup {
top: -100px;
left: -230px;
padding: 20px;
text-align: center;
background-color: #fff;
box-shadow: 0px 0px 7px 0px rgba(203, 203, 203, 0.55);
.tips {
font-size: 14px;
}
.des {
margin: 5px 0 15px;
font-size: 12px;
color: #333;
}
}
.tel-popup {
top: -10px;
left: -250px;
width: 250px;
border-right: 20px solid transparent;
&:hover {
display: block;
}
.tel-inner {
padding: 20px;
background-color: #fff;
box-shadow: 0px 0px 7px 0px rgba(203, 203, 203, 0.55);
}
.line {
display: flex;
&:first-child {
margin-bottom: 20px;
}
}
.text {
margin-left: 15px;
}
.title {
margin-bottom: 5px;
font-size: 14px;
cursor: pointer;
&:hover {
color: #006EFF;
}
}
.tel-num {
font-size: 12px;
color: #006EFF;
}
.des {
font-size: 12px;
color: #686868;
}
}
}
</style>

@ -117,7 +117,7 @@ export default {
},
methods: {
getData() {
this.$get(`${this.api.listRole}?page=${this.page}&size=${this.pageSize}&name=${this.keyword}&platformId=${Setting.platformId}`).then(res => {
this.$get(`${this.api.listRole}?page=${this.page}&size=${this.pageSize}&name=${this.keyword}&platformId=${Setting.platformId}&port=0`).then(res => {
this.listData = res.rolePage.records
this.total = res.rolePage.total
if(!this.listData.length && this.total){

File diff suppressed because it is too large Load Diff

@ -310,7 +310,7 @@ export default {
},
//
getRole(){
this.$get(`${this.api.listRole}?page=1&size=1000&name=&platformId=${Setting.platformId}`).then(res => {
this.$get(`${this.api.listRole}?page=1&size=1000&name=&platformId=${Setting.platformId}&port=0`).then(res => {
const list = res.rolePage.records
this.roleList = list
}).catch(res => {})

@ -1,14 +1,15 @@
import axios from 'axios'
import util from '@/libs/util'
import Util from '@/libs/util'
import router from '@/router/index'
import Setting from '@/setting'
import store from '@/store'
import api from '@/api'
import { Message } from 'element-ui'
const baseURL = Setting.apiBaseURL
const service = axios.create({
baseURL,
timeout: 10000000
baseURL,
timeout: 10000000
})
// post请求头
service.defaults.headers.post['Content-Type'] = 'application/json;charset=UTF-8'
@ -17,161 +18,189 @@ let check = true
let checkTimer = null
// 检测账号是否被禁用,如果禁用则提示并退出登录
function checkDisabled () {
const token = util.local.get(Setting.tokenKey)
if (!token) return false
check = false
axios.get(baseURL + api.accountIsDisabled + '?token=' + token, {
token: util.local.get(Setting.tokenKey),
headers: {
token
}
}).then(res => {
if (res.data) {
util.errorMsg('账号被禁用,已强制退出,有疑问请联系管理员')
setTimeout(() => {
store.dispatch('user/logout')
}, 1500)
}
}).catch(res => {})
const token = Util.local.get(Setting.tokenKey)
if (!token) return false
check = false
axios.get(baseURL + api.accountIsDisabled + '?token=' + token, {
token: Util.local.get(Setting.tokenKey),
headers: {
token
}
}).then(res => {
if (res.data.code === 401) {
Util.local.remove(Setting.storeKey)
Util.local.remove(Setting.tokenKey)
Util.errorMsg(res.data.msg.includes('顶') ? '您的账号已在其他设备登录,您已被迫下线!' : '登录过期,请重新登录!')
setTimeout(() => {
location.reload()
}, 1500)
} else if (res.data) {
Util.errorMsg('账号被禁用,已强制退出,有疑问请联系管理员')
setTimeout(() => {
store.dispatch('user/logout')
}, 1500)
}
}).catch(res => { })
}
// 请求拦截器
service.interceptors.request.use(config => {
let token = util.local.get(Setting.tokenKey)
if(token) config.headers.token = token
let storeSchoolId = store.state.user.schoolId
let routeSchoolId = router.app._route.query.schoolId
if(routeSchoolId) routeSchoolId = atob(decodeURI(routeSchoolId))
// 如果store里没有schoolId,则取url里的schoolId,从用户跳转到后台的时候因为加载顺序的问题会出现这个情况,所以要做这个处理
if(storeSchoolId || routeSchoolId) config.headers.schoolId = storeSchoolId ? storeSchoolId : routeSchoolId
clearTimeout(checkTimer)
check && checkDisabled()
checkTimer = setTimeout(() => {
check = true
}, 2000)
return config
},err => {
util.errorMsg({
message: '退出登陆',
onClose: function () {
router.push({name: '/login'})
}
})
return Promise.reject(err)
let token = Util.local.get(Setting.tokenKey)
if (token) config.headers.token = token
let storeSchoolId = store.state.user.schoolId
let routeSchoolId = router.app._route.query.schoolId
if (routeSchoolId) routeSchoolId = atob(decodeURI(routeSchoolId))
// 如果store里没有schoolId,则取url里的schoolId,从用户跳转到后台的时候因为加载顺序的问题会出现这个情况,所以要做这个处理
if (storeSchoolId || routeSchoolId) config.headers.schoolId = storeSchoolId ? storeSchoolId : routeSchoolId
clearTimeout(checkTimer)
check && checkDisabled()
checkTimer = setTimeout(() => {
check = true
}, 2000)
return config
}, err => {
Util.errorMsg({
message: '退出登陆',
onClose: function () {
router.push({ name: '/login' })
}
})
return Promise.reject(err)
})
// 响应拦截器
service.interceptors.response.use(
response => {
const res = response.data
if(res.status == 200) {
return Promise.resolve(res).catch(e => {})
}else if(res.status == 30001) {
return Promise.resolve(res).catch(e => {})
}else if(!res.status){
return Promise.resolve(res).catch(e => {})
}else {
util.errorMsg(res.message)
res.message === '该账号无权限!' && setTimeout(() => {
store.dispatch('user/logout')
}, 1500)
return Promise.reject(res)
}
},
// 服务器状态码不是200的情况
error => {
if (error.response.status) {
switch (error.response.status) {
// 401: 未登录
// 未登录则跳转登录页面,并携带当前页面的路径
// 在登录成功后返回当前页面,这一步需要在登录页操作。
case 401:
util.local.remove(Setting.storeKey)
util.local.remove(Setting.tokenKey)
util.errorMsg('登录过期,请重新登录')
setTimeout(() => {
router.replace({
path: '/login'
})
}, 1000)
break
case 500:
util.errorMsg('网络错误')
break
// 403 token过期
// 登录过期对用户进行提示
// 清除本地token和清空vuex中token对象
// 跳转登录页面
case 403:
util.local.remove(Setting.storeKey)
util.local.remove(Setting.tokenKey)
util.errorMsg('登录过期,请重新登录')
// 清除token
// store.commit('loginSuccess', null);
// 跳转登录页面,并将要浏览的页面fullPath传过去,登录成功后跳转需要访问的页面
setTimeout(() => {
router.replace({
path: '/login',
// query: {
// redirect: router.currentRoute.fullPath
// }
})
}, 1000)
break
// 404请求不存在
case 404:
util.errorMsg('网络请求不存在!')
break
// 其他错误,直接抛出错误提示
default:
util.errorMsg(error.response.data.message)
Promise.reject(res)
}
return Promise.reject(error.response)
}
response => {
const res = response.data
if (res.status == 200) {
return Promise.resolve(res).catch(e => { })
} else if (res.code === 401) {
// 账号互踢
if (!logouted) {
Util.local.remove(Setting.storeKey)
Util.local.remove(Setting.tokenKey)
Util.errorMsg(res.msg.includes('顶') ? '您的账号已在其他设备登录,您已被迫下线!' : '登录过期,请重新登录!')
setTimeout(() => {
router.replace({
path: '/login'
})
logouted = 0
}, 1500)
logouted = 1
}
} else if (res.status == 30001) {
return Promise.resolve(res).catch(e => { })
} else if (!res.status) {
return Promise.resolve(res).catch(e => { })
} else if (res.status === 10008) {
Message.error({
message: res.message,
showClose: true,
duration: 1500
})
return Promise.reject(res)
} else {
Util.errorMsg(res.message)
res.message === '该账号无权限!' && setTimeout(() => {
store.dispatch('user/logout')
}, 1500)
return Promise.reject(res)
}
},
// 服务器状态码不是200的情况
error => {
if (error.response.status) {
switch (error.response.status) {
// 401: 未登录
// 未登录则跳转登录页面,并携带当前页面的路径
// 在登录成功后返回当前页面,这一步需要在登录页操作。
case 401:
Util.local.remove(Setting.storeKey)
Util.local.remove(Setting.tokenKey)
Util.errorMsg('登录过期,请重新登录')
setTimeout(() => {
router.replace({
path: '/login'
})
}, 1000)
break
case 500:
Util.errorMsg('网络错误')
break
// 403 token过期
// 登录过期对用户进行提示
// 清除本地token和清空vuex中token对象
// 跳转登录页面
case 403:
Util.local.remove(Setting.storeKey)
Util.local.remove(Setting.tokenKey)
Util.errorMsg('登录过期,请重新登录')
// 清除token
// store.commit('loginSuccess', null);
// 跳转登录页面,并将要浏览的页面fullPath传过去,登录成功后跳转需要访问的页面
setTimeout(() => {
router.replace({
path: '/login',
// query: {
// redirect: router.currentRoute.fullPath
// }
})
}, 1000)
break
// 404请求不存在
case 404:
Util.errorMsg('网络请求不存在!')
break
// 其他错误,直接抛出错误提示
default:
Util.errorMsg(error.response.data.message)
Promise.reject(res)
}
return Promise.reject(error.response)
}
}
);
function get(url, params){
return new Promise((resolve, reject) =>{
service.get(url, {params: params}).then(res => {
resolve(res)
}).catch(err => {
reject(err)
})
function get (url, params) {
return new Promise((resolve, reject) => {
service.get(url, { params: params }).then(res => {
resolve(res)
}).catch(err => {
reject(err)
})
})
}
function post(url, params){
return new Promise((resolve, reject) =>{
service.post(url,params).then(res => {
resolve(res)
}).catch(err => {
reject(err.data)
})
function post (url, params) {
return new Promise((resolve, reject) => {
service.post(url, params).then(res => {
resolve(res)
}).catch(err => {
reject(err.data)
})
})
}
function del(url, params){
return new Promise((resolve, reject) =>{
service.delete(url, {
params
}).then(res => {
resolve(res)
}).catch(err => {
reject(err.data)
})
function del (url, params) {
return new Promise((resolve, reject) => {
service.delete(url, {
params
}).then(res => {
resolve(res)
}).catch(err => {
reject(err.data)
})
})
}
function put(url, params){
return new Promise((resolve, reject) =>{
service.put(url, {
params
}).then(res => {
resolve(res)
}).catch(err => {
reject(err.data)
})
function put (url, params) {
return new Promise((resolve, reject) => {
service.put(url, {
params
}).then(res => {
resolve(res)
}).catch(err => {
reject(err.data)
})
})
}
export { get,post,del,put }
export { get, post, del, put }

@ -7,82 +7,88 @@
* 业务配置
* */
const env = process.env.NODE_ENV;
const url = location.host
const dev = process.env.NODE_ENV === 'development' // 本地
let host = `${location.origin}/`
if (dev) {
host = 'https://www.dataforward.cn/'
// host = 'http://192.168.31.51:9000/'
}
const Setting = {
/**
* 基础配置
* */
// 网页标题的后缀
titleSuffix: '数据前瞻',
// 路由模式,可选值为 history 或 hash
routerMode: 'hash',
// 页面切换时,是否显示模拟的进度条
showProgressBar: true,
/**
* 接口地址
* 测试http://39.108.250.202:9000
* 正式http://www.dataforward.cn:9000
* */
// apiBaseURL: env === 'development' ? 'http://192.168.31.151:9000' : 'http://39.108.250.202:9000',
apiBaseURL: env === 'development' ? 'http://192.168.31.151:9000/' : `${location.origin}:9000/`,
// 加密货币接口地址
cryptoBaseURL: `http://159.138.53.111/`,
// 接口请求返回错误时,弹窗的持续时间,单位:秒
modalDuration: 3,
// 接口请求返回错误时,弹窗的类型,可选值为 Message 或 Notice
errorModalType: 'Message',
// Cookies 默认保存时间,单位:天
cookiesExpires: 1,
// 长时间未操作,自动退出登录时间
autoLogoutTime: 3600000,
/**
* localStorage里保存的token的key
*/
tokenKey: 'data_token',
/**
* localStorage里保存的vuex的key
*/
storeKey: 'data_store',
/**
* 默认密码
*/
initialPassword: '111aaa',
/**
* 所属平台1->职站 2->数据平台 3->中台
*/
platformId: 2,
/**
* 平台端区分0->教师端 1->学生端 2->无端
*/
platformType: 2,
/**
* 多语言配置
* */
i18n: {
// 默认语言
default: 'zh',
// 是否根据用户电脑配置自动设置语言(仅第一次有效)
auto: false
},
/**
* 布局配置
* */
layout: {
/**
* 基础配置
* */
// 网页标题的后缀
titleSuffix: '数据前瞻',
// 路由模式,可选值为 history 或 hash
routerMode: 'hash',
// 页面切换时,是否显示模拟的进度条
showProgressBar: true,
/**
* 接口地址
* 测试http://121.37.12.51
* 正式https://www.dataforward.cn
* */
// apiBaseURL: env === 'development' ? 'http://192.168.31.151:9000' : 'http://121.37.12.51',
apiBaseURL: host,
// 加密货币接口地址
cryptoBaseURL: `http://159.138.53.111/`,
// 接口请求返回错误时,弹窗的持续时间,单位:秒
modalDuration: 3,
// 接口请求返回错误时,弹窗的类型,可选值为 Message 或 Notice
errorModalType: 'Message',
// Cookies 默认保存时间,单位:天
cookiesExpires: 1,
// 长时间未操作,自动退出登录时间
autoLogoutTime: 3600000,
/**
* localStorage里保存的token的key
*/
tokenKey: 'data_token',
/**
* localStorage里保存的vuex的key
*/
storeKey: 'data_store',
/**
* 默认密码
*/
initialPassword: '1122aa',
/**
* 所属平台1->职站 2->数据平台 3->中台
*/
platformId: 2,
/**
* 平台端区分0->教师端 1->学生端 2->无端
*/
platformType: 2,
/**
* 多语言配置
* */
i18n: {
// 默认语言
default: 'zh',
// 是否根据用户电脑配置自动设置语言(仅第一次有效)
auto: false
},
/**
* 布局配置
* */
layout: {
},
/**
* 功能配置
* */
// 相同路由,不同参数间进行切换,是否强力更新
sameRouteForceUpdate: false,
// 是否使用动态路由
dynamicRoute: true,
// 文件上传
upload: {
apiURL: 'http://8.134.8.197:8001',
maxSize: 30,
},
},
/**
* 功能配置
* */
// 相同路由,不同参数间进行切换,是否强力更新
sameRouteForceUpdate: false,
// 是否使用动态路由
dynamicRoute: true,
// 文件上传
upload: {
apiURL: 'http://8.134.8.197:8001',
maxSize: 30,
},
};
export default Setting;

@ -9,102 +9,99 @@
import Setting from '@/setting'
import util from '@/libs/util'
import {post,get,del,put} from '@/plugins/requests/index.js'
import { post, get } from '@/plugins/requests/index.js'
import api from '@/api'
/**
* 用户信息
* */
export default {
namespaced: true,
state: {
avatar: 'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png',
schoolId: '',
userName: '',
isManager: false,
isCustomer: false,
logView: false // 是否查询过日志状态,如果有,则不再调接口
namespaced: true,
state: {
avatar: 'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png',
schoolId: '',
userName: '',
isManager: false,
isCustomer: false,
logView: false // 是否查询过日志状态,如果有,则不再调接口
},
mutations: {
SET_INFO: (state, info) => {
if (info.avatar) state.avatar = info.avatar
if (info.schoolId) state.schoolId = info.schoolId
if (info.userName) state.userName = info.userName
},
mutations: {
SET_INFO: (state, info) => {
if(info.avatar) state.avatar = info.avatar
if(info.schoolId) state.schoolId = info.schoolId
if(info.userName) state.userName = info.userName
},
SET_AVATAR: (state, avatar) => {
state.avatar = avatar
},
SET_MANAGER: (state, isManager) => {
state.isManager = isManager
},
SET_CUSTOMER: (state, isCustomer) => {
state.isCustomer = isCustomer
},
SET_LOG: (state) => {
state.logView = true
},
SET_AVATAR: (state, avatar) => {
state.avatar = avatar
},
actions: {
login({ state,commit }, userInfo) {
const { account, password, code, random, distinguish } = userInfo
return new Promise((resolve, reject) => {
post(api.logins,{
account,
password,
code,
random,
distinguish,
type: 2, // 平台端区分:0->教师端 1->学生端 2->无端
platform: Setting.platformId, // 所属平台id(1.职站 2.数据平台 3.中台)
}).then(res => {
if(res.status == 200){
util.local.set(Setting.tokenKey,res.data.token,43200000)
util.successMsg('登录成功')
get(api.isClient).then(res => {
commit('SET_CUSTOMER',res.customer)
const userName = res.customerName
userName && commit('SET_INFO', {
userName
})
}).catch(res => {})
post(api.getSchoolIdByToken).then(res => {
commit('SET_INFO',res)
}).catch(res => {})
setTimeout(() => {
// 登录次数+1
post(api.saveRecord,{
type: 3,
}).then(res => {}).catch(res => {})
},3000)
resolve()
}else{
util.errorMsg(res.message)
reject(res)
}
}).catch(error => {
reject(error)
})
})
},
logout({ commit, state, dispatch }) {
return new Promise((resolve, reject) => {
util.local.remove(Setting.storeKey)
util.local.remove(Setting.tokenKey)
location.reload()
resolve()
})
},
setAvatar({ state,commit },avatar) {
commit('SET_AVATAR',avatar)
},
setInfo({ state,commit },info) {
commit('SET_INFO',info)
},
setManager({ state,commit },isManager) {
commit('SET_MANAGER',isManager)
},
setCustomer({ state,commit },isCustomer) {
commit('SET_CUSTOMER',isCustomer)
},
}
SET_MANAGER: (state, isManager) => {
state.isManager = isManager
},
SET_CUSTOMER: (state, isCustomer) => {
state.isCustomer = isCustomer
},
SET_LOG: (state) => {
state.logView = true
},
},
actions: {
login ({ state, commit }, userInfo) {
const { account, password, code, random, distinguish } = userInfo
return new Promise((resolve, reject) => {
post(api.logins, {
account,
password,
code,
random,
distinguish,
type: 2, // 平台端区分:0->教师端 1->学生端 2->无端
platform: Setting.platformId, // 所属平台id(1.职站 2.数据平台 3.中台)
}).then(res => {
if (res.status == 200) {
util.local.set(Setting.tokenKey, res.data.token, 43200000)
util.successMsg('登录成功')
post(api.getSchoolIdByToken).then(res => {
commit('SET_INFO', res)
}).catch(res => { })
setTimeout(() => {
// 登录次数+1
post(api.saveRecord, {
type: 3,
}).then(res => { }).catch(res => { })
}, 3000)
resolve()
} else {
util.errorMsg(res.message)
reject(res)
}
}).catch(error => {
reject(error)
})
})
},
logout ({ commit, state, dispatch }) {
return new Promise((resolve, reject) => {
post(api.logout).then(() => {
util.local.remove(Setting.storeKey)
util.local.remove(Setting.tokenKey)
location.reload()
resolve()
}).catch(error => {
reject(error)
})
})
},
setAvatar ({ state, commit }, avatar) {
commit('SET_AVATAR', avatar)
},
setInfo ({ state, commit }, info) {
commit('SET_INFO', info)
},
setManager ({ state, commit }, isManager) {
commit('SET_MANAGER', isManager)
},
setCustomer ({ state, commit }, isCustomer) {
commit('SET_CUSTOMER', isCustomer)
},
}
}

@ -14,5 +14,6 @@ module.exports = {
  assetsDir: Setting.assetsDir,
devServer: {
port: 8092
}
},
productionSourceMap: false,
}
Loading…
Cancel
Save