Explorar el Código

Merge remote-tracking branch 'origin/master' into master

konghl %!s(int64=4) %!d(string=hace) años
padre
commit
6b8fe7ef86

+ 41 - 3
ebc-middle-platform/src/components/loginer.vue

@ -13,11 +13,11 @@
13 13
    </h2>
14 14
    <t-form ref="loginForm" :model="loginForm" :rules="loginFormRules">
15 15
      <t-form-item prop="userName">
16
        <t-input v-model="loginForm.userName" :placeholder="`${$t('aidp.account.username')}: zhangsan`" icon="user-outline" size="lg">
16
        <t-input v-model="loginForm.userName" :placeholder="`${$t('aidp.account.username')}: admin`" icon="user-outline" size="lg">
17 17
        </t-input>
18 18
      </t-form-item>
19 19
      <t-form-item prop="password">
20
        <t-input v-model="loginForm.password" :placeholder="`${$t('aidp.account.password')}: 123456`" type="password" icon="lock-outline" size="lg">
20
        <t-input v-model="loginForm.password" :placeholder="`${$t('aidp.account.password')}: Abc@1234`" type="password" icon="lock-outline" size="lg">
21 21
        </t-input>
22 22
      </t-form-item>
23 23
      <t-form-item prop="verifyCode">
