朱鑫波 3 năm trước cách đây
mục cha
commit
79dfedb9dd

+ 8 - 1
src/permission.js

@@ -6,7 +6,8 @@ import 'nprogress/nprogress.css' // progress bar style
 import notification from 'ant-design-vue/es/notification'
 import { ACCESS_TOKEN } from '@/store/mutation-types'
 import { generateIndexRouter } from "@/utils/util"
-
+import warterMark from './warterMark'
+import { mapGetters, mapMutations, mapActions } from 'vuex'
 NProgress.configure({ showSpinner: false }) // NProgress Configuration
 
 
@@ -22,9 +23,11 @@ router.beforeEach((to, from, next) => {
     /* has token */
 
     if (to.path === '/user/login') {
+      warterMark.out()
       next({ path: '/dashboard/workplace' })
       NProgress.done()
     } else {
+      // warterMark.set(store.getters.userInfo.roleName)
       if (store.getters.permissionList.length === 0) {
         store.dispatch('GetPermissionList').then(res => {
           const menuData = res.result.menu;
@@ -54,19 +57,23 @@ router.beforeEach((to, from, next) => {
                message: '系统提示',
                description: '请求用户信息失败,请重试!'
              })*/
+            warterMark.out()
             store.dispatch('Logout').then(() => {
               next({ path: '/user/login', query: { redirect: to.fullPath } })
             })
           })
       } else {
+        warterMark.set(store.getters.userInfo.realname)
         next()
       }
     }
   } else {
     if (whiteList.indexOf(to.path) !== -1) {
       // 在免登录白名单,直接进入
+      // warterMark.set(store.getters.userInfo.roleName)
       next()
     } else {
+      warterMark.out()
       next({ path: '/user/login', query: { redirect: to.fullPath } })
       NProgress.done() // if current page is login will not trigger afterEach hook, so manually handle it
     }

+ 1 - 10
src/views/modules/autoLaunch/channelManage/createChannel.vue

@@ -440,16 +440,7 @@ li.chouzhen.first:before {
                                 <a-row :gutter="16">
                                     <a-col :span="16">
                                         <a-form-item label="调起链接">
-                                            <a-input
-                                                v-decorator="[
-                                                    'schemaUri',
-                                                    {
-                                                        rules: [{ validator: handleConfirmValueOkUndefind }]
-                                                    }
-                                                ]"
-                                                allow-clear
-                                                id="schemaUri"
-                                            />
+                                            <a-input v-decorator="['schemaUri']" allow-clear id="schemaUri" />
                                         </a-form-item>
                                         <a-form-item
                                             v-bind="tailFormItemLayout"

+ 8 - 4
src/views/modules/material/accountCheckBytedance.vue

@@ -212,8 +212,12 @@ export default {
     handleOk(e) {
       console.log(e)
       var data = this.$refs.tree.getCheckedKeys()
+      var dataArr = data.map(item=>{
+        return item.split('@')[0]
+      })
+      // console.log(dataArr)
       this.showEdit = false
-      this.$emit('synchro', {treeData:data,shieldBackwardSwitch:this.shieldBackwardSwitch})
+      this.$emit('synchro', {treeData:dataArr,shieldBackwardSwitch:this.shieldBackwardSwitch})
     },
     close() {
       this.showEdit = false
@@ -251,7 +255,7 @@ export default {
       console.log(node)
       var data = []
       if (node.level == 1) {
-        var id = node.label
+        var id = node.key.split('@')[1]
 
         getAction('/ctop/userAllocation/getAccountIdListByUserId', {
           userId: id,
@@ -301,8 +305,8 @@ export default {
           console.log(res)
           this.options = res.result.map((item) => {
             return {
-              id: item.accountId,
-              label: item.userId,
+              id: item.accountId+'@'+item.userId,
+              label: item.userId+'-'+item.projectName,
               children: [],
             }
           })

+ 62 - 0
src/warterMark.js

@@ -0,0 +1,62 @@
+
+let watermark = {}
+ 
+let setWatermark = (str) => {
+  let id = '1.23452384164.123412415'
+ 
+  if (document.getElementById(id) !== null) {
+    document.body.removeChild(document.getElementById(id))
+  }
+ 
+  let can = document.createElement('canvas')
+  can.width = 300
+  can.height = 300
+ 
+  let cans = can.getContext('2d')
+  cans.rotate(-20 * Math.PI / 180)
+  cans.font = '20px Vedana'
+  cans.fillStyle = 'rgba(200, 200, 200, 0.40)'
+  cans.textAlign = 'left'
+  cans.textBaseline = 'Middle'
+  cans.fillText(str, can.width / 3, can.height / 2)
+ 
+  let div = document.createElement('div')
+  div.id = id
+  div.style.pointerEvents = 'none'
+  div.style.top = '70px'
+  div.style.left = '100px'
+  div.style.position = 'fixed'
+  div.style.zIndex = '100000'
+  div.style.width = document.documentElement.clientWidth - 100 + 'px'
+  div.style.height = document.documentElement.clientHeight - 100 + 'px'
+  div.style.background = 'url(' + can.toDataURL('image/png') + ') left top repeat'
+  document.body.appendChild(div)
+  return id
+}
+ 
+// 该方法只允许调用一次
+watermark.set = (str) => {
+  let id = setWatermark(str)
+  setInterval(() => {
+    if (document.getElementById(id) === null) {
+      id = setWatermark(str)
+    }
+  }, 500)
+  window.onresize = () => {
+    setWatermark(str)
+  }
+}
+
+const outWatermark = (id) => {
+  if (document.getElementById(id) !== null) {
+    const div = document.getElementById(id)
+    div.style.display = 'none'
+  }
+}
+
+watermark.out = () => {
+  const str = '7.432756475.689573874'
+  outWatermark(str)
+}
+ 
+export default watermark