acs地址
This commit is contained in:
@@ -4,14 +4,14 @@
|
||||
<view class="zd_content">
|
||||
<view class="zd_wrapper">
|
||||
<view class="setup-item">
|
||||
<view class="setup-label">服务器地址</view>
|
||||
<view class="setup-label">LMS地址</view>
|
||||
<input type="text" class="setup-input" placeholder="请输入服务器地址" v-model="addrip">
|
||||
</view>
|
||||
<!-- <view class="setup-item">
|
||||
<view class="setup-item">
|
||||
<view class="setup-label">ACS地址</view>
|
||||
<input type="text" class="setup-input" placeholder="请输入ACS地址" v-model="acsip">
|
||||
</view>
|
||||
<view class="setup-item">
|
||||
<!-- <view class="setup-item">
|
||||
<view class="setup-label">刷新时间(s)</view>
|
||||
<input type="text" class="setup-input" placeholder="请输入刷新时间" v-model="setTime">
|
||||
</view> -->
|
||||
@@ -45,18 +45,18 @@
|
||||
_submit () {
|
||||
if (this.addrip === '') {
|
||||
uni.showToast({
|
||||
title: '请填写服务器地址',
|
||||
title: '请填写LMS地址',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (this.acsip === '') {
|
||||
uni.showToast({
|
||||
title: '请填写ACS地址',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
// if (this.acsip === '') {
|
||||
// uni.showToast({
|
||||
// title: '请填写ACS地址',
|
||||
// icon: 'none'
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
// if (this.setTime === '') {
|
||||
// uni.showToast({
|
||||
// title: '请填写刷新时间',
|
||||
|
||||
@@ -128,6 +128,7 @@ export const rgfjskTask = (code) => request({
|
||||
// 1.1 1.1 查询无指令的任务(任务号为-开头)
|
||||
export const handTasks = (key, scode, ncode) => request({
|
||||
url:'api/hand/tasks',
|
||||
acsurl: true,
|
||||
data: {
|
||||
keyword: key,
|
||||
start_devicecode: scode,
|
||||
@@ -137,6 +138,7 @@ export const handTasks = (key, scode, ncode) => request({
|
||||
// 1.2 任务操作
|
||||
export const handTaskoperation = (type, id) => request({
|
||||
url:'api/hand/taskoperation',
|
||||
acsurl: true,
|
||||
data: {
|
||||
type: type,
|
||||
task_uuid: id
|
||||
@@ -149,6 +151,7 @@ export const handTaskoperation = (type, id) => request({
|
||||
// 1.1 查询未完成指令(生成任务号为-开头)
|
||||
export const handInsts = (key, scode, ncode) => request({
|
||||
url:'api/hand/insts',
|
||||
acsurl: true,
|
||||
data: {
|
||||
keyword: key,
|
||||
start_devicecode: scode,
|
||||
@@ -158,6 +161,7 @@ export const handInsts = (key, scode, ncode) => request({
|
||||
// 1.2 指令操作
|
||||
export const handInst = (type, id) => request({
|
||||
url:'api/hand/inst',
|
||||
acsurl: true,
|
||||
data: {
|
||||
type: type,
|
||||
inst_uuid: id
|
||||
|
||||
@@ -5,6 +5,7 @@ const request = (params) => {
|
||||
let url = params.url;
|
||||
let method = params.method || 'POST';
|
||||
let data = params.data || {};
|
||||
let acsurl = params.acsurl
|
||||
// data.token = "default-access_token"
|
||||
// if (!params.token) {
|
||||
// let token = uni.getStorageSync('token');
|
||||
@@ -34,7 +35,10 @@ const request = (params) => {
|
||||
}
|
||||
// data = qs.stringify(data)
|
||||
}
|
||||
const requestUrl = `${store.getters.baseUrl}/` + url;
|
||||
let requestUrl = `${store.getters.baseUrl}/` + url;
|
||||
if (acsurl) {
|
||||
requestUrl = `${store.getters.acsUrl}/` + url;
|
||||
}
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
});
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import * as types from '../types'
|
||||
|
||||
const baseUrl = process.env.NODE_ENV === 'development' ? 'http://10.1.3.90:8010' : 'http://10.1.3.90:8010'
|
||||
const acsUrl = process.env.NODE_ENV === 'development' ? 'http://10.1.3.90:8010' : 'http://10.1.3.90:8010'
|
||||
const state = {
|
||||
baseUrl: uni.getStorageSync('baseUrl') || baseUrl,
|
||||
acsUrl: uni.getStorageSync('acsUrl') || acsUrl,
|
||||
setTime: uni.getStorageSync('setTime') || 5000,
|
||||
setPrintName: uni.getStorageSync('setPrintName') || '',
|
||||
loginName: uni.getStorageSync('loginName') ? uni.getStorageSync('loginName') : '',
|
||||
@@ -11,6 +13,7 @@ const state = {
|
||||
}
|
||||
const getters = {
|
||||
baseUrl: state => state.baseUrl,
|
||||
acsUrl: state => state.acsUrl,
|
||||
setTime: state => state.setTime,
|
||||
setPrintName: state => state.setPrintName,
|
||||
loginName: state => state.loginName,
|
||||
@@ -20,6 +23,7 @@ const getters = {
|
||||
const actions = {
|
||||
setConfig ({commit}, res) {
|
||||
uni.setStorageSync('baseUrl', res.baseUrl)
|
||||
uni.setStorageSync('acsUrl', res.acsUrl)
|
||||
uni.setStorageSync('setTime', res.setTime)
|
||||
uni.setStorageSync('setPrintName', res.setPrintName)
|
||||
commit(types.COM_CONFIG, res)
|
||||
@@ -49,6 +53,7 @@ const actions = {
|
||||
const mutations = {
|
||||
[types.COM_CONFIG] (state, res) {
|
||||
state.baseUrl = res.baseUrl
|
||||
state.acsUrl = res.acsUrl
|
||||
state.setTime = res.setTime
|
||||
state.setPrintName = res.setPrintName
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user