| | |
| | | * 参数 "uinf.UName="+用户名+"&uinf.Upassword="+密码+"&uinf.UId="+是否记住密码(0,1) |
| | | * 密码需要使用hex_md5加密 |
| | | */ |
| | | export const login = (username, password) => { |
| | | export const login = (username, password, verity) => { |
| | | return axios({ |
| | | method: "post", |
| | | url: `LoginAction_login?uinf.UName=${username}&uinf.Upassword=${md5(password)}&uinf.UId=0`, |
| | | url: `LoginAction_login?uinf.UName=${username}&uinf.Upassword=${md5(password)}&uinf.UNote=${verity}&uinf.UId=0`, |
| | | data: null |
| | | }); |
| | | }; |
| | | |
| | | export const getLoginVerity = ()=>{ |
| | | return axios({ |
| | | method: "post", |
| | | url: `MessageAction!getFontDynamicCode`, |
| | | data: null |
| | | }); |
| | | }; |
| | |
| | | url: 'Fgcd_filedownloadAction_action_sendCmdToA059_stopFile', |
| | | data: "json=" + JSON.stringify(data) |
| | | }); |
| | | }, |
| | | |
| | | /** |
| | | * 读取图片 |
| | | * @param devId 设备id |
| | | * @returns {AxiosPromise} |
| | | */ |
| | | searchPicture(devId) { |
| | | return axios({ |
| | | method: "POST", |
| | | url: 'Fgcd_filedownloadAction_action_readA059Pictrue', |
| | | data: "json="+devId |
| | | }); |
| | | }, |
| | | |
| | | /** |
| | | * 开始显示图片 |
| | | * @param devId 设备id |
| | | * @returns {AxiosPromise} |
| | | */ |
| | | startShowPicture(devId) { |
| | | return axios({ |
| | | method: "POST", |
| | | url: 'Fgcd_filedownloadAction_action_readA059Pictrue', |
| | | data: "json="+JSON.stringify({ |
| | | op_cmd: 188, |
| | | dev_id: devId, |
| | | }) |
| | | }); |
| | | }, |
| | | |
| | | /** |
| | | * 停止显示图片 |
| | | * @param devId 设备id |
| | | * @returns {AxiosPromise} |
| | | */ |
| | | stopShowPicture(devId) { |
| | | return axios({ |
| | | method: "POST", |
| | | url: 'Fgcd_filedownloadAction_action_readA059Pictrue', |
| | | data: "json="+JSON.stringify({ |
| | | op_cmd: 190, |
| | | dev_id: devId, |
| | | }) |
| | | }); |
| | | } |
| | | } |
| | |
| | | verifyCode: { |
| | | label: '验证码', |
| | | des: '登录是否启用验证码', |
| | | value: false, |
| | | value: true, |
| | | }, |
| | | messageCode: { |
| | | label: '短信验证码', |
New file |
| | |
| | | function getFileName(path) { |
| | | let pos1 = path.lastIndexOf('/'); |
| | | let pos2 = path.lastIndexOf('\\'); |
| | | let pos = Math.max(pos1, pos2) |
| | | if( pos<0 ) |
| | | return path; |
| | | else |
| | | return path.substring(pos+1); |
| | | } |
| | | export default getFileName; |
| | |
| | | <template> |
| | | <div class="endoscope-image"> |
| | | <div class="endoscope-image" |
| | | v-loading="loading" |
| | | element-loading-text="数据加载中" |
| | | element-loading-spinner="el-icon-loading" |
| | | element-loading-background="rgba(0, 0, 0, 0.2)"> |
| | | <div class="endoscope-image-content"> |
| | | <el-carousel :autoplay="false" height="500px"> |
| | | <el-carousel-item v-for="(url, key) in imagesList" :key="'key'+key"> |
| | |
| | | </el-carousel> |
| | | </div> |
| | | <div class="endoscope-image-footer"> |
| | | <el-button type="primary">刷新</el-button> |
| | | <el-button type="success" size="small" @click="startShowPicture">启动更新</el-button> |
| | | <el-button type="danger" size="small" @click="stopShowPicture">停止更新</el-button> |
| | | <el-button type="primary" size="small" @click="searchPicture">刷新</el-button> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import getWebUrl from "@/assets/js/tools/getWebUrl"; |
| | | import getFileName from "@/assets/js/tools/getFileName"; |
| | | |
| | | export default { |
| | | name: "endoscopeImage", |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | images: [ |
| | | 'baidu.png', |
| | | 'dianchi.png', |
| | | ], |
| | | loading: false, |
| | | images: [], |
| | | } |
| | | }, |
| | | methods: {}, |
| | | methods: { |
| | | /** |
| | | * 查询内窥镜图片 |
| | | */ |
| | | searchPicture() { |
| | | this.loading = true; |
| | | this.$apis.dataTest.historyAio.searchPicture(this.devId).then(res=>{ |
| | | this.loading = false; |
| | | let rs = JSON.parse(res.data.result); |
| | | let data = []; |
| | | if(rs.code == 1) { |
| | | data = rs.data.map(item=>{ |
| | | return getFileName(item.path); |
| | | }) |
| | | } |
| | | this.images = data; |
| | | }).catch(error => { |
| | | this.loading = false; |
| | | this.images = []; |
| | | console.log(error); |
| | | }); |
| | | }, |
| | | /** |
| | | * 启动显示图片 |
| | | */ |
| | | startShowPicture() { |
| | | let devId = this.devId; |
| | | this.$confirm("确定启动更新图片", { |
| | | title: "系统提示", |
| | | }).then(res=>{ |
| | | this.loading = true; |
| | | this.$apis.dataTest.historyAio.startShowPicture(devId).then(res=>{ |
| | | this.loading = false; |
| | | let rs = JSON.parse(res.data.result); |
| | | if(rs.code == 1) { |
| | | this.$layer.msg("启动成功"); |
| | | }else { |
| | | this.$layer.msg("启动失败"); |
| | | } |
| | | }).catch(error => { |
| | | this.loading = false; |
| | | this.$layer.msg("启动失败,请检查网络!"); |
| | | console.log(error); |
| | | }) |
| | | }).catch(()=>{}) |
| | | }, |
| | | /** |
| | | * 停止显示图片 |
| | | */ |
| | | stopShowPicture() { |
| | | let devId = this.devId; |
| | | this.$confirm("确定停止更新图片", { |
| | | title: "系统提示", |
| | | }).then(res=>{ |
| | | this.loading = true; |
| | | this.$apis.dataTest.historyAio.stopShowPicture(devId).then(res=>{ |
| | | this.loading = false; |
| | | let rs = JSON.parse(res.data.result); |
| | | if(rs.code == 1) { |
| | | this.$layer.msg("停止成功"); |
| | | }else { |
| | | this.$layer.msg("停止失败"); |
| | | } |
| | | }).catch(error => { |
| | | this.loading = false; |
| | | this.$layer.msg("停止失败,请检查网络!"); |
| | | console.log(error); |
| | | }) |
| | | }).catch(()=>{}) |
| | | } |
| | | }, |
| | | computed: { |
| | | imagesList() { |
| | | return this.images.map(item=>{ |
| | |
| | | } |
| | | }, |
| | | mounted() { |
| | | |
| | | this.searchPicture(); |
| | | }, |
| | | destroyed() { |
| | | |
| | |
| | | background-color: #FFFFFF; |
| | | } |
| | | .endoscope-image-footer { |
| | | padding: 8px 16px; |
| | | padding: 16px 16px; |
| | | background-color: #e1e1df; |
| | | text-align: right; |
| | | } |
| | |
| | | checkLoginSession, |
| | | uKeyLogin, |
| | | getRandomFromServer, |
| | | loginSignVerity, phoneVerifyCodeLogin, |
| | | loginSignVerity, |
| | | phoneVerifyCodeLogin, |
| | | getLoginVerity |
| | | } from "@/assets/js/api"; |
| | | import ConfigInfo from "@/pages/configInfo"; |
| | | import UkeyBind from "@/components/UKeyBind"; |
| | |
| | | password: "", |
| | | verify: "" |
| | | }, |
| | | verifyCode: randomString(4), |
| | | verifyCode: "", |
| | | license: { |
| | | show: false, |
| | | }, |
| | |
| | | if (this.loginForm.username && this.loginForm.password) { |
| | | // 开启等待框 |
| | | this.loading = true; |
| | | login(this.loginForm.username, this.loginForm.password) |
| | | login(this.loginForm.username, this.loginForm.password, this.loginForm.verify) |
| | | .then((res) => { |
| | | // 对结果进行处理 |
| | | this.handleLogin(res); |
| | |
| | | this.$store.dispatch("user/changePage", "m1c0"); |
| | | }, |
| | | changeVerifyCode() { |
| | | this.verifyCode = randomString(4); |
| | | this.loginForm.verify = ""; |
| | | let loading = this.$layer.loading(); |
| | | getLoginVerity().then(res=>{ |
| | | this.$layer.close(loading); |
| | | let rs = JSON.parse(res.data.result); |
| | | if(rs.code == 1) { |
| | | this.verifyCode = rs.data+""; |
| | | }else{ |
| | | this.verifyCode = ""; |
| | | } |
| | | this.loginForm.verify = ""; |
| | | }).catch(error=>{ |
| | | this.$layer.close(loading); |
| | | this.verifyCode = ""; |
| | | this.loginForm.verify = ""; |
| | | }); |
| | | }, |
| | | showPsdLogin() { |
| | | this.psdLogin = this.psdLogin?false:true; |
| | |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.changeVerifyCode(); |
| | | let autoLogin = this.$route.query.autoLogin; |
| | | if (autoLogin) { |
| | | // 自动登录 |