@ -63,6 +63,12 @@ import { mapActions, mapState, mapMutations } from 'vuex'
63 63
import Services from '@/conf/services'
64 64
import { KEY_USER_NAME } from '@/constants'
65 65
import routers from '@/routes'
66
import services from "../conf/services";
67
import {
68
  GENERATE_ROUTES
69
} from '@/modules/ootb/permission/store/constants'
70
import store from '../store';
71
import {SET_ROUTERS} from "../modules/ootb/permission/store/constants";
66 72
67 73
export default {
68 74
  name: 'Loginer',
@ -139,17 +145,49 @@ export default {
139 145
      this.loging = true
140 146
      this.$refs.loginForm.validate((valid) => {
141 147
        if (valid) {
142
          this.doLogin(this.loginForm).then((data) => {
148
          this.doLogin({userCode: this.loginForm.userName, passWord: this.loginForm.password}).then((data) => {
149
            this.$store.commit('setLogged', true)
143 150
            if (this.rememberMe) {
144 151
              localStorage.setItem(KEY_USER_NAME, data.userName)
145 152
            } else {
146 153
              localStorage.removeItem(KEY_USER_NAME)
147 154
            }
155
            const roles = {
156
              permissionList: ['exception']
157
            }
158
            this.$test
159
              .post(services.login.FIND_MENUS, {userCode: data.RESULT.CODE})
160
              .then((data) => {
161
162
                localStorage.setItem('menus',  JSON.stringify(data))
163
                store.dispatch(`permission/${GENERATE_ROUTES}`, roles)
164
              })
148 165
            this.$router.push({ name: this.homeName })
149 166
          }).catch((e) => {
150 167
            this.loging = false
151 168
            this.$Message.danger(e)
152 169
          })
170
171
172
173
174
          // this.$test
175
          //   .post(services.login.LOGIN, )
176
          //   .then((data) => {
177
          //     if (data.FLAG === 'SUCCESS') {
178
          //       if (this.rememberMe) {
179
          //         localStorage.setItem(KEY_USER_NAME, data.RESULT.CODE)
180
          //       } else {
181
          //         localStorage.removeItem(KEY_USER_NAME)
182
          //       }
183
          //
184
          //
185
          //       this.$router.push({ name: this.homeName })
186
          //     } else {
187
          //       this.$Message.danger(data.MESSAGE)
188
          //     }
189
          //     this.loging = false
190
          //   })
153 191
        } else {
154 192
          this.loging = false
155 193
          this.$Message.danger(this.$t('aidp.common.input_incorrect', { field: this.$t('aidp.account.username') + this.$t('aidp.common.or') + this.$t('aidp.account.password') }))

+ 4 - 0
ebc-middle-platform/src/conf/services.js

@ -60,6 +60,10 @@ export default {
60 60
    QUERYALLMENU: '/menu/queryAllMenu',
61 61
    QUERYMENUBYMENUNAME: '/menu/menuName/:menuName'
62 62
  },
63
  login: {
64
    LOGIN: '/login/login',
65
    FIND_MENUS: '/login/findMenus'
66
  },
63 67
  organization: {
64 68
    PERSON_LOCATION: '/device/queryCurrentDeviceLocationInfo',
65 69
    GETTREEALLDATA: '/org/queryOrg', // 获取所有组织数据

+ 4 - 0
ebc-middle-platform/src/main.js

@ -3,6 +3,10 @@
3 3
 * @author PRD UX R&D Dept.
4 4
 */
5 5
6
// 允许携带cookie
7
import axios from 'axios'
8
axios.defaults.withCredentials = true
9
6 10
// 引入第三方库
7 11
import 'babel-polyfill'
8 12
import Vue from 'vue'

+ 5 - 4
ebc-middle-platform/src/modules/ootb/user/store/actions.js

@ -7,6 +7,7 @@ import {
7 7
} from './constants'
8 8
9 9
import { KEY_USER_CODE, KEY_TOKEN } from '@/constants'
10
import services from "../../../../conf/services";
10 11
11 12
/**
12 13
 * 用户登录
@ -17,11 +18,11 @@ import { KEY_USER_CODE, KEY_TOKEN } from '@/constants'
17 18
 */
18 19
export function doLogin({ commit, state }, data) {
19 20
  return new Promise((resolve, reject) => {
20
    http.$http
21
      .post(Services.aidp.LOGIN, data)
21
    http.$test
22
      .post(Services.login.LOGIN, data)
22 23
      .then(ret => {
23
        if (ret.data.code === '0') {
24
          let payload = ret.data.data
24
        if (ret.FLAG === 'SUCCESS') {
25
          let payload = ret
25 26
          commit(LOGIN, payload)
26 27
          window.localStorage.setItem(KEY_USER_CODE, state.userCode)
27 28
          window.localStorage.setItem(KEY_TOKEN, state.token)

+ 47 - 34
ebc-middle-platform/src/modules/orientation/orientation.vue

@ -25,11 +25,7 @@
25 25
        <t-button
26 26
          color="success"
27 27
          icon="map-marker-outline"
28
          @click="
29
            () => {
30
              trackModal = true;
31
            }
32
          "
28
          @click="trackClick"
33 29
        >轨迹</t-button
34 30
        >
35 31
        <div style="min-width:100px">悬浮窗<t-switch v-model="switch1" rounded @change="switchChange"></t-switch></div>
@ -100,22 +96,10 @@
100 96
              <t-option v-for="(item, index) in personList" :key="index" :value="item">{{ item.workEmployeeName }}</t-option>
101 97
            </t-select>
102 98
            <span class="track-span">时间</span>
103
            <t-button-group>
104
              <t-button
105
                v-for="(item, index) in trackTimeList"
106
                :class="
107
                  index == trackQueryCondition.currentIndex ? 'active' : ''
108
                "
109
                :key="index"
110
                @click="changeTrackTime(index)"
111
              >{{ item }}</t-button
112
              >
113
            </t-button-group>
114 99
            <t-date-picker
115
              :class="trackQueryCondition.currentIndex === 3?'':'hidden'"
116 100
              v-model="rangeDate"
117 101
              align-right
118
              style="width:300px"
102
              style="width:320px"
119 103
              type="dateTimeRange"
120 104
              placeholder="请选择时间"
121 105
              @date-change="onChangeDate">
@ -1129,6 +1113,43 @@ export default {
1129 1113
        this.trackMap.removeLayer(this.trackPath)
1130 1114
      }
1131 1115
    },
1116
    trackClick() {
1117
      this.trackModal = true
1118
      var now = new Date()
1119
      var year = now.getFullYear()
1120
      var month = now.getMonth() + 1
1121
      month >= 10 ? month : '0' + month
1122
      var day = now.getDate() >= 10 ? now.getDate() : '0' + now.getDate()
1123
      var hours =
1124
          now.getHours() >= 10 ? now.getHours() : '0' + now.getHours()
1125
      var minutes =
1126
          now.getMinutes() >= 10
1127
              ? now.getMinutes()
1128
              : '0' + now.getMinutes()
1129
      var seconds =
1130
          now.getSeconds() >= 10
1131
              ? now.getSeconds()
1132
              : '0' + now.getSeconds()
1133
      var statr = year +
1134
          '-' +
1135
          month +
1136
          '-' +
1137
          day +
1138
          ' ' +
1139
          '00:00:00'
1140
      var end = year +
1141
          '-' +
1142
          month +
1143
          '-' +
1144
          day +
1145
          ' ' +
1146
          hours +
1147
          ':' +
1148
          minutes +
1149
          ':' +
1150
          seconds
1151
      this.rangeDate = [statr, end]
1152
    },
1132 1153
    playback() {
1133 1154
      var entityIds
1134 1155
      if (this.trackTypeCondition.currentIndex == 0) {
@ -1149,27 +1170,18 @@ export default {
1149 1170
        entityIds = entityIds.substring(0, entityIds.length - 1)
1150 1171
      }
1151 1172
      var params = {}
1152
      if (this.trackQueryCondition.currentIndex === 3) {
1153
        if (!this.rangeDate) {
1154
          this.$Message.warning('请选择时间!')
1155
          return
1156
        } else {
1157
          params = {
1158
            entityId: entityIds,
1159
            timeType: (this.trackQueryCondition.currentIndex + 1),
1160
            playbackRate: this.playbackRate,
1161
            startTime: this.rangeDate[0],
1162
            endTime: this.rangeDate[1]
1163
          }
1164
        }
1173
      if (!this.rangeDate) {
1174
        this.$Message.warning('请选择时间!')
1175
        return
1165 1176
      } else {
1166 1177
        params = {
1167 1178
          entityId: entityIds,
1179
          timeType: 4,
1168 1180
          playbackRate: this.playbackRate,
1169
          timeType: (this.trackQueryCondition.currentIndex + 1)
1181
          startTime: this.rangeDate[0],
1182
          endTime: this.rangeDate[1]
1170 1183
        }
1171 1184
      }
1172
1173 1185
      if (this.trackTypeCondition.currentIndex == 0) {
1174 1186
        this.$test
1175 1187
          .post(services.trackAnalysis.GET_SINGLE_TRACE, params)
@ -1309,7 +1321,8 @@ export default {
1309 1321
          iconSize: [40, 55],
1310 1322
          // 设置点对象和图标的相对偏移量
1311 1323
          iconAnchor: [20, 25]
1312
        })
1324
        }),
1325
        draggable:true
1313 1326
      })
1314 1327
      var popup = Ai.Popup({
1315 1328
        maxWidth: 60,

+ 4 - 4
ebc-middle-platform/src/modules/page/GlobalHeader.vue

@ -21,20 +21,20 @@
21 21
            @on-keyup="onSelectKeyUp"
22 22
            @on-blur="onSelectBlur">
23 23
            <t-option-group label="菜单">
24
              <t-option value="1" label="战区综评" style="height: auto">
24
              <t-option value="1" label="--" style="height: auto">
25 25
                <div class="d-flex align-items-start">
26 26
                  <t-icon icon="chart-areaspline" size="16" class="mr-2 text-muted"></t-icon>
27 27
                  <div>
28
                    <p class="mb-0">战区综评</p>
28
                    <p class="mb-0">--</p>
29 29
                    <small class="text-muted">综合业务分析</small>
30 30
                  </div>
31 31
                </div>
32 32
              </t-option>
33
              <t-option value="2" label="战区综评">
33
              <t-option value="2" label="--">
34 34
                <div class="d-flex align-items-center">
35 35
                  <t-icon icon="chart-areaspline" size="16" class="mr-2 text-muted"></t-icon>
36 36
                  <div>
37
                    <p class="mb-0">战区综评</p>
37
                    <p class="mb-0">--</p>
38 38
                  </div>
39 39
                </div>
40 40
              </t-option>

+ 3 - 1
ebc-middle-platform/src/router.js

@ -23,6 +23,7 @@ const router = new VueRouter({
23 23
})
24 24
25 25
router.beforeEach((to, from, next) => {
26
  console.log(to, from, next)
26 27
  GLoading.$create().start()
27 28
  /*
28 29
   * 在每次视图切换时检查当前用户是否处于登
@ -36,7 +37,8 @@ router.beforeEach((to, from, next) => {
36 37
   * 单客户端判断。
37 38
   * 参见src/frame.vue和src/store.js文件中的逻辑。
38 39
   */
39
  let isLogged = router.app.$options.store.getters['user/isLogged']
40
  let isLogged = router.app.$options.store.getters.getLogged
41
  // let isLogged = router.app.$options.store.getters['user/isLogged']
40 42
  // router.app.$store.commit('setTitle', to.meta.title)
41 43
  if (to.meta.ignoreAuth === true) {
42 44
    if (isLogged === true && to.path === '/login') {

+ 15 - 1
ebc-middle-platform/src/store.js

@ -62,7 +62,9 @@ const store = new Vuex.Store({
62 62
    map_param: {
63 63
      center: [33.597844, 123.647472],
64 64
      zoom: 11
65
    }
65
    },
66
    reLoad: false,
67
    isLogged: false
66 68
  },
67 69
  mutations: {
68 70
    // 改变语言
@ -87,6 +89,12 @@ const store = new Vuex.Store({
87 89
    },
88 90
    setMapParam(state, token) {
89 91
      state.map_param = token
92
    },
93
    setReLoad(state, token) {
94
      state.reLoad = token
95
    },
96
    setLogged(state, token) {
97
      state.isLogged = token
90 98
    }
91 99
  },
92 100
  getters: {
@ -118,6 +126,12 @@ const store = new Vuex.Store({
118 126
    },
119 127
    getMapParam(state) {
120 128
      return state.map_param
129
    },
130
    getReLoad(state) {
131
      return state.reLoad
132
    },
133
    getLogged(state) {
134
      return state.isLogged
121 135
    }
122 136
  },
123 137
  modules: {

+ 3 - 1
location-rescue-service/src/main/java/com/ai/bss/location/rescue/controller/LoginController.java

@ -60,6 +60,7 @@ public class LoginController {
60 60
                response.addCookie(userCookie3);
61 61
            }
62 62
        }
63
        login.put("success", true);
63 64
        return login;
64 65
    }
65 66
@ -75,10 +76,11 @@ public class LoginController {
75 76
    public Map<String, Object> findMenus(@RequestBody User user, HttpServletRequest request){
76 77
77 78
        Map<String, Object> menus = loginService.findMenus(user,request);
79
        menus.put("success", true);
78 80
        return menus;
79 81
    }
80 82
81 83
82 84
83 85
84
}
86
}