token
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
import {post} from '@config/http.js'
|
import {post} from '@config/http.js'
|
||||||
|
|
||||||
// 手持登录
|
// 手持登录
|
||||||
export const loginApi = (user, password) => post('api/pda/handlogin', {
|
export const loginApi = (user, password) => post('api/pda/login', {
|
||||||
user: user,
|
username: user,
|
||||||
password: password
|
password: password
|
||||||
})
|
})
|
||||||
// 手持登陆查询菜单权限
|
// 手持登陆查询菜单权限
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import { Dialog, toast } from './mUtils.js'
|
import { Dialog } from './mUtils.js'
|
||||||
import store from '../vuex/store'
|
import store from '../vuex/store'
|
||||||
import router from '@/router'
|
import router from '@/router'
|
||||||
|
|
||||||
@@ -30,17 +30,14 @@ axios.interceptors.request.use(
|
|||||||
|
|
||||||
axios.interceptors.response.use(
|
axios.interceptors.response.use(
|
||||||
response => {
|
response => {
|
||||||
if (response.status === 200) {
|
return Promise.resolve(response)
|
||||||
return Promise.resolve(response)
|
|
||||||
} else {
|
|
||||||
return Promise.reject(response)
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
error => {
|
error => {
|
||||||
if (error && error.response) {
|
if (error && error.response) {
|
||||||
switch (error.response.status) {
|
switch (error.response.status) {
|
||||||
|
case 400:
|
||||||
|
break
|
||||||
case 401:
|
case 401:
|
||||||
toast(error.response.data.message)
|
|
||||||
store.dispatch('setSignOut')
|
store.dispatch('setSignOut')
|
||||||
router.push('/login')
|
router.push('/login')
|
||||||
break
|
break
|
||||||
@@ -58,7 +55,11 @@ export const post = (sevmethod, params) => {
|
|||||||
.then(response => {
|
.then(response => {
|
||||||
resolve(response.data)
|
resolve(response.data)
|
||||||
}, error => {
|
}, error => {
|
||||||
Dialog(error.message)
|
if (error.message === null) {
|
||||||
|
Dialog('null')
|
||||||
|
} else {
|
||||||
|
Dialog(error.message)
|
||||||
|
}
|
||||||
reject(error.message)
|
reject(error.message)
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
@@ -69,7 +70,7 @@ export const post = (sevmethod, params) => {
|
|||||||
|
|
||||||
export const post2 = (sevmethod, params) => {
|
export const post2 = (sevmethod, params) => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
axios.post(`${store.getters.acsUrl}/` + sevmethod, params)
|
axios.post(`${store.getters.acsip}/` + sevmethod, params)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
resolve(response.data)
|
resolve(response.data)
|
||||||
}, error => {
|
}, error => {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<section class="content" style="margin-bottom: 0">
|
<section class="content" style="margin-bottom: 0">
|
||||||
<div class="userInfo">
|
<div class="userInfo">
|
||||||
<div class="fxcol">
|
<div class="fxcol">
|
||||||
<p class="p1">{{$store.getters.userInfo !== '' ? JSON.parse($store.getters.userInfo).nick_name : ''}}</p>
|
<p class="p1">{{$store.getters.userInfo !== '' ? JSON.parse($store.getters.userInfo).nickName : ''}}</p>
|
||||||
<p class="p2">欢迎进入晟华手持系统!</p>
|
<p class="p2">欢迎进入晟华手持系统!</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="exit" @click="Quit">
|
<div class="exit" @click="Quit">
|
||||||
@@ -15,16 +15,17 @@
|
|||||||
</section>
|
</section>
|
||||||
<div class="con">
|
<div class="con">
|
||||||
<ul>
|
<ul>
|
||||||
<li v-for="e in menuList" :key="e.menu_id" @click="toPage(e)">{{e.name}}</li>
|
<!-- <li v-for="e in menuList" :key="e.menu_id" @click="toPage(e)">{{e.name}}</li> -->
|
||||||
<!-- <li @click="goInner('/TaskManage')">任务管理</li>
|
|
||||||
<li @click="goInner('/ZlManage')">指令管理</li>
|
<li @click="goInner('/ZlManage')">指令管理</li>
|
||||||
<li @click="goInner('/Password')">修改密码</li>
|
<li @click="goInner('/TaskManage')">任务管理</li>
|
||||||
<li @click="goInner('/SendMater')">送料</li>
|
<li @click="goInner('/SendMater')">送料</li>
|
||||||
<li @click="goInner('/PressCallMater')">压制叫料</li>
|
<li @click="goInner('/PressCallMater')">压制叫料</li>
|
||||||
<li @click="goInner('/SendEmptyPallet')">送空托盘</li>
|
<li @click="goInner('/SendEmptyPallet')">送空托盘</li>
|
||||||
<li @click="goInner('/CallEmptyPallet')">呼叫空托盘</li>
|
<li @click="goInner('/CallEmptyPallet')">呼叫空托盘</li>
|
||||||
|
<li @click="goInner('/MechineOutstore')">液压机出库</li>
|
||||||
<li @click="goInner('/BindPalletPoint')">托盘点位绑定</li>
|
<li @click="goInner('/BindPalletPoint')">托盘点位绑定</li>
|
||||||
<li @click="goInner('/CheckManage')">盘点管理</li> -->
|
<li @click="goInner('/CheckManage')">盘点管理</li>
|
||||||
|
<li @click="goInner('/Password')">修改密码</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
@@ -46,7 +47,7 @@ export default {
|
|||||||
this.$store.dispatch('receiveMaterObj', {})
|
this.$store.dispatch('receiveMaterObj', {})
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
this._authority()
|
// this._authority()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
toPage (e) {
|
toPage (e) {
|
||||||
|
|||||||
@@ -11,6 +11,8 @@
|
|||||||
<i class="icon-eye" :class="type === 'password' ? 'icon-eye-close' : 'icon-eye-open'" @click="changeType"></i>
|
<i class="icon-eye" :class="type === 'password' ? 'icon-eye-close' : 'icon-eye-open'" @click="changeType"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="fxrow check-box">
|
<div class="fxrow check-box">
|
||||||
|
<i class="icon-name-check" :class="{'icon-name-checked': memberName}" @click="Remember"></i>
|
||||||
|
<span class="fxcol">记住用户名</span>
|
||||||
<router-link :to="{path: '/setup'}" class="fxcol" style="text-align:right;color:#6798ef">设置</router-link>
|
<router-link :to="{path: '/setup'}" class="fxcol" style="text-align:right;color:#6798ef">设置</router-link>
|
||||||
</div>
|
</div>
|
||||||
<button class="login-btn" :disabled="disabled" @click="_Login">确认登录</button>
|
<button class="login-btn" :disabled="disabled" @click="_Login">确认登录</button>
|
||||||
@@ -28,43 +30,40 @@ export default {
|
|||||||
loginname: '',
|
loginname: '',
|
||||||
password: '',
|
password: '',
|
||||||
type: 'password',
|
type: 'password',
|
||||||
jobnum: '',
|
memberName: false,
|
||||||
qrcode: '',
|
|
||||||
disabled: false
|
disabled: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
created () {
|
||||||
|
if (this.$store.getters.userInfo !== '') {
|
||||||
|
this.loginname = JSON.parse(this.$store.getters.userInfo).loginname
|
||||||
|
this.memberName = this.loginname !== ''
|
||||||
|
}
|
||||||
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
document.getElementsByTagName('body')[0].className = 'login-bg'
|
document.getElementsByTagName('body')[0].className = 'login-bg'
|
||||||
// window.getSystemInfoCallback = this.getSystemInfoCallback
|
|
||||||
// window.location.href = 'getSystemInfo'
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// getSystemInfoCallback (result) {
|
|
||||||
// window.localStorage.setItem('hhtId', result)
|
|
||||||
// },
|
|
||||||
// handleTest () {
|
|
||||||
// this.test = false
|
|
||||||
// setTimeout(() => {
|
|
||||||
// this.test = true
|
|
||||||
// this.testNumber = this.testNumber === 1 ? 2 : 1
|
|
||||||
// }, 200)
|
|
||||||
// },
|
|
||||||
changeType () {
|
changeType () {
|
||||||
this.type = this.type === 'password' ? 'text' : 'password'
|
this.type = this.type === 'password' ? 'text' : 'password'
|
||||||
},
|
},
|
||||||
|
Remember () {
|
||||||
|
this.memberName = !this.memberName
|
||||||
|
},
|
||||||
async loginApi () {
|
async loginApi () {
|
||||||
try {
|
try {
|
||||||
let res = await loginApi(this.loginname, encrypt(this.password))
|
let res = await loginApi(this.loginname, encrypt(this.password))
|
||||||
if (res.code === '1') {
|
let obj = {}
|
||||||
this.$store.dispatch('userInfo', JSON.stringify(res.result))
|
if (this.memberName) {
|
||||||
this.$router.push('/home')
|
obj = Object.assign({}, res.user.user, {token: res.token, loginname: this.loginname})
|
||||||
} else {
|
} else {
|
||||||
this.Dialog(res.desc)
|
obj = Object.assign({}, res.user.user, {token: res.token, loginname: ''})
|
||||||
}
|
}
|
||||||
|
this.$store.dispatch('userInfo', JSON.stringify(obj))
|
||||||
|
this.$router.push('/home')
|
||||||
this.disabled = false
|
this.disabled = false
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.disabled = false
|
this.disabled = false
|
||||||
this.Dialog(err)
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_Login () {
|
_Login () {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<section class="content">
|
<section class="content">
|
||||||
<ul class="pwd-manage-content">
|
<ul class="pwd-manage-content">
|
||||||
<li>
|
<li>
|
||||||
<span>wms地址:</span>
|
<span>lms地址:</span>
|
||||||
<input type="text" v-model="addrip">
|
<input type="text" v-model="addrip">
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
@@ -12,21 +12,9 @@
|
|||||||
<input type="text" v-model="acsip">
|
<input type="text" v-model="acsip">
|
||||||
</li>
|
</li>
|
||||||
<!-- <li>
|
<!-- <li>
|
||||||
<span>服务器地址:</span>
|
<span>打印地址:</span>
|
||||||
<input type="text" v-model="addrip">
|
|
||||||
</li> -->
|
|
||||||
<!-- <li>
|
|
||||||
<span>图片域名地址:</span>
|
|
||||||
<input type="text" v-model="imgip">
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<span>标签打印地址:</span>
|
|
||||||
<input type="text" v-model="printip">
|
<input type="text" v-model="printip">
|
||||||
</li>
|
</li>
|
||||||
<li>
|
|
||||||
<span>单据打印地址:</span>
|
|
||||||
<input type="text" v-model="billPrintip">
|
|
||||||
</li>
|
|
||||||
<li>
|
<li>
|
||||||
<span>刷新时间(s):</span>
|
<span>刷新时间(s):</span>
|
||||||
<input type="text" v-model="setTime">
|
<input type="text" v-model="setTime">
|
||||||
@@ -45,13 +33,9 @@ export default {
|
|||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
addrip: this.$store.getters.baseUrl,
|
addrip: this.$store.getters.baseUrl,
|
||||||
acsip: this.$store.getters.acsUrl,
|
acsip: this.$store.getters.acsip,
|
||||||
imgip: this.$store.getters.imgip,
|
printip: this.$store.getters.printUrl,
|
||||||
printip: this.$store.getters.printUrl || 'http://10.5.29.104:8000',
|
setTime: this.$store.getters.setTime
|
||||||
billPrintip: this.$store.getters.billPrintUrl || 'http://10.5.29.191:8000',
|
|
||||||
setTime: this.$store.getters.setTime,
|
|
||||||
factid: '1',
|
|
||||||
storeid: '1'
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -64,56 +48,19 @@ export default {
|
|||||||
this.toast('请填写acs地址')
|
this.toast('请填写acs地址')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// if (this.addrip === '') {
|
|
||||||
// this.toast('请填写服务器地址')
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
// if (this.imgip === '') {
|
|
||||||
// this.toast('请填写图片域名地址')
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
// if (this.printip === '') {
|
// if (this.printip === '') {
|
||||||
// this.toast('请填写标签打印地址')
|
// this.toast('请填写打印地址')
|
||||||
// return
|
|
||||||
// }
|
|
||||||
// if (this.billPrintip === '') {
|
|
||||||
// this.toast('请填写单据打印地址')
|
|
||||||
// return
|
// return
|
||||||
// }
|
// }
|
||||||
// if (this.setTime === '') {
|
// if (this.setTime === '') {
|
||||||
// this.toast('请填写刷新时间')
|
// this.toast('请填写刷新时间')
|
||||||
// return
|
// return
|
||||||
// }
|
// }
|
||||||
// 删除id为printid的DOM节点
|
|
||||||
// var printid = document.getElementById('printid')
|
|
||||||
// if (printid) {
|
|
||||||
// printid.parentNode.removeChild(printid)
|
|
||||||
// }
|
|
||||||
// 动态添加script
|
|
||||||
// var script = document.createElement('script')
|
|
||||||
// script.setAttribute('id', 'printid')
|
|
||||||
// script.src = this.printip + '/CLodopfuncs.js'
|
|
||||||
// document.getElementsByTagName('head')[0].appendChild(script)
|
|
||||||
|
|
||||||
// 2
|
|
||||||
// 删除id为billPrintid的DOM节点
|
|
||||||
// var billPrintid = document.getElementById('billPrintid')
|
|
||||||
// if (billPrintid) {
|
|
||||||
// billPrintid.parentNode.removeChild(billPrintid)
|
|
||||||
// }
|
|
||||||
// 动态添加script
|
|
||||||
// var script2 = document.createElement('script')
|
|
||||||
// script2.setAttribute('id', 'billPrintid')
|
|
||||||
// script2.src = this.billPrintip + '/CLodopfuncs.js'
|
|
||||||
// document.getElementsByTagName('head')[0].appendChild(script2)
|
|
||||||
|
|
||||||
// 存值
|
// 存值
|
||||||
this.$store.dispatch('setBaseUrl', this.addrip)
|
this.$store.dispatch('setBaseUrl', this.addrip)
|
||||||
this.$store.dispatch('setAcsUrl', this.acsip)
|
this.$store.dispatch('setAcsIp', this.acsip)
|
||||||
this.$store.dispatch('setImgIp', this.imgip)
|
// this.$store.dispatch('setPrintUrl', this.printip)
|
||||||
this.$store.dispatch('setPrintUrl', this.printip)
|
// this.$store.dispatch('setRefreshTime', this.setTime)
|
||||||
this.$store.dispatch('setBillPrintUrl', this.billPrintip)
|
|
||||||
this.$store.dispatch('setRefreshTime', this.setTime)
|
|
||||||
this.$router.push('/login')
|
this.$router.push('/login')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,22 +1,17 @@
|
|||||||
import * as types from '../types'
|
import * as types from '../types'
|
||||||
import { getStore, setStore } from '@config/mUtils.js'
|
import { getStore, setStore } from '@config/mUtils.js'
|
||||||
|
|
||||||
const baseUrl = process.env.NODE_ENV === 'development' ? 'http://192.168.81.153:8010' : 'http://192.168.81.153:8010'
|
const baseUrl = process.env.NODE_ENV === 'development' ? 'http://192.168.81.69:8011' : 'http://192.168.81.69:8011'
|
||||||
// const printUrl = 'http://192.168.81.82:8000'
|
const acsip = process.env.NODE_ENV === 'development' ? 'http://192.168.81.69:8010' : 'http://192.168.81.69:8010'
|
||||||
const acsUrl = 'http://192.168.81.153:8010'
|
const printUrl = process.env.NODE_ENV === 'development' ? 'http://192.168.81.139:8000' : 'http://192.168.81.139:8000'
|
||||||
const imgip = 'http://192.168.81.155:8080'
|
const setTime = '10'
|
||||||
const printUrl = ''
|
|
||||||
const billPrintUrl = ''
|
|
||||||
const setTime = '15'
|
|
||||||
/**
|
/**
|
||||||
* App通用配置
|
* App通用配置
|
||||||
*/
|
*/
|
||||||
const state = {
|
const state = {
|
||||||
baseUrl: getStore('baseUrl') || baseUrl,
|
baseUrl: getStore('baseUrl') || baseUrl,
|
||||||
acsUrl: getStore('acsUrl') || acsUrl,
|
acsip: getStore('acsip') || acsip,
|
||||||
imgip: getStore('imgip') || imgip,
|
|
||||||
printUrl: getStore('printUrl') || printUrl,
|
printUrl: getStore('printUrl') || printUrl,
|
||||||
billPrintUrl: getStore('billPrintUrl') || billPrintUrl,
|
|
||||||
setTime: getStore('setTime') || setTime,
|
setTime: getStore('setTime') || setTime,
|
||||||
loading: false,
|
loading: false,
|
||||||
showToast: false,
|
showToast: false,
|
||||||
@@ -32,22 +27,14 @@ const actions = {
|
|||||||
setStore('baseUrl', str)
|
setStore('baseUrl', str)
|
||||||
commit(types.COM_BASE_URL, str)
|
commit(types.COM_BASE_URL, str)
|
||||||
},
|
},
|
||||||
setAcsUrl ({commit}, str) {
|
setAcsIp ({commit}, str) {
|
||||||
setStore('acsUrl', str)
|
setStore('acsip', str)
|
||||||
commit(types.COM_ACS_URL, str)
|
commit(types.COM_ACS_IP, str)
|
||||||
},
|
|
||||||
setImgIp ({commit}, str) {
|
|
||||||
setStore('imgip', str)
|
|
||||||
commit(types.COM_IMG_IP, str)
|
|
||||||
},
|
},
|
||||||
setPrintUrl ({commit}, str) {
|
setPrintUrl ({commit}, str) {
|
||||||
setStore('printUrl', str)
|
setStore('printUrl', str)
|
||||||
commit(types.COM_PRINT_URL, str)
|
commit(types.COM_PRINT_URL, str)
|
||||||
},
|
},
|
||||||
setBillPrintUrl ({commit}, str) {
|
|
||||||
setStore('billPrintUrl', str)
|
|
||||||
commit(types.COM_BILL_PRINT_URL, str)
|
|
||||||
},
|
|
||||||
setRefreshTime ({commit}, str) {
|
setRefreshTime ({commit}, str) {
|
||||||
setStore('setTime', str)
|
setStore('setTime', str)
|
||||||
commit(types.COM_SET_TIME, str)
|
commit(types.COM_SET_TIME, str)
|
||||||
@@ -77,10 +64,8 @@ const actions = {
|
|||||||
|
|
||||||
const getters = {
|
const getters = {
|
||||||
baseUrl: state => state.baseUrl,
|
baseUrl: state => state.baseUrl,
|
||||||
acsUrl: state => state.acsUrl,
|
acsip: state => state.acsip,
|
||||||
imgip: state => state.imgip,
|
|
||||||
printUrl: state => state.printUrl,
|
printUrl: state => state.printUrl,
|
||||||
billPrintUrl: state => state.billPrintUrl,
|
|
||||||
setTime: state => state.setTime,
|
setTime: state => state.setTime,
|
||||||
loading: state => state.loading,
|
loading: state => state.loading,
|
||||||
showToast: state => state.showToast,
|
showToast: state => state.showToast,
|
||||||
@@ -91,18 +76,13 @@ const mutations = {
|
|||||||
[types.COM_BASE_URL] (state, str) {
|
[types.COM_BASE_URL] (state, str) {
|
||||||
state.baseUrl = str
|
state.baseUrl = str
|
||||||
},
|
},
|
||||||
[types.COM_ACS_URL] (state, str) {
|
[types.COM_ACS_IP] (state, str) {
|
||||||
state.acsUrl = str
|
state.acsip = str
|
||||||
},
|
|
||||||
[types.COM_IMG_IP] (state, str) {
|
|
||||||
state.imgip = str
|
|
||||||
},
|
},
|
||||||
[types.COM_PRINT_URL] (state, str) {
|
[types.COM_PRINT_URL] (state, str) {
|
||||||
state.printUrl = str
|
state.printUrl = str
|
||||||
},
|
},
|
||||||
[types.COM_BILL_PRINT_URL] (state, str) {
|
|
||||||
state.billPrintUrl = str
|
|
||||||
},
|
|
||||||
[types.COM_SET_TIME] (state, str) {
|
[types.COM_SET_TIME] (state, str) {
|
||||||
state.setTime = str
|
state.setTime = str
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -20,6 +20,9 @@ const actions = {
|
|||||||
let obj = {loginname: loginname}
|
let obj = {loginname: loginname}
|
||||||
localStorage.setItem('userInfo', JSON.stringify(obj))
|
localStorage.setItem('userInfo', JSON.stringify(obj))
|
||||||
}
|
}
|
||||||
|
// var LODOP = document.getElementById('LODOP')
|
||||||
|
// var head = document.head || document.getElementsByTagName('head')[0] || document.documentElement
|
||||||
|
// if (LODOP) head.removeChild(LODOP)
|
||||||
commit(types.SET_SIGN_OUT)
|
commit(types.SET_SIGN_OUT)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -29,7 +32,6 @@ const mutations = {
|
|||||||
state.userInfo = res
|
state.userInfo = res
|
||||||
},
|
},
|
||||||
[types.SET_SIGN_OUT] (state) {
|
[types.SET_SIGN_OUT] (state) {
|
||||||
state.accountId = ''
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// 公共
|
// 公共
|
||||||
export const COM_BASE_URL = 'COM_BASE_URL' // 主域名
|
export const COM_BASE_URL = 'COM_BASE_URL' // 主域名
|
||||||
export const COM_ACS_URL = 'COM_ACS_URL' // acs域名
|
export const COM_ACS_IP = 'COM_ACS_IP' // acs域名
|
||||||
export const COM_IMG_IP = 'COM_IMG_IP' // 图片域名地址
|
export const COM_IMG_IP = 'COM_IMG_IP' // 图片域名地址
|
||||||
export const COM_PRINT_URL = 'COM_PRINT_URL' // 标签打印地址
|
export const COM_PRINT_URL = 'COM_PRINT_URL' // 标签打印地址
|
||||||
export const COM_BILL_PRINT_URL = 'COM_BILL_PRINT_URL' // 单据打印地址
|
export const COM_BILL_PRINT_URL = 'COM_BILL_PRINT_URL' // 单据打印地址
|
||||||
|
|||||||
Reference in New Issue
Block a user