登录添加查询日志状态

dev_2022-04-07
yujialong 3 years ago
parent 35075caac7
commit 67c0225b70
  1. 1
      src/api/index.js
  2. BIN
      src/assets/img/update.png
  3. 2
      src/layouts/navbar/index.vue
  4. 68
      src/pages/account/login/index.vue
  5. 2
      src/setting.js

@ -10,6 +10,7 @@ export default {
getTopList: `${Setting.cryptoBaseURL}currency/market/getTopList`,
platformLogList: `/nakadai/log/platformLogList`,
logNotification: `/nakadai/log/logNotification`,
// 公用接口
queryProvince: `/nakadai/nakadai/province/queryProvince`,
queryCity: `/nakadai/nakadai/city/queryCity`,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 14 KiB

@ -25,7 +25,7 @@ export default {
title: '数据看板'
}, {
index: "/log/list",
title: "最近更新"
title: "更新日志"
}],
//
dataMenu: {

@ -53,11 +53,12 @@
</template>
<script>
import { mapActions } from 'vuex'
import { mapMutations, mapActions } from 'vuex'
import vHead from '@/layouts/header'
import util from '@/libs/util'
import Setting from '@/setting'
import vFooter from '@/layouts/footer'
import axios from 'axios'
export default {
data: function() {
return {
@ -76,13 +77,16 @@ export default {
account: '',
password: '',
random: '',
code: ''
code: '',
type: 2, // 0-> 1-> 2->
platform: Setting.platformId, // id(1. 2. 3.)
},
rules: {
account: [{ required: true, message: '请输入账号', trigger: 'blur' }],
password: [{ required: true, message: '请输入密码', trigger: 'blur' }],
code: [{ required: true, message: '请输入验证码', trigger: 'blur' }],
},
token: '',
phoneVisible: false,
phone: '',
phoneCode: '',
@ -96,6 +100,9 @@ export default {
this.getVerImg()
},
methods: {
...mapMutations("user", [
'SET_CUSTOMERNAME', 'SET_CUSTOMER', 'SET_INFO'
]),
...mapActions('user', [
'login','setCustomer'
]),
@ -105,18 +112,48 @@ export default {
this.$refs.login.clearValidate()
this.rules.account[0].message = item.id == 1 ? '请输入账号' : '请输入手机号/邮箱'
},
//
setLogin() {
window.opener && window.opener.location.reload() //
util.local.set(Setting.tokenKey, this.token, Setting.tokenExpires)
//
this.$get(this.api.isClient).then(res => {
//
this.SET_CUSTOMER(res.customer)
const userName = res.customerName
userName && this.SET_INFO({
userName
})
}).catch(res => {})
// schoolId
this.$post(this.api.getSchoolIdByToken).then(res => {
this.SET_INFO(res)
}).catch(res => {})
// +1
this.$post(this.api.saveRecord,{
type: 3,
}).then(res => {}).catch(res => {})
// true
this.$get(this.api.logNotification).then(res => {
const history = this.$route.query.redirect
const redirect = res.notification ?
'/log' :
history ?
decodeURIComponent(history) :
'/index'
util.successMsg('登录成功')
this.$router.replace(redirect)
}).catch(res => {})
},
submitForm() {
this.$refs.login.validate(valid => {
if (valid) {
this.login(this.form).then(() => {
window.opener && window.opener.location.reload() //
let redirect = this.$route.query.redirect ? decodeURIComponent(this.$route.query.redirect) : '/index'
this.$router.replace(redirect)
this.$post(this.api.logins, this.form).then(res => {
this.token = res.data.token
this.setLogin()
}).catch(res => {
//
if(res && res.status == 30001){
this.phoneVisible = true
}
if (res && res.status == 30001) this.phoneVisible = true
this.getVerImg()
this.form.code = ''
})
@ -178,18 +215,7 @@ export default {
util.successMsg('绑定成功')
this.form.phone = this.phone
this.phoneVisible = false
//
this.$get(this.api.isClient).then(res => {
this.setCustomer(res.customer)
}).catch(res => {})
util.local.set(Setting.tokenKey,res.token,43200000)
util.successMsg('登录成功')
setTimeout(() => {
this.$post(this.api.saveRecord,{
type: 3,
}).then(res => {}).catch(res => {})
},3000)
this.$router.push('/index/list')
this.setLogin()
}).catch(res => {})
},
},

@ -25,7 +25,7 @@ const Setting = {
* 正式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`,
apiBaseURL: env === 'development' ? 'http://39.108.250.202:9000' : `${location.origin}:9000`,
// 加密货币接口地址
cryptoBaseURL: `http://159.138.53.111/`,
// 接口请求返回错误时,弹窗的持续时间,单位:秒

Loading…
Cancel
Save