Browse Source

第三方-智能简历

armg 10 months ago
parent
commit
dd0e3d5a60

+ 2 - 2
ruoyi-ui/.env.production

@@ -5,5 +5,5 @@ VUE_APP_TITLE = 智能简历
 ENV = 'production'
 
 # 若依管理系统/生产环境
-# VUE_APP_BASE_API = '/prod-api'
-VUE_APP_BASE_API = 'http://47.103.79.143:8093'
+VUE_APP_BASE_API = '/prod-api'
+# VUE_APP_BASE_API = 'http://47.103.79.143:8093'

BIN
ruoyi-ui/dist.zip


+ 1 - 0
ruoyi-ui/public/index.html

@@ -7,6 +7,7 @@
     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
     <title><%= webpackConfig.name %></title>
+    
     <script src="https://g.alicdn.com/dingding/dingtalk-jsapi/2.0.57/dingtalk.open.js"></script>
     <!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->
 	  <style>

+ 59 - 32
ruoyi-ui/src/App.vue

@@ -8,10 +8,13 @@
 <script>
 import ThemePicker from "@/components/ThemePicker";
 
-import { authToken } from "@/api/login";
+import { authToken, authTokenThree, authLogin } from "@/api/login";
+import { initDingH5RemoteDebug } from "dingtalk-h5-remote-debug";
 import { openAuth } from "dingtalk-design-libs/biz/openAuth";
 import { setToken } from "@/utils/auth";
 import * as dd from "dingtalk-jsapi"; // 在此引入
+
+initDingH5RemoteDebug();
 export default {
   name: "App",
   components: { ThemePicker },
@@ -22,46 +25,60 @@ export default {
     // 储存
     this.$store.commit("app/SET_IS_MOBILE_ENV", isMobileEnv);
     // 取值-同步
-    console.log("是否是移动端=", this.$store.state.app.isMobileEnv);
+    // console.log("是否是移动端=", this.$store.state.app.isMobileEnv);
+    // console.log("页面链接=", window.location.href);
+    // console.log("页面corpId=", this.getUrlParam("corpId"));
+    if (this.getUrlParam("corpId")) {
+      // 存储corpId
+      this.$store.commit("app/SET_CORPID", this.getUrlParam("corpId"));
+    }
     if (dd.env.platform !== "notInDingTalk") {
       dd.ready(function () {
-        // 钉钉免登录认证
-        // dd.getAuthCode({
-        //   corpId: "ding4ab75ecd53106cde4ac5d6980864d335",
-        //   success: (res) => {
-        //     console.log("res=", res);
-        //     avoidLogin(res.code).then((res) => {
-        //       console.log("===avoidLogin_res=",res)
-        //     });
-        //   },
-        //   fail: (err) => {
-        //     console.log("err=", err);
-        //   },
-        //   complete: () => {},
-        // });
-        // 唤起授权
+        // 钉钉免登录认证-第三方企业
+        let corpId = that.$store.state.app.corpId || "ding870ccf3c4d8fc1bc";
+        // 唤起授权--统一授权套件SDK
         openAuth({
-          clientId: "dingwlimimzllguvqf8x", // 应用ID(唯一标识)
-          corpId: "ding4ab75ecd53106cde4ac5d6980864d335", // 当前组织的corpId
+          clientId: "suiteyjd6ikxpg8629ydr", // 应用ID(唯一标识)
+          corpId: corpId, // 当前组织的corpId
           rpcScope: "Contact.User.Read", //通讯录
           fieldScope: "Contact.User.mobile", //手机号
           type: 0, // 0 标识授权个人信息;1 标识授权组织信息
         }).then((res) => {
           // 处理返回数据
-          console.log("免登res=", res);
-          authToken(res.result.authCode).then((res) => {
-            let userInfo = res.sysUser;
-            setToken(res.token);
-            that.$store.commit("SET_TOKEN", res.token);
-            console.log("----钉钉环境----");
+          // console.log("免登res=", res);
+          // authToken(res.result.authCode).then((res) => {
+          //   let userInfo = res.sysUser;
+          //   setToken(res.token);
+          //   that.$store.commit("SET_TOKEN", res.token);
+          //   console.log("----钉钉环境----");
+          //   that.toTargetPage();
+          // });
+          authLogin({ code: res.code, corpId: corpId }).then((res) => {
+            // console.log("===authLogin_res=", res);
+            // let userInfo = res.sysUser;
+            setToken(res.msg);
+            that.$store.commit("SET_TOKEN", res.msg);
             that.toTargetPage();
-
-            // userInfo.nick
-            // userInfo.mobile
-            // userInfo.avatarUrl
-            // openId  unionId
           });
         });
+        // console.log("corpId===", corpId);
+        // dd.getAuthCode({
+        //   corpId: corpId,
+        //   success: (res) => {
+        //     // console.log("authTokenThree-res=", res);
+        //     authLogin({ code: res.code, corpId: corpId }).then((res) => {
+        //       // console.log("===authLogin_res=", res);
+        //       // let userInfo = res.sysUser;
+        //       setToken(res.msg);
+        //       that.$store.commit("SET_TOKEN", res.msg);
+        //       that.toTargetPage();
+        //     });
+        //   },
+        //   fail: (err) => {
+        //     // console.log("err=", err);
+        //   },
+        //   complete: () => {},
+        // });
       });
     }
   },
@@ -97,12 +114,22 @@ export default {
           path: that.redirect || "/mobile/resume/index",
         });
       } else {
+        // that.$router.push({
+        //   path: that.redirect || "/",
+        //   query: { type: "admin", title: "智能简历" },
+        // });
         that.$router.push({
-          path: that.redirect || "/",
-          query: { type: "admin", title: "智能简历" },
+          path: that.redirect || "/system/resume/index",
         });
       }
     },
