chenjun 2 gadi atpakaļ
vecāks
revīzija
016535e49e

+ 8 - 0
src/api/statistics/statistics.js

@@ -9,6 +9,14 @@ export function correlation(query) {
   })
 }
 
+export function logins (parameter) {
+  return request({
+    url: '/login',
+    method: 'post',
+    data: parameter
+  })
+}
+
 // 获取航空货物综合统计接口1
 export function comprehensive(query) {
   return request({

+ 14 - 0
src/store/modules/user.js

@@ -1,5 +1,6 @@
 import storage from 'store'
 import { login, loginBySms, getInfo, logout } from '@/api/login'
+import { logins} from '@/api/statistics/statistics'
 import { ACCESS_TOKEN } from '@/store/mutation-types'
 
 const user = {
@@ -67,6 +68,19 @@ const user = {
         })
       })
     },
+    // 登录2
+    Logins ({ commit }, userInfo) {
+      return new Promise((resolve, reject) => {
+        logins(userInfo).then(res => {
+          storage.set(ACCESS_TOKEN, res.token, 7 * 24 * 60 * 60 * 1000)
+          commit('SET_TOKEN', res.token)
+          resolve()
+        })
+        .catch(error => {
+          reject(error)
+        })
+      })
+    },
    // 根据验证码登录
     LoginBySms ({ commit }, userInfo) {
       return new Promise((resolve, reject) => {

+ 2 - 2
src/views/redirect.vue

@@ -12,7 +12,7 @@ export default {
     }
   },
   methods: {
-    ...mapActions(['Login'])
+    ...mapActions(['Logins'])
   },
   created () {
     const query = this.$route.query
@@ -25,7 +25,7 @@ export default {
 			mode: CryptoJS.mode.CBC,
 			padding: CryptoJS.pad.Pkcs7
 		})
-    this.Login({
+    this.Logins({
       username: 'test1',
       password: encrypted.toString(),
       id: query.id

+ 1 - 0
src/views/system/securityCheck/views/waybillTable.vue

@@ -169,6 +169,7 @@ export default {
   },
   activated() {
     let queryData = this.$route.params
+    this.pagination.current = 1;
     const {
       waybillNo,
       destination,