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

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

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