+    // 解析地址栏二维码值
+    getUrlParam(name) {
+      let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
+      let r = window.location.search.substr(1).match(reg); //匹配目标参数
+      if (r != null) return decodeURI(r[2]); //返回参数值
+      return null;
+    },
   },
 };
 </script>

+ 19 - 0
ruoyi-ui/src/api/login.js

@@ -74,3 +74,22 @@ export function authToken(data) {
     data: data
   })
 }
+
+// 第三方-授权登录
+export function authTokenThree(data) {
+  return request({
+    url: '/ding/authLogin',
+    method: 'post',
+    data: data
+  })
+}
+
+// 第三方-授权登录
+export function authLogin(data) {
+  return request({
+    url: '/auth/ding/authLogin',
+    method: 'post',
+    data: data
+  })
+}
+

+ 1 - 1
ruoyi-ui/src/components/Crontab/index.vue

@@ -182,7 +182,7 @@ export default {
       "updateCrontabValue", name, value, from;
       this.crontabValueObj[name] = value;
       if (from && from !== name) {
-        console.log(`来自组件 ${from} 改变了 ${name} ${value}`);
+        // console.log(`来自组件 ${from} 改变了 ${name} ${value}`);
         this.changeRadio(name, value);
       }
     },

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

@@ -2,7 +2,7 @@
   <div class="navbar">
     <hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
 
-    <breadcrumb id="breadcrumb-container" class="breadcrumb-container" v-if="!topNav"/>
+    <!-- <breadcrumb id="breadcrumb-container" class="breadcrumb-container" v-if="!topNav"/> -->
     <top-nav id="topmenu-container" class="topmenu-container" v-if="topNav"/>
 
     <div class="right-menu">

+ 1 - 0
ruoyi-ui/src/layout/components/Sidebar/index.vue

