Selaa lähdekoodia

fix:bug修复

lisiyan 10 kuukautta sitten
vanhempi
commit
118c7bfd90

+ 16 - 8
src/components/sideMenu.vue

@@ -41,6 +41,16 @@ export default {
       })
       this.$cookies.remove('accessToken')
       userStore().clearUserInfo()
+    },
+    //账号信息修改后立即刷新显示
+    updateUserInfo(){
+      get(
+        '/pdf-tech/vppMember/getMemberInfo'
+      ).then((res) => {
+        if (res.data.code === 200 && res.data.msg == 'success') {
+          userStore().setUserInfo(res.data.result)
+        }
+      })
     }
   },
   filters:{
@@ -61,20 +71,18 @@ export default {
     }
   },
   computed:{
-    path () {
+    path() {
       if (this.$route.path === '/manage-team/create-team' || this.$route.path === '/manage-team/edit-team') {
         return '/manage-team'
-      } else if (this.$route.path === '/manage-member/add-member' || 
-                this.$route.path.indexOf('/manage-member/edit-member') !== -1) {
-        return '/manage-member'
-      } else if (this.$route.path === '/manage-admin/add-admin' ||
-                this.$route.path.indexOf('/manage-admin/edit-admin') !== -1) {
+      } else if (this.$route.path === '/manage-member/add-member' || this.$route.path.indexOf('/manage-member/edit-member') !== -1) {
+          return '/manage-member'
+      } else if (this.$route.path === '/manage-admin/add-admin' || this.$route.path.indexOf('/manage-admin/edit-admin') !== -1) {
         return '/manage-admin'
       }  else {
         return this.$route.path
       }
     },
-    roles(){
+    roles() {
       if (this.role?.indexOf("1") !== -1) {
         return 'Super Admin'
       } else if (this.role?.indexOf("2") !== -1){
@@ -85,7 +93,7 @@ export default {
         return 'Team member'
       }
     },
-    init(){
+    init() {
       return userStore().getInit
     }
   }

+ 1 - 1
src/views/Container.vue

@@ -8,7 +8,7 @@ export default {
   },
   methods:{
     getInfo(){
-      this.$refs.sideMenu.updataUserInfo()
+      this.$refs.sideMenu.updateUserInfo()
     }
   }
 }

+ 18 - 3
src/views/ProductManagement.vue

@@ -1,5 +1,5 @@
 <script setup>
-import { onMounted, ref, getCurrentInstance } from 'vue'
+import { onMounted, ref, getCurrentInstance, defineProps } from 'vue'
 import copy from 'copy-to-clipboard'
 import { get, post } from '../../utils/request'
 import { userStore } from '@/store/userInfo'
@@ -101,18 +101,33 @@ const upLoadChange = (value) => {
   const formData = new FormData()
   formData.append("keyFile", file.value)
   post('/pdf-tech/vppKeyFile/parseKeyFile', formData)
-    .then((res) => {
+    .then(async (res) => {
       if (res.data.code === 200) {
         proxy.$message({
           duration: 5000,
           message: 'Upload Successfully',
           type: 'success'
         })
+        if (!userStore().getInit) {
+          await userStore().getInitorUpdate()
+        }
         pagingQuery()
+      } else if (res.data.msg === 'Server ID Error. Please check your Key File.') {
+        proxy.$message({
+          duration: 5000,
+          message: 'Server ID Error. Please check your Key File.',
+          type: 'error'
+        })
+      } else if (res.data.msg === 'Signature invalid. Please check your Key File.') {
+        proxy.$message({
+          duration: 5000,
+          message: 'Signature invalid. Please check your Key File.',
+          type: 'error'
+        })
       } else {
         proxy.$message({
           duration: 5000,
-          message: 'Verify Failed, please try again',
+          message: 'Verily Failed, please try again.',
           type: 'error'
         })
       }

+ 4 - 4
src/views/Reseller/License.vue

@@ -27,8 +27,8 @@ onMounted(() => {
     pageText.childNodes[0].nodeValue = 'Jump to Page'
   }
   pagingQuery()
-  getproductList()
-  updataUserInfo()
+  getProductList()
+  updateUserInfo()
 })
 const pagingQuery = (val) => {
   //初始化表格
@@ -71,7 +71,7 @@ const pagingQuery = (val) => {
   })
 }
 //获取已购买产品
-const getproductList = (val) => {
+const getProductList = (val) => {
   get('/pdf-tech/product/listWithAll').then(
     (res) => {
       const data = res.data.result
@@ -137,7 +137,7 @@ const searchInfo = (val) => {
   pagingQuery()
 }
 // 获取用户信息
-const updataUserInfo = () => {
+const updateUserInfo = () => {
   get(
     '/pdf-tech/vppMember/getMemberInfo'
   ).then((res) => {

+ 4 - 4
src/views/Reseller/Product.vue

@@ -19,8 +19,8 @@ onMounted(() => {
     pageText.childNodes[0].nodeValue = 'Jump to Page'
   }
   pagingQuery()
-  getproductList()
-  updataUserInfo()
+  getProductList()
+  updateUserInfo()
 })
 //筛选
 const searchInfo = () => {
@@ -54,7 +54,7 @@ const pagingQuery = () => {
   })
 }
 //获取已购买产品
-const getproductList = (val) => {
+const getProductList = (val) => {
   get('/pdf-tech/product/listWithAll').then(
     (res) => {
       const data = res.data.result
@@ -80,7 +80,7 @@ const handleCurrentChange = (value) => {
   pagingQuery()
 }
 // 获取用户信息
-const updataUserInfo = () => {
+const updateUserInfo = () => {
   get(
     '/pdf-tech/vppMember/getMemberInfo'
   ).then((res) => {