Pārlūkot izejas kodu

Merge remote-tracking branch 'origin/lisb_dev' into leng_dev

冷冷 5 gadi atpakaļ
vecāks
revīzija
a341198817

+ 9 - 1
src/api/admin/tenant.js

@@ -17,7 +17,7 @@
 
 import request from '@/router/axios'
 
-export function fetchList(query) {
+export function fetchPage(query) {
   return request({
     url: '/admin/tenant/page',
     method: 'get',
@@ -25,6 +25,14 @@ export function fetchList(query) {
   })
 }
 
+export function fetchList(query) {
+  return request({
+    url: '/admin/tenant/list',
+    method: 'get',
+    params: query
+  })
+}
+
 export function addObj(obj) {
   return request({
     url: '/admin/tenant',

+ 26 - 0
src/api/code.js

@@ -0,0 +1,26 @@
+import request from '@/router/axios'
+
+/**
+ * 获取验证码
+ * @param query 查询条件
+ * @param code 验证码对象
+ * @returns {Promise<T>}
+ */
+export function getCode(query, code) {
+  return request({
+    url: '/code',
+    method: 'get',
+    params: query,
+    responseType: 'arraybuffer'
+  }).then(response => {
+    //将从后台获取的图片流进行转换
+    return 'data:image/png;base64,' + btoa(
+      new Uint8Array(response.data).reduce((data, byte) => data + String.fromCharCode(byte), '')
+    )
+  }).then(function(data) {
+    //接收转换后的Base64图片
+    code.src = data
+  }).catch(function(err) {
+    console.log(err)
+  })
+}

+ 1 - 1
src/const/crud/activiti/task.js

@@ -49,7 +49,7 @@ export const tableOption = {
 }
 export const formOption = {
   submitBtn: false,
-  emptytBtn: false,
+  emptyBtn: false,
   row: true,
   span: 12,
   column: [

+ 14 - 14
src/const/setting/index.js

@@ -1,37 +1,37 @@
 const dicData = [{
-  label: '开启',
-  value: 'true'
-}, {
   label: '关闭',
   value: 'false'
+},{
+  label: '开启',
+  value: 'true'
 }]
 export const list = [{
   key: 'showTag',
-  commit: 'SET_SHOWTAG'
+  commit: 'SET_SHOW_TAG'
 }, {
   key: 'showTheme',
-  commit: 'SET_SHOWTHEME'
+  commit: 'SET_SHOW_THEME'
 }, {
   key: 'showColor',
-  commit: 'SET_SHOWCOLOR'
+  commit: 'SET_SHOW_COLOR'
 }, {
   key: 'showLock',
-  commit: 'SET_SHOWLOCK'
+  commit: 'SET_SHOW_LOCK'
 }, {
   key: 'showDebug',
-  commit: 'SET_SHOWDEBUG'
+  commit: 'SET_SHOW_DEBUG'
 }, {
-  key: 'showFullScren',
-  commit: 'SET_SHOWFULLSCREN'
+  key: 'showFullScreen',
+  commit: 'SET_SHOW_FULL_SCREEN'
 }, {
   key: 'showCollapse',
-  commit: 'SET_SHOWCOLLAPSE'
+  commit: 'SET_SHOW_COLLAPSE'
 }, {
   key: 'showSearch',
-  commit: 'SET_SHOWSEARCH'
+  commit: 'SET_SHOW_SEARCH'
 }, {
   key: 'showMenu',
-  commit: 'SET_SHOWMENU'
+  commit: 'SET_SHOW_MENU'
 }]
 export const option = (safe) => {
   const _safe = safe
@@ -76,7 +76,7 @@ export const option = (safe) => {
       }
     }, {
       label: '全屏',
-      prop: 'showFullScren',
+      prop: 'showFullScreen',
       type: 'switch',
       span: 24,
       dicData: dicData,

+ 6 - 6
src/page/index/top/index.vue

@@ -55,13 +55,13 @@
         </div>
       </el-tooltip>
       <el-tooltip
-        v-if="showFullScren"
-        :content="isFullScren?'退出全屏':'全屏'"
+        v-if="showFullScreen"
+        :content="isFullScreen?'退出全屏':'全屏'"
         effect="dark"
         placement="bottom">
         <div class="top-bar__item">
           <i
-            :class="isFullScren?'icon-zuixiaohua':'icon-quanpingzuidahua'"
+            :class="isFullScreen?'icon-zuixiaohua':'icon-quanpingzuidahua'"
             @click="handleScreen"/>
         </div>
       </el-tooltip>
@@ -129,14 +129,14 @@ export default {
       showDebug: state => state.common.showDebug,
       showTheme: state => state.common.showTheme,
       showLock: state => state.common.showLock,
-      showFullScren: state => state.common.showFullScren,
+      showFullScreen: state => state.common.showFullScreen,
       showCollapse: state => state.common.showCollapse,
       showMenu: state => state.common.showMenu,
       showColor: state => state.common.showColor
     }),
     ...mapGetters([
       'userInfo',
-      'isFullScren',
+      'isFullScreen',
       'tagWel',
       'tagList',
       'isCollapse',
@@ -159,7 +159,7 @@ export default {
       this.$store.commit('SET_COLLAPSE')
     },
     setScreen() {
-      this.$store.commit('SET_FULLSCREN')
+      this.$store.commit('SET_FULLSCREEN')
     },
     logout() {
       this.$confirm('是否退出系统, 是否继续?', '提示', {

+ 1 - 1
src/page/index/top/top-menu.vue

@@ -34,7 +34,7 @@ export default {
     this.getTopMenu()
   },
   computed: {
-    ...mapGetters(['tagCurrent', 'menu'])
+    ...mapGetters(['menu'])
   },
   methods: {
     getTopMenu() {

+ 1 - 1
src/page/index/top/top-setting.vue

@@ -45,7 +45,7 @@ export default {
       showDebug: state => state.common.showDebug,
       showLock: state => state.common.showLock,
       showColor: state => state.common.showColor,
-      showFullScren: state => state.common.showFullScren,
+      showFullScreen: state => state.common.showFullScreen,
       showCollapse: state => state.common.showCollapse,
       showSearch: state => state.common.showSearch,
       showMenu: state => state.common.showMenu,

+ 2 - 5
src/page/login/index.vue

@@ -40,7 +40,7 @@
   </div>
 </template>
 <script>
-import request from '@/router/axios'
+import {fetchList} from '@/api/admin/tenant'
 import userLogin from './userlogin'
 import codeLogin from './codelogin'
 import thirdLogin from './thirdlogin'
@@ -104,10 +104,7 @@ export default {
       setStore({ name: 'tenantId', content: command })
     },
     getTenantList () {
-      request({
-        url: '/admin/tenant/list',
-        method: 'get'
-      }).then(response => {
+      fetchList().then(response => {
         this.tenantList = response.data.data
       })
     },

+ 7 - 17
src/page/login/userlogin.vue

@@ -30,9 +30,6 @@
           slot="suffix"
           class="el-icon-view el-input__icon"
           @click="showPassword"/>
-        <!--<router-link to="/forgetlogin" slot="suffix">
-          <a href="#" class="alink" style="padding-left:8px;">忘记密码?</a>
-        </router-link>-->
         <i slot="prefix" class="iconfont icon-mima"></i>
       </el-input>
     </el-form-item>
@@ -53,16 +50,10 @@
         </el-col>
         <el-col :span="8">
           <div class="login-code">
-            <span
-              v-if="code.type == 'text'"
-              class="login-code-img"
-              @click="refreshCode">{{ code.value }}</span>
             <img
-              v-else
               :src="code.src"
               class="login-code-img"
               @click="refreshCode">
-              <!-- <i class="icon-shuaxin login-code-icon" @click="refreshCode"></i> -->
           </div>
         </el-col>
       </el-row>
@@ -82,6 +73,7 @@
 <script>
 import { randomLenNum } from '@/util/util'
 import { mapGetters } from 'vuex'
+import { getCode } from '@/api/code'
 
 export default {
   name: 'Userlogin',
@@ -95,14 +87,12 @@ export default {
         username: 'admin',
         password: '123456',
         code: '',
-        redomStr: ''
+        randomStr: ''
       },
       checked: false,
       code: {
-        src: '/code',
-        value: '',
-        len: 4,
-        type: 'image'
+        src: undefined,
+        len: 4
       },
       loginRules: {
         username: [
@@ -132,9 +122,9 @@ export default {
     refreshCode() {
       this.loginForm.code = ''
       this.loginForm.randomStr = randomLenNum(this.code.len, true)
-      this.code.type === 'text'
-        ? (this.code.value = randomLenNum(this.code.len))
-        : (this.code.src = `${this.codeUrl}?randomStr=${this.loginForm.randomStr}`)
+      getCode({ randomStr: this.loginForm.randomStr }, this.code).catch(() => {
+        this.$store.dispatch('FedLogOut')
+      })
     },
     showPassword() {
       this.passwordType == ''

+ 1 - 1
src/store/getters.js

@@ -9,7 +9,7 @@ const getters = {
   keyCollapse: (state, getters) => getters.screen > 1 ? getters.isCollapse : false,
   screen: state => state.common.screen,
   isLock: state => state.common.isLock,
-  isFullScren: state => state.common.isFullScren,
+  isFullScreen: state => state.common.isFullScreen,
   lockPasswd: state => state.common.lockPasswd,
   tagList: state => state.tags.tagList,
   tagWel: state => state.tags.tagWel,

+ 16 - 16
src/store/modules/common.js

@@ -5,7 +5,7 @@ const common = {
 
   state: {
     isCollapse: false,
-    isFullScren: false,
+    isFullScreen: false,
     isShade: false,
     screen: -1,
     isLock: getStore({ name: 'isLock' }) || false,
@@ -14,7 +14,7 @@ const common = {
     showCollapse: getStore({ name: 'showCollapse' }),
     showSearch: getStore({ name: 'showSearch' }),
     showLock: getStore({ name: 'showLock' }),
-    showFullScren: getStore({ name: 'showFullScren' }),
+    showFullScreen: getStore({ name: 'showFullScreen' }),
     showTheme: getStore({ name: 'showTheme' }),
     showColor: getStore({ name: 'showColor' }),
     showMenu: getStore({ name: 'showMenu' }),
@@ -31,66 +31,66 @@ const common = {
     SET_COLLAPSE: (state) => {
       state.isCollapse = !state.isCollapse
     },
-    SET_FULLSCREN: (state) => {
-      state.isFullScren = !state.isFullScren
+    SET_FULLSCREEN: (state) => {
+      state.isFullScreen = !state.isFullScreen
     },
-    SET_SHOWCOLLAPSE: (state, active) => {
+    SET_SHOW_COLLAPSE: (state, active) => {
       state.showCollapse = active
       setStore({
         name: 'showCollapse',
         content: state.showCollapse
       })
     },
-    SET_SHOWTAG: (state, active) => {
+    SET_SHOW_TAG: (state, active) => {
       state.showTag = active
       setStore({
         name: 'showTag',
         content: state.showTag
       })
     },
-    SET_SHOWMENU: (state, active) => {
+    SET_SHOW_MENU: (state, active) => {
       state.showMenu = active
       setStore({
         name: 'showMenu',
         content: state.showMenu
       })
     },
-    SET_SHOWLOCK: (state, active) => {
+    SET_SHOW_LOCK: (state, active) => {
       state.showLock = active
       setStore({
         name: 'showLock',
         content: state.showLock
       })
     },
-    SET_SHOWSEARCH: (state, active) => {
+    SET_SHOW_SEARCH: (state, active) => {
       state.showSearch = active
       setStore({
         name: 'showSearch',
         content: state.showSearch
       })
     },
-    SET_SHOWFULLSCREN: (state, active) => {
-      state.showFullScren = active
+    SET_SHOW_FULL_SCREEN: (state, active) => {
+      state.showFullScreen = active
       setStore({
-        name: 'showFullScren',
-        content: state.showFullScren
+        name: 'showFullScreen',
+        content: state.showFullScreen
       })
     },
-    SET_SHOWDEBUG: (state, active) => {
+    SET_SHOW_DEBUG: (state, active) => {
       state.showDebug = active
       setStore({
         name: 'showDebug',
         content: state.showDebug
       })
     },
-    SET_SHOWTHEME: (state, active) => {
+    SET_SHOW_THEME: (state, active) => {
       state.showTheme = active
       setStore({
         name: 'showTheme',
         content: state.showTheme
       })
     },
-    SET_SHOWCOLOR: (state, active) => {
+    SET_SHOW_COLOR: (state, active) => {
       state.showColor = active
       setStore({
         name: 'showColor',

+ 1 - 1
src/views/activiti/task.vue

@@ -88,7 +88,7 @@
       return {
         actPicUrl: '',
         obj: {},
-        flagList: {},
+        flagList: [],
         showTask: false,
         showComment: false,
         showPicDialog: false,

+ 2 - 2
src/views/admin/tenant/index.vue

@@ -37,7 +37,7 @@
 </template>
 
 <script>
-  import {addObj, delObj, fetchList, putObj} from '@/api/admin/tenant'
+  import {addObj, delObj, fetchPage, putObj} from '@/api/admin/tenant'
   import {tableOption} from '@/const/crud/admin/tenant'
   import {mapGetters} from 'vuex'
 
@@ -69,7 +69,7 @@
     methods: {
       getList(page, params) {
         this.tableLoading = true
-        fetchList(Object.assign({
+        fetchPage(Object.assign({
           current: page.currentPage,
           size: page.pageSize
         }, params, this.searchForm)).then(response => {