asd123a20 3 anos atrás
pai
commit
6ad60cde1a

+ 1 - 0
lib/plug/axios.js

@@ -44,6 +44,7 @@ axios.interceptors.response.use(
     }
     }
     if (status === 401) {
     if (status === 401) {
       Message.error('请重新登录')
       Message.error('请重新登录')
+      sessionStorage.clear()
       router.push('/login')
       router.push('/login')
       return false
       return false
     }
     }

+ 7 - 8
src/store/index.js

@@ -18,7 +18,7 @@ import specialist from './wokes/specialist'
 // 订单
 // 订单
 import order from './wokes/order'
 import order from './wokes/order'
 Vue.use(Vuex)
 Vue.use(Vuex)
-const codes = ['columns', 'status', 'region', 'orderStatus']
+// const codes = ['columns', 'status', 'region', 'orderStatus']
 const uri = '/naf/items/'
 const uri = '/naf/items/'
 export default new Vuex.Store({
 export default new Vuex.Store({
   state: {
   state: {
@@ -30,13 +30,12 @@ export default new Vuex.Store({
     }
     }
   },
   },
   actions: {
   actions: {
-    init ({ commit }) {
-      codes.filter(async e => {
-        const res = await axios.get(`${uri}${e}/list`)
-        if (res.errcode === 0) {
-          commit('setdice', { type: e, list: res.data })
-        }
-      })
+    async init ({ commit }, e) {
+      const res = await axios.get(`${uri}${e}/list`)
+      if (res.errcode === 0) {
+        commit('setdice', { type: e, list: res.data })
+      }
+      return res
     }
     }
   },
   },
   modules: {
   modules: {

+ 1 - 1
src/store/wokes/files.js

@@ -1,6 +1,6 @@
 import axios from '@lib/plug/axios.js'
 import axios from '@lib/plug/axios.js'
 const api = {
 const api = {
-  filesupload: '/files/upload'
+  filesupload: '/filesPath/medical/upload'
 }
 }
 
 
 // 参数帐号id  appid
 // 参数帐号id  appid

+ 2 - 1
src/views/frame/frame.vue

@@ -63,7 +63,7 @@ export default {
     ...mapActions(['init'])
     ...mapActions(['init'])
   },
   },
   async mounted () {
   async mounted () {
-    await this.init()
+    // await this.init()
     // 登录超时检查
     // 登录超时检查
     const worker = new Worker('./worker/token.js')
     const worker = new Worker('./worker/token.js')
     const token = sessionStorage.getItem('token')
     const token = sessionStorage.getItem('token')
@@ -77,6 +77,7 @@ export default {
           _this.$alert('请重新登录', '登录过期', {
           _this.$alert('请重新登录', '登录过期', {
             confirmButtonText: '确定',
             confirmButtonText: '确定',
             callback: () => {
             callback: () => {
+              sessionStorage.clear()
               _this.$router.push('/')
               _this.$router.push('/')
               num = 0
               num = 0
             }
             }

+ 19 - 10
src/views/gaf/user.vue

@@ -29,8 +29,8 @@ import nafGrid from '@naf/data/tables/naf-grid'
 import dialogDrawer from '@naf/data/dialog -drawer'
 import dialogDrawer from '@naf/data/dialog -drawer'
 import nafForm from '@naf/data/form'
 import nafForm from '@naf/data/form'
 import vueQr from 'vue-qr'
 import vueQr from 'vue-qr'
-import { createNamespacedHelpers } from 'vuex'
-const { mapState, mapActions } = createNamespacedHelpers('adminuser')
+import { createNamespacedHelpers, mapActions } from 'vuex'
+const { mapState, mapActions: adminmapActions } = createNamespacedHelpers('adminuser')
 export default {
 export default {
   components: {
   components: {
     nafGrid,
     nafGrid,
@@ -40,6 +40,7 @@ export default {
   },
   },
   data () {
   data () {
     return {
     return {
+      userinfo: {},
       downloadData: {},
       downloadData: {},
       qrshow: false,
       qrshow: false,
       is_data: {},
       is_data: {},
@@ -72,21 +73,26 @@ export default {
     }
     }
   },
   },
   methods: {
   methods: {
-    ...mapActions(['getUser', 'usercreate', 'userupdate', 'userdelete']),
+    ...adminmapActions(['getUser', 'usercreate', 'userupdate', 'userdelete']),
+    ...mapActions(['init']),
     // 绑定微信
     // 绑定微信
     qr (e) {
     qr (e) {
-      const userName = e.userName
+      this.userinfo = e
       this.downloadData = {
       this.downloadData = {
-        url: `${Vue.config.weixin.baseUrl}/api/weixin/bind?userName=${userName}`,
+        url: `${Vue.config.weixin.baseUrl}/api/weixin/bind`,
         icon: ''
         icon: ''
       }
       }
       this.qrshow = true
       this.qrshow = true
       this.$stomp({ '/exchange/qrcode.topic/bind': this.onMessage })
       this.$stomp({ '/exchange/qrcode.topic/bind': this.onMessage })
     },
     },
-    onMessage (msg) {
-      if (msg.body === 'success') {
-        this.qrshow = false
-        this.$message.success('操作成功')
+    async onMessage (msg) {
+      const { openid } = JSON.parse(msg.body)
+      if (openid) {
+        const res = await this.userupdate({ ...this.userinfo, openid })
+        if (res.errcode === 0) {
+          this.qrshow = false
+          this.$message.success('操作成功')
+        }
       }
       }
     },
     },
     // 添加
     // 添加
@@ -152,7 +158,10 @@ export default {
     }
     }
   },
   },
   async mounted () {
   async mounted () {
-    this.query()
+    const res = await this.init('status')
+    if (res.errcode === 0) {
+      this.query()
+    }
   },
   },
   computed: {
   computed: {
     ...mapState(['total', 'userList']),
     ...mapState(['total', 'userList']),

+ 15 - 11
src/views/wokes/content/content.vue

@@ -35,7 +35,7 @@
             <el-upload
             <el-upload
               v-if="item.name == 'thumbnail'"
               v-if="item.name == 'thumbnail'"
               class="avatar-uploader avatar"
               class="avatar-uploader avatar"
-              action="/tyylfiles/upload"
+              action="/filesPath/medical/upload"
               :show-file-list="false"
               :show-file-list="false"
               :on-success="handleAvatarSuccess"
               :on-success="handleAvatarSuccess"
               :before-upload="beforeAvatarUpload"
               :before-upload="beforeAvatarUpload"
@@ -58,9 +58,9 @@
 import nafGrid from '@naf/data/tables/naf-grid'
 import nafGrid from '@naf/data/tables/naf-grid'
 import nafForm from '@naf/data/form'
 import nafForm from '@naf/data/form'
 import editorBar from '@naf/data/editoritem'
 import editorBar from '@naf/data/editoritem'
-import { createNamespacedHelpers } from 'vuex'
+import { createNamespacedHelpers, mapActions } from 'vuex'
 const token = sessionStorage.getItem('token')
 const token = sessionStorage.getItem('token')
-const { mapState, mapActions } = createNamespacedHelpers('content')
+const { mapState, mapActions: contentmapActions } = createNamespacedHelpers('content')
 export default {
 export default {
   components: {
   components: {
     nafGrid,
     nafGrid,
@@ -113,7 +113,8 @@ export default {
     }
     }
   },
   },
   methods: {
   methods: {
-    ...mapActions(['contentquery', 'contentcreate', 'contentupdate', 'contentdelete', 'contentdetails']),
+    ...contentmapActions(['contentquery', 'contentcreate', 'contentupdate', 'contentdelete', 'contentdetails']),
+    ...mapActions(['init']),
     // 点击树
     // 点击树
     treeClick (data) {
     treeClick (data) {
       this.is_title = data.name
       this.is_title = data.name
@@ -214,14 +215,17 @@ export default {
     }
     }
   },
   },
   async mounted () {
   async mounted () {
+    const res = await this.init('columns')
     // 获取字典
     // 获取字典
-    this.columns = this.$dict('columns')
-    // eslint-disable-next-line eqeqeq
-    if (this.columns.length > 0) {
-      this.is_title = this.columns[0].name
-      this.$refs.deeptree.setCurrentKey(this.columns[0].code)
-      this.data = this.columns[0]
-      this.query()
+    if (res.errcode === 0) {
+      this.columns = this.$dict('columns')
+      // eslint-disable-next-line eqeqeq
+      if (this.columns.length > 0) {
+        this.is_title = this.columns[0].name
+        this.$refs.deeptree.setCurrentKey(this.columns[0].code)
+        this.data = this.columns[0]
+        this.query()
+      }
     }
     }
   },
   },
   computed: {
   computed: {

+ 16 - 12
src/views/wokes/hospital/hospital.vue

@@ -36,7 +36,7 @@
             <el-upload
             <el-upload
               v-if="item.name == 'thumbnail'"
               v-if="item.name == 'thumbnail'"
               class="avatar-uploader avatar"
               class="avatar-uploader avatar"
-              action="/tyylfiles/upload"
+              action="/filesPath/medical/upload"
               :show-file-list="false"
               :show-file-list="false"
               :on-success="handleAvatarSuccess"
               :on-success="handleAvatarSuccess"
               :before-upload="beforeAvatarUpload"
               :before-upload="beforeAvatarUpload"
@@ -59,9 +59,9 @@
 import nafGrid from '@naf/data/tables/naf-grid'
 import nafGrid from '@naf/data/tables/naf-grid'
 import nafForm from '@naf/data/form'
 import nafForm from '@naf/data/form'
 import editorBar from '@naf/data/editoritem'
 import editorBar from '@naf/data/editoritem'
-import { createNamespacedHelpers } from 'vuex'
+import { createNamespacedHelpers, mapActions } from 'vuex'
 const token = sessionStorage.getItem('token')
 const token = sessionStorage.getItem('token')
-const { mapState, mapActions } = createNamespacedHelpers('hospital')
+const { mapState, mapActions: hospitalmapActions } = createNamespacedHelpers('hospital')
 export default {
 export default {
   components: {
   components: {
     nafGrid,
     nafGrid,
@@ -123,7 +123,8 @@ export default {
     }
     }
   },
   },
   methods: {
   methods: {
-    ...mapActions(['hospitalquery', 'hospitalcreate', 'hospitalupdate', 'hospitaldelete', 'hospitaldetails']),
+    ...hospitalmapActions(['hospitalquery', 'hospitalcreate', 'hospitalupdate', 'hospitaldelete', 'hospitaldetails']),
+    ...mapActions(['init']),
     // 点击树
     // 点击树
     treeClick (data) {
     treeClick (data) {
       this.is_title = data.name
       this.is_title = data.name
@@ -224,14 +225,17 @@ export default {
     }
     }
   },
   },
   async mounted () {
   async mounted () {
-    // 获取字典
-    this.region = this.$dict('region')
-    // eslint-disable-next-line eqeqeq
-    if (this.region.length > 0) {
-      this.is_title = this.region[0].name
-      this.$refs.deeptree.setCurrentKey(this.region[0].code)
-      this.data = this.region[0]
-      this.query()
+    const res = await this.init('region')
+    if (res.errcode === 0) {
+      // 获取字典
+      this.region = await this.$dict('region')
+      // eslint-disable-next-line eqeqeq
+      if (this.region && this.region.length > 0) {
+        this.is_title = this.region[0].name
+        this.$refs.deeptree.setCurrentKey(this.region[0].code)
+        this.data = this.region[0]
+        this.query()
+      }
     }
     }
   },
   },
   computed: {
   computed: {

+ 1 - 1
src/views/wokes/hospital/specialist.vue

@@ -46,7 +46,7 @@
             <el-upload
             <el-upload
               v-if="item.name == 'thumbnail'"
               v-if="item.name == 'thumbnail'"
               class="avatar-uploader avatar"
               class="avatar-uploader avatar"
-              action="/tyylfiles/upload"
+              action="/filesPath/medical/upload"
               :show-file-list="false"
               :show-file-list="false"
               :on-success="handleAvatarSuccess"
               :on-success="handleAvatarSuccess"
               :before-upload="beforeAvatarUpload"
               :before-upload="beforeAvatarUpload"

+ 1 - 1
src/views/wokes/hospital/subject.vue

@@ -36,7 +36,7 @@
             <el-upload
             <el-upload
               v-if="item.name == 'thumbnail'"
               v-if="item.name == 'thumbnail'"
               class="avatar-uploader avatar"
               class="avatar-uploader avatar"
-              action="/tyylfiles/upload"
+              action="/filesPath/medical/upload"
               :show-file-list="false"
               :show-file-list="false"
               :on-success="handleAvatarSuccess"
               :on-success="handleAvatarSuccess"
               :before-upload="beforeAvatarUpload"
               :before-upload="beforeAvatarUpload"

+ 8 - 4
src/views/wokes/order.vue

@@ -23,9 +23,9 @@
 <script>
 <script>
 import nafGrid from '@naf/data/tables/naf-grid'
 import nafGrid from '@naf/data/tables/naf-grid'
 import nafForm from '@naf/data/form'
 import nafForm from '@naf/data/form'
-import { createNamespacedHelpers } from 'vuex'
+import { createNamespacedHelpers, mapActions } from 'vuex'
 const token = sessionStorage.getItem('token')
 const token = sessionStorage.getItem('token')
-const { mapState, mapActions } = createNamespacedHelpers('order')
+const { mapState, mapActions: ordermapActions } = createNamespacedHelpers('order')
 export default {
 export default {
   components: {
   components: {
     nafGrid,
     nafGrid,
@@ -110,7 +110,8 @@ export default {
     }
     }
   },
   },
   methods: {
   methods: {
-    ...mapActions(['orderquery', 'ordercreate', 'orderupdate', 'orderdelete', 'orderdetails']),
+    ...ordermapActions(['orderquery', 'ordercreate', 'orderupdate', 'orderdelete', 'orderdetails']),
+    ...mapActions(['init']),
     // 添加
     // 添加
     async addorder () {
     async addorder () {
       this.is_data = {}
       this.is_data = {}
@@ -173,7 +174,10 @@ export default {
     }
     }
   },
   },
   async mounted () {
   async mounted () {
-    this.query()
+    const res = await this.init('orderStatus')
+    if (res.errcode === 0) {
+      this.query()
+    }
   },
   },
   computed: {
   computed: {
     ...mapState(['total', 'orderList', 'orderItem']),
     ...mapState(['total', 'orderList', 'orderItem']),

+ 5 - 8
vue.config.js

@@ -26,17 +26,14 @@ module.exports = {
         // target: 'http://192.168.4.1:7001'
         // target: 'http://192.168.4.1:7001'
         target: 'http://127.0.0.1:18070'
         target: 'http://127.0.0.1:18070'
       },
       },
-      '/api/naf/': {
-        target: 'http://localhost:8002'
+      '/naf/': {
+        target: 'http://127.0.0.1:18070'
         // target: 'http://192.168.4.1:7001'
         // target: 'http://192.168.4.1:7001'
       },
       },
-      '/tyylfiles/': {
-        target: 'http://localhost:8009',
-        pathRewrite: { '^/tyylfiles/': '/tyyl/' }
+      // 上传路径
+      '/filesPath/': {
+        target: 'http://localhost:18070'
         // target: 'http://192.168.4.1:7001'
         // target: 'http://192.168.4.1:7001'
-      },
-      '/files/tyyl/': {
-        target: 'http://localhost:8006'
       }
       }
     }
     }
   }
   }