@@ -65,6 +65,7 @@ export default {
       return path;
     },
     showLogo() {
+      // console.log("sidebarRouters=",this.sidebarRouters)
       //this.$store.getters.sidebarRouters
       //this.$store.state.sidebarRouters
       return this.$store.state.settings.sidebarLogo;

+ 2 - 2
ruoyi-ui/src/main.js

@@ -61,8 +61,8 @@ library.add(fas,)
 library.add(far)
 library.add(fab)
 Vue.component('font-awesome-icon', FontAwesomeIcon)
-// import VConsole from "vconsole";
-// const vConsole = new VConsole();
+import VConsole from "vconsole";
+const vConsole = new VConsole();
 // import * as dd from 'dingtalk-jsapi'
 // 全局方法挂载
 Vue.prototype.getDicts = getDicts

+ 10 - 2
ruoyi-ui/src/permission.js

@@ -17,6 +17,7 @@ router.beforeEach((to, from, next) => {
     to.meta.title && store.dispatch('settings/setTitle', to.meta.title)
     /* has token*/
     if (to.path === '/login') {
+      // console.log("-----111111111")
       // next({ path: '/' })
       if (store.state.app.isMobileEnv) {
         next({ path: '/mobile/resume/index' })
@@ -25,24 +26,28 @@ router.beforeEach((to, from, next) => {
       }
       NProgress.done()
     } else {
+      // console.log("-----22222")
       if (store.getters.roles.length === 0) {
         isRelogin.show = true
         // 判断当前用户是否已拉取完user_info信息
         store.dispatch('GetInfo').then(() => {
           isRelogin.show = false
           store.dispatch('GenerateRoutes').then(accessRoutes => {
+            // console.log("accessRoutes=",accessRoutes)
             // 根据roles权限生成可访问的路由表
             router.addRoutes(accessRoutes) // 动态添加可访问路由表
             // 新加的路由守卫
-            console.log("=====钉钉手机端-已经登录了的,直接去到crm首页", store.state.app.isMobileEnv)
+            // console.log("=====钉钉手机端-已经登录了的,直接去到crm首页", store.state.app.isMobileEnv)
             if (store.state.app.isMobileEnv) {
               next({ path: "/mobile/resume/index" }) // hack方法 确保addRoutes已完成
             } else {
               // 原本的路由
-              next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
+              // next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
+              next({ path: '/system/resume/index' })
             }
           })
         }).catch(err => {
+          // console.log("-----3333")
           store.dispatch('LogOut').then(() => {
             Message.error(err)
             // next({ path: '/' })
@@ -54,13 +59,16 @@ router.beforeEach((to, from, next) => {
           })
         })
       } else {
+        // console.log("-----44444")
         if (to.path === "/") {
+          // console.log("-----5555")
           if (store.state.app.isMobileEnv) {
             next({ path: '/mobile/resume/index' })
           } else {
             next({ path: '/system/resume/index' })
           }
         } else {
+          // console.log("-----6666")
           next()
         }
       }

+ 4 - 2
ruoyi-ui/src/router/index.js

@@ -118,7 +118,9 @@ export const constantRoutes = [
   {
     path: "/mobile/resume/index",
     name: 'MobileResumeIndex',
-    component: () => import('../views/mobile/resume/index')
+    component: () => import('../views/mobile/resume/index'),
+    meta: { title: '简历管理' },
+    hidden: true
   },
   {
     path: "/mobile/resume/form",
@@ -247,7 +249,7 @@ export const constantRoutes = [
         path: 'resume/index',
         component: () => import('@/views/system/resume/index'),
         name: 'Resume',
-        meta: { title: '简历管理', icon: 'dashboard' }
+        meta: { title: '简历管理', icon: 'dashboard',affix: true}
       },
       {
         path: 'resume/add',

+ 1 - 0
ruoyi-ui/src/store/getters.js

@@ -3,6 +3,7 @@ const getters = {
   size: state => state.app.size,
   device: state => state.app.device,
   isMobileEnv: state => state.app.isMobileEnv,
+  corpId: state => state.app.corpId,
   dict: state => state.dict.dict,
   visitedViews: state => state.tagsView.visitedViews,
   cachedViews: state => state.tagsView.cachedViews,

+ 5 - 1
ruoyi-ui/src/store/modules/app.js

@@ -9,6 +9,7 @@ const state = {
   device: 'desktop',
   size: Cookies.get('size') || 'medium',
   isMobileEnv:false,
+  corpId:null
 }
 
 const mutations = {
@@ -41,7 +42,10 @@ const mutations = {
   },
   SET_IS_MOBILE_ENV:(state,isMobileEnv) => {
     state.isMobileEnv = isMobileEnv
-  }
+  },
+  SET_CORPID:(state,corpId) => {
+    state.corpId = corpId
+  },
 }
 
 const actions = {

+ 0 - 2
ruoyi-ui/src/views/login.vue

@@ -92,11 +92,9 @@ import * as dd from "dingtalk-jsapi"; // 在此引入
 import { getCodeImg, avoidLogin, authToken } from "@/api/login";
 import Cookies from "js-cookie";
 import { encrypt, decrypt } from "@/utils/jsencrypt";
-import { initDingH5RemoteDebug } from "dingtalk-h5-remote-debug";
 import { openAuth } from "dingtalk-design-libs/biz/openAuth";
 import { setToken } from "@/utils/auth";
 
-initDingH5RemoteDebug();
 export default {
   name: "Login",
   data() {

+ 3 - 1
ruoyi-ui/vue.config.js

@@ -38,7 +38,9 @@ module.exports = {
         // target: `http://localhost:8080`,
         // target: `http://192.168.100.234:8080`,//张继超本地
         // target: `http://192.168.100.229:8080`,//张洛飞本地
-        target: `http://47.103.79.143:8093`,//
+        // target: `http://192.168.100.208:8080`,//韩卓越本地
+        target: `http://47.103.79.143:8093`,//线上
+        // target: `https://airesume.dgtis.com/prod-api`,//线上
         changeOrigin: true,
         pathRewrite: {
           ['^' + process.env.VUE_APP_BASE_API]: ''