zhaobao 3 năm trước cách đây
mục cha
commit
7e3ecbaf6a
3 tập tin đã thay đổi với 36 bổ sung28 xóa
  1. 1 1
      src/layout/components/Navbar.vue
  2. 2 2
      src/settings.js
  3. 33 25
      src/views/system/profile/userProfile.vue

+ 1 - 1
src/layout/components/Navbar.vue

@@ -91,7 +91,7 @@ export default {
       sideMenus: [],
       sideMenuTabList: [
         { name: '工作总览', icon: 'el-icon-s-platform', path: '/hos/satisfy/overview', permit: 'hos_satisfy_overview', id: 0 },
-        { name: '实时监测', icon: 'icon-common_monitoring', path: '/hos/satisfy/panorama', permit: 'hos_satisfy_panorama', id: 1 },
+        // { name: '实时监测', icon: 'icon-common_monitoring', path: '/hos/satisfy/panorama', permit: 'hos_satisfy_panorama', id: 1 },
         { name: '建设规划', icon: 'icon-common_saving', path: '/hos/satisfy/instruction', permit: 'hos_satisfy_instruction', id: 2 },
         { name: '任务动态', icon: 'icon-common_task', path: '/hos/satisfy/task', permit: 'hos_satisfy_task', id: 3 },
         { name: '成果评价', icon: 'icon-common_evaluate', path: '/hos/satisfy/assess', permit: 'hos_satisfy_assess', id: 4 },

+ 2 - 2
src/settings.js

@@ -36,8 +36,8 @@ module.exports = {
   /**
   * 服务API地址
   */
-  serverUrl: 'http://1.15.92.205:8001/', // 正式环境
-  devServerUrl: 'http://1.15.92.205:8001/', // 开发环境
+  serverUrl: 'https://api.xazhyc.com/', // 正式环境
+  devServerUrl: 'https://api.xazhyc.com', // 开发环境
   // serverUrl: 'http://114.116.19.14:8080/', // 正式环境
   // devServerUrl: 'http://192.168.3.5:8080',
   /**

+ 33 - 25
src/views/system/profile/userProfile.vue

@@ -98,6 +98,9 @@
                     <el-button type="primary" @click="submitForm('passForm')">更新</el-button>
                   </div>
                 </el-tab-pane>
+                <el-tab-pane label="微信绑定" name="wx">
+                  <div id="qrcodetemplate" ref="qrcodetemplate" />
+                </el-tab-pane>
               </el-tabs>
             </vuescroll>
           </div>
@@ -113,6 +116,7 @@ import { updatePassword } from '@/api/system/userApi'
 import { mapGetters } from 'vuex'
 import vuescroll from 'vuescroll'
 import ImageCropper from '@/components/ImageCropper/index'
+import QRCode from 'qrcodejs2'
 export default {
   name: 'UserProfile',
   components: {
@@ -210,17 +214,30 @@ export default {
     cropperClose() {
       this.imageCropperShow = false
     },
-
+    drawQrcode() {
+      const ocId = this.userData.ocId
+      const userId = this.userData.userId
+      const url = 'http://192.168.3.253:8001/wx/auth/' + ocId + '/' + userId
+      if (!url) {
+        this.$message.error('没有生产二维码的参数')
+        return
+      }
+      this.$nextTick(() => {
+        this.$refs.qrcodetemplate.innerHTML = ''
+        new QRCode('qrcodetemplate', {
+          width: 200,
+          height: 200,
+          text: url.toString()
+        })
+      })
+    },
     getData() {
       getUserProfile().then((resp) => {
-        const { code, data, msg } = resp
-        if (code === 200) {
-          this.viewData = JSON.parse(JSON.stringify(data))
-          this.basicData = data
-          this.passData.accountId = data.accountId
-        } else {
-          this.$message.error(msg)
-        }
+        const { data } = resp
+        this.viewData = JSON.parse(JSON.stringify(data))
+        this.basicData = data
+        this.passData.accountId = data.accountId
+        this.drawQrcode()
       }).catch((error) => {
         console.log(error)
       })
@@ -232,27 +249,18 @@ export default {
         if (valid) {
           if (formName === 'basicForm') {
             updateUserProfile(this.basicData).then((resp) => {
-              const { code, msg } = resp
-              if (code === 200) {
-                this.userData.userAvatar = this.basicData.accountAvatar
-                this.userData.userName = this.basicData.accountName
-                this.$store.dispatch('user/updateUserData', this.userData)
-                this.$message.success(msg)
-                this.getData()
-              } else {
-                this.$message.error(msg)
-              }
+              const { msg } = resp
+              this.userData.userAvatar = this.basicData.accountAvatar
+              this.userData.userName = this.basicData.accountName
+              this.$store.dispatch('user/updateUserData', this.userData)
+              this.$message.success(msg)
+              this.getData()
             }).catch((error) => {
               console.log(error)
             })
           } else {
             updatePassword(this.passData).then((resp) => {
-              const { code } = resp
-              if (code === 200) {
-                this.$message.success('密码更改成功!')
-              } else {
-                this.$message.error('密码更改失败!')
-              }
+              this.$message.success('密码更改成功!')
             }).catch((error) => {
               console.log(error)
             })