Commit c3b9f3cb authored by 沈翠玲's avatar 沈翠玲

自动更新改成选择公司后请求

parent b6c0f4e5
<script>
import i18n from './lang/index'
import checkappupdate from 'common/checkappupdate.js'
export default {
onLaunch: function () {
// #ifdef APP-PLUS
......@@ -10,17 +9,7 @@ export default {
// plus.screen.lockOrientation("landscape-primary");
// 锁定竖屏
plus.screen.lockOrientation("portrait-primary");
const fn = () => {
checkappupdate.check({
title: i18n.t('检测到有新版本!'),
content: i18n.t('请升级app到最新版本!'),
canceltext: i18n.t('暂不升级'),
oktext: i18n.t('立即升级')
})
return fn // 函数中返回自身
}
setInterval(fn(), 3600 * 1000)
// #endif
// #endif
},
onShow: function () {
},
......
......@@ -14,10 +14,6 @@ const install = (Vue, vm) => {
// 基础服务:登录登出、身份信息、菜单授权、切换系统、字典数据等
login: (params = {}) => vm.$u.postJson(uni.getStorageSync('apiUrl') + '/login', params),
getExAccountInfoApi: (params = {}) => vm.$u.postJson(config.adminPath + '/common/getExAccountInfo', params),
// 上海环境
// getInfo: (params = {}) => vm.$u.get('http://192.168.1.128:8088' + '/getInfo'),
// 外网环境
// getInfo: (params = {}) => vm.$u.get('http://182.140.132.45:9011' + '/getInfo'),
changepassword: (params = {}) => vm.$u.postJson(uni.getStorageSync('apiUrl') + '/cmsmv/changepassword', params),
// 到货条码打印查询
getforprint: (params = {}) => vm.$u.postJson(uni.getStorageSync('apiUrl') + '/purcc/getforprint', params),
......
......@@ -2,7 +2,7 @@
<view class="login">
<NavBar :title="$t('希迈条码系统')" left=""></NavBar>
<u-form ref="loginForm" :modelValue="loginForm" :rules="loginRules" class="login-form">
<u-form-item prop="username">
<u-form-item prop="company">
<zxz-uni-data-select :clear='false' class="item-select" filterable v-model="loginForm.company"
dataKey="label" dataValue="value" :localdata="factoryData" @change="handleChange"/>
</u-form-item>
......@@ -31,7 +31,7 @@
:loading="loading"
size="medium"
type="primary"
:disabled="!loginForm.username || !loginForm.password"
:disabled="!loginForm.username || !loginForm.password || !loginForm.company"
style="margin-top: 50rpx"
@click="submit()"
>
......@@ -44,6 +44,7 @@
<script>
import i18n from '../../../lang/index'
import checkappupdate from '@/common/checkappupdate.js'
import {setLocal} from '@/lang'
import config from "../../../common/staticConfig";
......@@ -54,7 +55,7 @@ import {setLocal} from '@/lang'
loginForm: {
username: "",
password: "",
company: config.factoryData[0].value
company: null
},
loginRules: {
username: {
......@@ -62,7 +63,6 @@ import {setLocal} from '@/lang'
{ required: true, trigger: "blur", errorMessage: i18n.t('请输入您的账号') }
],
},
password: {
rules: [
{ required: true, trigger: "blur", errorMessage: i18n.t('请输入您的密码') }
......@@ -85,15 +85,20 @@ import {setLocal} from '@/lang'
value: item.id
}
});
this.loginForm.company = this.factoryData[0].value
uni.setStorageSync('mesUrl', this.factoryData[0].mesUrl)
uni.setStorageSync('apiUrl', this.factoryData[0].apiUrl)
})
},
handleChange(val) {
config.baseUrl = val.mesUrl;
uni.setStorageSync('mesUrl', val.mesUrl)
uni.setStorageSync('apiUrl', val.apiUrl)
// #ifdef APP-PLUS
checkappupdate.check({
title: i18n.t('检测到有新版本!'),
content: i18n.t('请升级app到最新版本!'),
canceltext: i18n.t('暂不升级'),
oktext: i18n.t('立即升级')
})
// #endif
},
submit(){
this.$refs.loginForm.validate().then(valid => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment