| | |
| | | "clipboard": "2.0.6", |
| | | "core-js": "3.8.1", |
| | | "dayjs": "^1.11.1", |
| | | "dingtalk-jsapi": "^3.0.33", |
| | | "echarts": "4.9.0", |
| | | "element-china-area-data": "^5.0.2", |
| | | "element-ui": "2.15.6", |
| | |
| | | import request from '@/utils/request' |
| | | |
| | | // 登录方法 |
| | | export function login(username, password, code, uuid) { |
| | | export function login(username, password, code, uuid,authCode) { |
| | | const data = { |
| | | username, |
| | | password, |
| | | code, |
| | | uuid |
| | | uuid, |
| | | authCode |
| | | } |
| | | return request({ |
| | | url: '/login', |
| | |
| | | method: 'get', |
| | | timeout: 20000 |
| | | }) |
| | | } |
| | | } |
| | |
| | | params: data |
| | | }) |
| | | } |
| | | // 查询授权角色 |
| | | export function getdepartment(userName ) { |
| | | return request({ |
| | | url: '/system/dingtalk/deptidList/' + 1 , |
| | | method: 'get', |
| | | }) |
| | | } |
| | |
| | | * @Date: 2022-04-25 08:04:47 |
| | | * @LastEditors: your Name |
| | | * @LastEditTime: 2022-04-25 16:33:00 |
| | | * @Description: |
| | | * @Description: |
| | | */ |
| | | import Vue from 'vue' |
| | | import yearPicker from 'vue-year-picker' |
| | |
| | | // import li_area_select from '@components/Address' |
| | | import moment from "moment" |
| | | import '@/utils/drag.js'; |
| | | import DingTalkPC from 'dingtalk-jsapi'; |
| | | |
| | | Vue.prototype.$dingtalk = DingTalkPC; |
| | | DingTalkPC.config({ |
| | | agentId: 'your_agentId', |
| | | corpId: 'your_corpId', |
| | | timeStamp: new Date().getTime(), |
| | | nonceStr: 'your_nonceStr', |
| | | signature: 'your_signature', |
| | | jsApiList: ['runtime.permission.requestAuthCode'] |
| | | }); |
| | | |
| | | Vue.prototype.$moment = moment; |
| | | |
| | |
| | | import echarts from 'echarts' |
| | | Vue.prototype.$echarts = echarts |
| | | |
| | | |
| | | // 全局组件挂载 |
| | | // Vue.component('li_area_select',li_area_select) |
| | | Vue.component('DictTag', DictTag) |
| | |
| | | const password = userInfo.password |
| | | const code = userInfo.code |
| | | const uuid = userInfo.uuid |
| | | const authCode = userInfo.authCode |
| | | console.log(authCode,'authCode'); |
| | | return new Promise((resolve, reject) => { |
| | | login(username, password, code, uuid).then(res => { |
| | | login(username, password, code, uuid, authCode).then(res => { |
| | | console.log(res,'log'); |
| | | setToken(res.token) |
| | | commit('SET_TOKEN', res.token) |
| | |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | |
| | | // 退出系统 |
| | | LogOut({ commit, state }) { |
| | | return new Promise((resolve, reject) => { |
| | |
| | | data() { |
| | | return { |
| | | codeUrl: "", |
| | | authCode: "", |
| | | cookiePassword: "", |
| | | loginForm: { |
| | | username: "", |
| | |
| | | created() { |
| | | this.getCode(); |
| | | this.getCookie(); |
| | | this.getAuthCode(); |
| | | // this.avoidLogin(); |
| | | }, |
| | | methods: { |
| | | tip() { |
| | |
| | | this.loginForm.uuid = res.uuid; |
| | | } |
| | | }); |
| | | }, |
| | | getAuthCode() { |
| | | this.$dingtalk.runtime.permission.requestAuthCode({ |
| | | corpId: "dingac30cec5f3570bbea39a90f97fcb1e09", |
| | | onSuccess: result => { |
| | | // 在这里处理授权成功后的逻辑,result中包含授权码等信息 |
| | | this.authCode = result.codde; |
| | | this.$message.success("成功获取授权码:" + result.code); |
| | | this.avoidLogin(); |
| | | }, |
| | | onFail: err => { |
| | | // 在这里处理授权失败后的逻辑 |
| | | this.$message({ |
| | | type: "error", |
| | | message: err |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | avoidLogin() { |
| | | this.loading = true; |
| | | this.loginForm.authCode = this.authCode; |
| | | this.$store |
| | | .dispatch("Login", this.loginForm) |
| | | .then(res => { |
| | | this.$message.error(this.$store.state); |
| | | if (this.$store.state.user.code == 200) { |
| | | this.$router.push({ path: this.redirect || "/" }).catch(() => {}); |
| | | } else { |
| | | this.loading = false; |
| | | // this.$message.error(this.$store.state.user.msg); |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | console.log(err); |
| | | this.loading = false; |
| | | this.$message.error("免登陆失败请手动操作。"); |
| | | if (this.captchaOnOff) { |
| | | this.getCode(); |
| | | } |
| | | }); |
| | | }, |
| | | getCookie() { |
| | | const username = Cookies.get("username"); |
| | |
| | | .push({ path: this.redirect || "/" }) |
| | | .catch(() => {}); |
| | | } else { |
| | | this.loading = false; |
| | | this.loading = false; |
| | | this.$message.error(this.$store.state.user.msg); |
| | | } |
| | | }) |
| | |
| | | <el-form ref="form" :model="user" :rules="rules" label-width="80px"> |
| | | <el-form-item label="用户昵称" prop="nickName"> |
| | | <el-input v-model="user.nickName" maxlength="30" /> |
| | | </el-form-item> |
| | | </el-form-item> |
| | | <el-form-item label="手机号码" prop="phonenumber"> |
| | | <el-input v-model="user.phonenumber" maxlength="11" /> |
| | | </el-form-item> |
| | |
| | | <el-form-item> |
| | | <el-button type="primary" size="mini" @click="submit">保存</el-button> |
| | | <el-button type="danger" size="mini" @click="close">关闭</el-button> |
| | | <el-button |
| | | type="danger" |
| | | size="mini" |
| | | v-if="user.nickName == '超级管理员'" |
| | | @click="getdepartment" |
| | | >获取部门信息</el-button |
| | | > |
| | | </el-form-item> |
| | | </el-form> |
| | | </template> |
| | | |
| | | <script> |
| | | import { updateUserProfile } from "@/api/system/user"; |
| | | import { updateUserProfile, getdepartment } from "@/api/system/user"; |
| | | |
| | | export default { |
| | | props: { |
| | |
| | | close() { |
| | | this.$store.dispatch("tagsView/delView", this.$route); |
| | | this.$router.push({ path: "/index" }); |
| | | }, |
| | | getdepartment() { |
| | | getdepartment().then(res => { |
| | | if (res.code == 200) { |
| | | this.$modal.msgSuccess("获取成功"); |
| | | } else { |
| | | this.$modal.msgError(res.msg); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | }; |
| | |
| | | open: true, |
| | | proxy: { |
| | | // detail: https://cli.vuejs.org/config/#devserver-proxy |
| | | [process.env.VUE_APP_BASE_API]: { |
| | | target:`http://localhost:8080`, |
| | | [process.env.VUE_APP_BASE_API]: { |
| | | target:`http://localhost:8080`, |
| | | // target:`http://192.168.2.8:8080`, |
| | | // target:`http://116.62.18.175:8080`, |
| | | // target:`https://slb.hospitalstar.com:9093`, |