Forráskód Böngészése

update: The code structure is finished, and the project can run successfully

QM303176530 5 éve
szülő
commit
fdc7caad6f

+ 3 - 2
web/src/store/module/user.js

@@ -31,6 +31,7 @@ export const user = {
             state.token = ""
             state.expiresAt = ""
             router.push({ name: 'login', replace: true })
+            sessionStorage.clear()
             window.location.reload()
         },
         ResetUserInfo(state, userInfo = {}) {
@@ -45,7 +46,7 @@ export const user = {
             commit('setUserInfo', res.data.user)
             commit('setToken', res.data.token)
             commit('setExpiresAt', res.data.expiresAt)
-            if (res.success) {
+            if (res.code == 0) {
                 const redirect = router.history.current.query.redirect
                 if (redirect) {
                     router.push({ path: redirect })
@@ -56,7 +57,7 @@ export const user = {
         },
         async LoginOut({ commit }) {
             const res = await jsonInBlacklist()
-            if (res.success) {
+            if (res.code == 0) {
                 commit("LoginOut")
             }
         }

+ 7 - 7
web/src/utils/request.js

@@ -21,13 +21,13 @@ const showLoading = () => {
 }
 
 const closeLoading = () => {
-        acitveAxios--
-        if (acitveAxios <= 0) {
-            clearTimeout(timer)
-            loadingInstance && loadingInstance.close()
-        }
+    acitveAxios--
+    if (acitveAxios <= 0) {
+        clearTimeout(timer)
+        loadingInstance && loadingInstance.close()
     }
-    //http request 拦截器
+}
+//http request 拦截器
 service.interceptors.request.use(
     config => {
         showLoading()
@@ -55,7 +55,7 @@ service.interceptors.request.use(
 service.interceptors.response.use(
     response => {
         closeLoading()
-        if (response.data.success || response.headers.success === "true") {
+        if (response.data.code == 0 || response.headers.success === "true") {
             return response.data
         } else {
             Message({

+ 1 - 1
web/src/view/example/breakpoint/breakpoint.vue

@@ -119,7 +119,7 @@ export default {
           fileMd5: this.fileMd5
         }
         const res = await breakpointContinueFinish(params)
-        if (res.success) {
+        if (res.code == 0) {
           // 合成文件过后 删除缓存切片
           const params = {
             fileName: this.file.name,

+ 3 - 3
web/src/view/example/customer/customer.vue

@@ -116,7 +116,7 @@ export default {
     async updateCustomer(row){
       const res = await getExaCustomer(row)
       this.type = "update"
-      if(res.success){
+      if(res.code == 0){
         this.form = res.data.customer        
         this.dialogFormVisible = true
       }
@@ -127,7 +127,7 @@ export default {
     async deleteCustomer(row){
       this.visible = false
       const res = await deleteExaCustomer(row)
-      if (res.success){
+      if (res.code == 0){
          this.getTableData()
       }
     },
@@ -146,7 +146,7 @@ export default {
 
       }
      
-      if(res.success){
+      if(res.code == 0){
         this.dialogFormVisible = false
         this.getTableData()
       }

+ 2 - 2
web/src/view/example/upload/upload.vue

@@ -108,7 +108,7 @@ export default {
       })
         .then(async () => {
           const res = await deleteFile(row)
-          if (res.success) {
+          if (res.code == 0) {
             this.$message({
               type: 'success',
               message: '删除成功!'
@@ -143,7 +143,7 @@ export default {
         type: 'success',
         message: '上传成功'
       })
-      if (res.success) {
+      if (res.code == 0) {
         this.getTableData()
       }
         this.fullscreenLoading = false

+ 21 - 8
web/src/view/layout/aside/historyComponent/history.vue

@@ -16,18 +16,32 @@ export default {
     name:"HistoryComponent",
     data(){
         return{
-            historys:[
+            historys:[],
+            activeValue:"dashbord"
+        }
+    },
+    created(){
+        const initHistorys = [
                 {
                 name:"dashbord",
                 meta:{
                     title:"仪表盘"
                 }
                 }
-            ],
-            activeValue:"dashbord"
-        }
+            ]
+        this.historys = JSON.parse(sessionStorage.getItem("historys")) || initHistorys
+        this.setTab(this.$route)
     },
     methods:{
+        setTab(route){
+        if(!this.historys.some(item=>item.name==route.name)){
+           const obj = {}
+           obj.name = route.name
+           obj.meta = route.meta
+        this.historys.push(obj)
+       }
+           this.activeValue = this.$route.name
+        },
         changeTab(tab){
             this.$router.push({name:tab.name})
         },
@@ -50,11 +64,10 @@ export default {
     watch:{
      $route( to ){
        this.historys = this.historys.filter(item=>!item.meta.hidden)
-       if(!this.historys.some(item=>item.name==to.name)){
-        this.historys.push(to)
-       }
-       this.activeValue = to.name
+       this.setTab(to)
+       sessionStorage.setItem("historys",JSON.stringify(this.historys))
      }
+     
     }
 }
 </script>

+ 1 - 1
web/src/view/login/register.vue

@@ -83,7 +83,7 @@ export default {
       this.$refs.registerForm.validate(async v => {
         if (v) {
           const res = await register(this.registerForm)
-          if (res.success) {
+          if (res.code == 0) {
             this.$message({
               type: 'success',
               message: '注册成功',

+ 3 - 3
web/src/view/superAdmin/api/api.vue

@@ -195,7 +195,7 @@ export default {
       })
         .then(async () => {
           const res = await deleteApi(row)
-          if (res.success) {
+          if (res.code == 0) {
             this.$message({
               type: 'success',
               message: '删除成功!'
@@ -217,7 +217,7 @@ export default {
             case 'addApi':
               {
                 const res = await createApi(this.form)
-                if (res.success) {
+                if (res.code == 0) {
                   this.$message({
                     type: 'success',
                     message: '添加成功',
@@ -232,7 +232,7 @@ export default {
             case 'edit':
               {
                 const res = await updateApi(this.form)
-                if (res.success) {
+                if (res.code == 0) {
                   this.$message({
                     type: 'success',
                     message: '添加成功',

+ 2 - 2
web/src/view/superAdmin/authority/authority.vue

@@ -119,7 +119,7 @@ export default {
       })
         .then(async () => {
           const res = await deleteAuthority({ authorityId: row.authorityId })
-          if (res.success) {
+          if (res.code == 0) {
             this.$message({
               type: 'success',
               message: '删除成功!'
@@ -159,7 +159,7 @@ export default {
       this.$refs.authorityForm.validate(async valid => {
         if (valid) {
           const res = await createAuthority(this.form)
-          if (res.success) {
+          if (res.code == 0) {
             this.$message({
               type: 'success',
               message: '添加成功!'

+ 1 - 1
web/src/view/superAdmin/authority/components/apis.vue

@@ -76,7 +76,7 @@ export default {
         authorityId: this.activeUserId,
         casbinInfos
       })
-      if (res.success) {
+      if (res.code == 0) {
         this.$message({ type: 'success', message: res.msg })
       }
     }

+ 1 - 1
web/src/view/superAdmin/authority/components/datas.vue

@@ -60,7 +60,7 @@ export default {
     // 提交
       async authDataEnter(){
           const res = await setDataAuthority(this.row)
-          if(res.success){
+          if(res.code == 0){
               this.$message({ type: 'success', message: res.msg })
           }
       },

+ 1 - 1
web/src/view/superAdmin/authority/components/menus.vue

@@ -46,7 +46,7 @@ export default {
         menus: checkArr,
         authorityId: this.row.authorityId
       })
-      if (res.success) {
+      if (res.code == 0) {
         this.$message({
           type: 'success',
           message: '添加成功!'

+ 2 - 2
web/src/view/superAdmin/menu/menu.vue

@@ -145,7 +145,7 @@ export default {
       })
         .then(async () => {
           const res = await deleteBaseMenu({ ID })
-          if (res.success) {
+          if (res.code == 0) {
             this.$message({
               type: 'success',
               message: '删除成功!'
@@ -190,7 +190,7 @@ export default {
           } else {
             res = await addBaseMenu(this.form)
           }
-          if (res.success) {
+          if (res.code == 0) {
             this.$message({
               type: 'success',
               message: '添加成功!'

+ 2 - 2
web/src/view/superAdmin/user/user.vue

@@ -132,7 +132,7 @@ export default {
       this.$refs.userForm.validate(async valid => {
         if (valid) {
           const res = await register(this.userInfo)
-          if (res.success) {
+          if (res.code == 0) {
             this.$message({ type: 'success', message: '创建成功' })
           }
           await this.getTableData()
@@ -161,7 +161,7 @@ export default {
         uuid: row.uuid,
         authorityId: row.authority.authorityId
       })
-      if (res.success) {
+      if (res.code == 0) {
         this.$message({ type: 'success', message: '角色设置成功' })
       }
     }

+ 2 - 2
web/src/view/systemTools/system/system.vue

@@ -115,14 +115,14 @@ export default {
   methods: {
     async initForm() {
       const res = await getSystemConfig()
-      if (res.success) {
+      if (res.code == 0) {
         this.config = res.data.config
       }
     },
     reload() {},
     async update() {
       const res = await setSystemConfig({ config: this.config })
-      if (res.success) {
+      if (res.code == 0) {
         this.$message({
           type: 'success',
           message: '配置文件设置成功'

+ 1 - 1
web/src/view/workflow/workflowCreate/workflowCreate.vue

@@ -101,7 +101,7 @@ export default {
     },
     async submit() {
       const res = await createWorkFlow(this.form)
-      if(res.success){
+      if(res.code == 0){
           this.$message({
               message:"创建成功",
               type:"success"