| | |
| | | getUserLoginInfo, |
| | | checkServeLicense, |
| | | getLoginVerity, |
| | | loginOutAPI, |
| | | } from "@/views/login/js/api"; |
| | | import AddLicense from "./components/AddLicense"; |
| | | import ConfigInfo from "./components/configInfo"; |
| | |
| | | // 关闭等待 |
| | | //this.loading = false; |
| | | res = res.data; |
| | | console.log(res); |
| | | if (res.data) { |
| | | this.$message.success("登录成功"); |
| | | sessionStorage.setItem("username", res.data2[0].uname); |
| | |
| | | sessionStorage.setItem("activeSkin", skin); |
| | | } |
| | | }, |
| | | handleMounted() { |
| | | // 关闭等待 |
| | | this.loading = false; |
| | | this.changeSkin(); |
| | | // 用户登录状态 0-(不做动作) 2-首次登录 3-密码长时间未登录 |
| | | sessionStorage.setItem("useLoginState", "0"); |
| | | // 初始化user的信息 |
| | | this.$store.commit("user/init"); |
| | | // 初始化登录状态 |
| | | sessionStorage.setItem("username", ""); |
| | | this.checkServeLicense(); |
| | | |
| | | this.$store.dispatch("user/changeAutoLogin", 0); |
| | | |
| | | if (sysConfig.clientName.name == "sxty") { |
| | | this.setQRCode(); |
| | | } |
| | | this.changeVerifyCode(); |
| | | }, |
| | | }, |
| | | computed: { |
| | | uKeyState() { |
| | |
| | | }, |
| | | }, |
| | | mounted() { |
| | | // 关闭等待 |
| | | this.loading = false; |
| | | this.changeSkin(); |
| | | // 用户登录状态 0-(不做动作) 2-首次登录 3-密码长时间未登录 |
| | | sessionStorage.setItem("useLoginState", "0"); |
| | | // 初始化user的信息 |
| | | this.$store.commit("user/init"); |
| | | // 初始化登录状态 |
| | | sessionStorage.setItem("username", ""); |
| | | this.checkServeLicense(); |
| | | |
| | | this.$store.dispatch("user/changeAutoLogin", 0); |
| | | |
| | | if (sysConfig.clientName.name == "sxty") { |
| | | this.setQRCode(); |
| | | } |
| | | this.changeVerifyCode(); |
| | | // 登录页调用退出登录接口重置页面cookie |
| | | loginOutAPI() |
| | | .then(() => { |
| | | this.changeVerifyCode(); |
| | | setTimeout(() => { |
| | | this.handleMounted(); |
| | | }, 1000); |
| | | }) |
| | | .catch(() => { |
| | | this.handleMounted(); |
| | | }); |
| | | }, |
| | | }; |
| | | </script> |
| | |
| | | export const login = (userName, password, deliveredCode) => { |
| | | return axios({ |
| | | method: "post", |
| | | url: 'login/loginByRSA', |
| | | url: "login/loginByRSA", |
| | | params: { |
| | | userName, |
| | | password: encodeURIComponent(formatPassword(password)), |
| | | deliveredCode |
| | | } |
| | | deliveredCode, |
| | | }, |
| | | }); |
| | | }; |
| | | |
| | |
| | | return axios({ |
| | | method: "POST", |
| | | url: `/login/loginWithUKey`, |
| | | params: { userName: username, password: encodeURIComponent(formatPassword(password)), UId: 0, uKeyId: uKeyId } |
| | | params: { |
| | | userName: username, |
| | | password: encodeURIComponent(formatPassword(password)), |
| | | UId: 0, |
| | | uKeyId: uKeyId, |
| | | }, |
| | | }); |
| | | }; |
| | | |
| | | export const getRandomFromServer = () => { |
| | | return axios({ |
| | | method: 'GET', |
| | | url: '/login/getRandom' |
| | | method: "GET", |
| | | url: "/login/getRandom", |
| | | }); |
| | | }; |
| | | |
| | | export const loginSignVerity = (data) => { |
| | | return axios({ |
| | | method: 'post', |
| | | url: '/login/verify', |
| | | method: "post", |
| | | url: "/login/verify", |
| | | data: data, |
| | | }); |
| | | }; |
| | | |
| | | export const searchName = () => { |
| | | return axios({ |
| | | method: 'GET', |
| | | url: '/pageParam/allList', |
| | | params: { categoryId: 5 } |
| | | method: "GET", |
| | | url: "/pageParam/allList", |
| | | params: { categoryId: 5 }, |
| | | }); |
| | | }; |
| | | |
| | | export const searchVersion = () => { |
| | | return axios({ |
| | | method: 'GET', |
| | | url: '/pageParam/allList', |
| | | params: { categoryId: 6 } |
| | | method: "GET", |
| | | url: "/pageParam/allList", |
| | | params: { categoryId: 6 }, |
| | | }); |
| | | }; |
| | | |
| | | export const getUserLoginInfo = (uid) => { |
| | | return axios({ |
| | | method: 'GET', |
| | | url: '/login/loginNoPass', |
| | | method: "GET", |
| | | url: "/login/loginNoPass", |
| | | params: { |
| | | uId: uid ? uid : 1002, |
| | | }, |
| | |
| | | */ |
| | | export const getMacLicense = (data) => { |
| | | return axios({ |
| | | method: 'GET', |
| | | url: '/license/getSerialNumberLicense', |
| | | data: null |
| | | method: "GET", |
| | | url: "/license/getSerialNumberLicense", |
| | | data: null, |
| | | }); |
| | | }; |
| | | |
| | |
| | | */ |
| | | export const checkLicense = (license) => { |
| | | return axios({ |
| | | method: 'GET', |
| | | url: '/license/checkSerialNumberLicense', |
| | | params: license |
| | | method: "GET", |
| | | url: "/license/checkSerialNumberLicense", |
| | | params: license, |
| | | }); |
| | | }; |
| | | |
| | |
| | | */ |
| | | export const getLicenseResTime = () => { |
| | | return axios({ |
| | | method: 'POST', |
| | | url: '/license/time2DeadLine', |
| | | data: null |
| | | method: "POST", |
| | | url: "/license/time2DeadLine", |
| | | data: null, |
| | | }); |
| | | }; |
| | | |
| | |
| | | export const checkServeLicense = () => { |
| | | // 请求后台查询内容 |
| | | return axios({ |
| | | method: 'GET', |
| | | url: '/license/checkRegistered', |
| | | data: null |
| | | method: "GET", |
| | | url: "/license/checkRegistered", |
| | | data: null, |
| | | }); |
| | | }; |
| | | |
| | |
| | | export const getUKeyByUName = (UName) => { |
| | | return axios({ |
| | | method: "GET", |
| | | url: '/user/searchUNameToUKey', |
| | | url: "/user/searchUNameToUKey", |
| | | params: { |
| | | uKeyId: UName |
| | | } |
| | | uKeyId: UName, |
| | | }, |
| | | }); |
| | | }; |
| | | |
| | |
| | | export const getUNameByUKey = (UKeyId) => { |
| | | return axios({ |
| | | method: "GET", |
| | | url: '/user/searchUKeyToUName', |
| | | url: "/user/searchUKeyToUName", |
| | | params: { |
| | | uKeyId: UKeyId |
| | | } |
| | | uKeyId: UKeyId, |
| | | }, |
| | | }); |
| | | }; |
| | | |
| | |
| | | export const bindUKey = (UName, UKeyId, upubKeyX, upubKeyY) => { |
| | | return axios({ |
| | | method: "POST", |
| | | url: '/user/bindUkey', |
| | | url: "/user/bindUkey", |
| | | data: { |
| | | uname: UName, |
| | | ukeyId: UKeyId, |
| | | upubKeyX, |
| | | upubKeyY |
| | | } |
| | | upubKeyY, |
| | | }, |
| | | }); |
| | | }; |
| | | |
| | |
| | | */ |
| | | export const checkUserPwd = (pwd) => { |
| | | return axios({ |
| | | method: 'post', |
| | | url: '/user/checkUserPasswordOfRSA', |
| | | method: "post", |
| | | url: "/user/checkUserPasswordOfRSA", |
| | | params: { pwd: encodeURIComponent(formatPassword(pwd)) }, |
| | | }); |
| | | }; |
| | |
| | | */ |
| | | export const updateUserPwd = (pwd) => { |
| | | return axios({ |
| | | method: 'post', |
| | | url: '/user/updatePasswordByRSA', |
| | | method: "post", |
| | | url: "/user/updatePasswordByRSA", |
| | | params: { password: encodeURIComponent(formatPassword(pwd)) }, |
| | | }); |
| | | }; |
| | |
| | | export const getLoginVerity = () => { |
| | | return axios({ |
| | | method: "GET", |
| | | url: 'message/getFontDynamicCode' |
| | | url: "message/getFontDynamicCode", |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 获取可以生成mac地址的ukey列表 包含对应的用户 |
| | | * @returns |
| | | * @returns |
| | | */ |
| | | export const getMacUks = () => { |
| | | return axios({ |
| | | method: "GET", |
| | | url: 'macUkey/searMacUkey' |
| | | url: "macUkey/searMacUkey", |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 登出逻辑 |
| | | * @return {AxiosPromise} |
| | | */ |
| | | export const loginOutAPI = () => { |
| | | return axios({ |
| | | method: "POST", |
| | | url: "login/logout", |
| | | }); |
| | | }; |