Commit f39b2d21 authored by chuan.liu's avatar chuan.liu

登录接口联调

parent eeec3e8d
{
"name" : "五粮液APP",
"appid" : "__UNI__343534B",
"description" : "订货系统",
"versionName" : "1.0.0",
"versionCode" : "100",
"transformPx" : false,
"app-plus" : {
"name": "五粮液APP",
"appid": "__UNI__343534B",
"description": "订货系统",
"versionName": "1.0.0",
"versionCode": "100",
"transformPx": false,
"app-plus": {
/* 5+App特有相关 */
"usingComponents" : true,
"nvueCompiler" : "uni-app",
"nvueStyleCompiler" : "uni-app",
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,
"delay" : 0
"usingComponents": true,
"nvueCompiler": "uni-app",
"nvueStyleCompiler": "uni-app",
"splashscreen": {
"alwaysShowBeforeRender": true,
"waiting": true,
"autoclose": true,
"delay": 0
},
"nvue" : {
"flex-direction" : "row"
"nvue": {
"flex-direction": "row"
},
"modules" : {},
"modules": {},
/* 模块配置 */
"distribute" : {
"distribute": {
/* 应用发布信息 */
"android" : {
"android": {
/* android打包配置 */
"permissions" : [
"permissions": [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
......@@ -42,71 +42,71 @@
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
],
"abiFilters" : [ "armeabi-v7a" ]
"abiFilters": ["armeabi-v7a"]
},
"ios" : {},
"ios": {},
/* ios打包配置 */
"sdkConfigs" : {
"ad" : {}
"sdkConfigs": {
"ad": {}
},
"icons" : {
"android" : {
"hdpi" : "unpackage/res/icons/72x72.png",
"xhdpi" : "unpackage/res/icons/96x96.png",
"xxhdpi" : "unpackage/res/icons/144x144.png",
"xxxhdpi" : "unpackage/res/icons/192x192.png"
"icons": {
"android": {
"hdpi": "unpackage/res/icons/72x72.png",
"xhdpi": "unpackage/res/icons/96x96.png",
"xxhdpi": "unpackage/res/icons/144x144.png",
"xxxhdpi": "unpackage/res/icons/192x192.png"
},
"ios" : {
"appstore" : "unpackage/res/icons/1024x1024.png",
"ipad" : {
"app" : "unpackage/res/icons/76x76.png",
"app@2x" : "unpackage/res/icons/152x152.png",
"notification" : "unpackage/res/icons/20x20.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"proapp@2x" : "unpackage/res/icons/167x167.png",
"settings" : "unpackage/res/icons/29x29.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"spotlight" : "unpackage/res/icons/40x40.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png"
"ios": {
"appstore": "unpackage/res/icons/1024x1024.png",
"ipad": {
"app": "unpackage/res/icons/76x76.png",
"app@2x": "unpackage/res/icons/152x152.png",
"notification": "unpackage/res/icons/20x20.png",
"notification@2x": "unpackage/res/icons/40x40.png",
"proapp@2x": "unpackage/res/icons/167x167.png",
"settings": "unpackage/res/icons/29x29.png",
"settings@2x": "unpackage/res/icons/58x58.png",
"spotlight": "unpackage/res/icons/40x40.png",
"spotlight@2x": "unpackage/res/icons/80x80.png"
},
"iphone" : {
"app@2x" : "unpackage/res/icons/120x120.png",
"app@3x" : "unpackage/res/icons/180x180.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"notification@3x" : "unpackage/res/icons/60x60.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"settings@3x" : "unpackage/res/icons/87x87.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png",
"spotlight@3x" : "unpackage/res/icons/120x120.png"
"iphone": {
"app@2x": "unpackage/res/icons/120x120.png",
"app@3x": "unpackage/res/icons/180x180.png",
"notification@2x": "unpackage/res/icons/40x40.png",
"notification@3x": "unpackage/res/icons/60x60.png",
"settings@2x": "unpackage/res/icons/58x58.png",
"settings@3x": "unpackage/res/icons/87x87.png",
"spotlight@2x": "unpackage/res/icons/80x80.png",
"spotlight@3x": "unpackage/res/icons/120x120.png"
}
}
}
}
},
/* SDK配置 */
"quickapp" : {},
"quickapp": {},
/* 快应用特有相关 */
"mp-weixin" : {
"mp-weixin": {
/* 小程序特有相关 */
"appid" : "",
"setting" : {
"urlCheck" : false
"appid": "",
"setting": {
"urlCheck": false
},
"usingComponents" : true
"usingComponents": true
},
"h5" : {
"devServer" : {
"https" : false,
"port" : "8080",
"disableHostCheck" : true,
"proxy" : {
"/sap" : {
"target" : "http://10.0.134.45:8000",
"changeOrigin" : true
"h5": {
"devServer": {
"https": false,
"port": "8080",
"disableHostCheck": true,
"proxy": {
"/sap": {
"target": "http://10.0.134.45:8000",
"changeOrigin": true
},
"/crm-app" : {
"target" : "http://10.0.135.139:8080",
"changeOrigin" : true
"/crm-app": {
"target": "http://10.0.135.139",
"changeOrigin": true
}
}
}
......
......@@ -92,12 +92,12 @@
CUSTOMER = [{
SIGN: 'I',
OPTION: 'EQ',
LOW: this.userInfo.customerCode,
LOW: this.userInfo.code,
HIGH: ''
}]
}
const params = {
'USER_BP': '0050000215' || this.userInfo.customerCode,
'USER_BP': this.userInfo.code,
ROLE: 'WLY001',
CUSTOMER,
}
......
......@@ -81,7 +81,7 @@
'height': `${this.sysinfo.safeArea.top + 44}px`
}
},
...mapState(['sysinfo'])
...mapState(['sysinfo', 'userInfo'])
},
onLoad(option) {
console.log('select-saleplan', option)
......@@ -103,6 +103,7 @@
}, 600);
},
created() {
this.condition.PARTNER = this.userInfo.code
this.reset()
this.getAddress(true)
},
......
......@@ -209,7 +209,7 @@
// 初始化订单数据
async initGroupData() {
const params = {
'PARTNER': this.userInfo.customerCode
'PARTNER': this.userInfo.code
}
const res = await apiInitGroupData(params)
const {
......
......@@ -64,7 +64,7 @@
}
},
computed: {
...mapState(['groupOrder']),
...mapState(['groupOrder', 'userInfo']),
imageStyles() {
return {
width: 64,
......@@ -87,7 +87,7 @@
INFO,
ITEM,
ATTACHMENT,
"USER_BP": "0081000010",
"USER_BP": this.userInfo.code || "0081000010",
"ROLE": "WLYALL"
}
const res = await apiUpdateGroupOrder(params)
......@@ -104,7 +104,7 @@
"INFO": INFO2,
'ITEM': ITEM2,
"ATTACHMENT": ATTACHMENT2,
"USER_BP": "0081000010",
"USER_BP": this.userInfo.code || "0081000010",
"ROLE": "WLYALL"
}
const res2 = await apiUpdateGroupOrder(params2)
......
......@@ -220,7 +220,7 @@
methods: {
async getHomeStatistics() {
const res = await apiGetHomeStatistics({
PARTNER: this.userInfo.customerCode
PARTNER: this.userInfo.code
})
let {
DATA
......
......@@ -57,8 +57,8 @@
export default {
data() {
return {
account: '',
password: '',
account: '0050000215',
password: 'DO1tjHPW0Z',
phone: '',
code: '',
loginType: 'password',
......@@ -92,19 +92,19 @@
}
},
onLoad(option) {
console.log('login-option', option)
this.loginType = this.option?.loginType || 'password'
if (this.loginType === 'password') {
const {
account,
password
} = this.userInfo
this.account = account
this.password = password
// this.goLogin()
} else {
this.code = this.option.code
}
// console.log('login-option', option)
// this.loginType = this.option?.loginType || 'password'
// if (this.loginType === 'password') {
// const {
// account,
// password
// } = this.userInfo
// this.account = account
// this.password = password
// // this.goLogin()
// } else {
// this.code = this.option.code
// }
},
methods: {
// 切换密码可见性
......@@ -120,20 +120,21 @@
} else {
const ispass = await this.validate();
if (!ispass) return;
const parmas = {
username: '0050000215',
password: 'DO1tjHPW0Z',
username: this.account,
password: this.password,
loginType: 'App'
}
// const res = await apiLogin(parmas)
const res = {
status: 1
}
if (res) {
const res = await apiLogin(parmas)
// const res = {
// status: 1
// }
if (res.status === 1) {
this.$uStore({
name: 'userInfo',
value: {
customerCode: '0050000215'
...res.data.operator
}
});
uni.switchTab({
......
......@@ -137,12 +137,12 @@
CUSTOMER = [{
SIGN: 'I',
OPTION: 'EQ',
LOW: this.userInfo.customerCode,
LOW: this.userInfo.code,
HIGH: ''
}]
}
const params = {
'USER_BP': '4000000105' || this.userInfo.customerCode,
'USER_BP': this.userInfo.code || '4000000105',
ROLE: 'WLY001',
CUSTOMER,
POSTING_DATE,
......
......@@ -84,7 +84,7 @@
.title-info__status {
height: 48rpx;
line-height: 48rpx;
line-height: 44rpx;
background: #f61d30;
border-radius: 80rpx 200rpx 200rpx 80rpx;
border: 1px solid #f61d30;
......@@ -104,7 +104,7 @@
.item-block-btn__text {
width: 100rpx;
height: 48rpx;
line-height: 48rpx;
line-height: 44rpx;
font-size: 12px;
color: #fff;
}
......
......@@ -97,11 +97,11 @@
}
},
computed: {
...mapState(['sysinfo'])
...mapState(['sysinfo', 'userInfo'])
},
created() {
this.pullTimer = null;
this.condition.USER_BP = this.userInfo.code
this._isWidescreen = false;
this.loadData()
},
......
......@@ -172,7 +172,7 @@
// 初始化订单数据
async initNoQuotaData() {
const params = {
'PARTNER': this.userInfo.customerCode
'PARTNER': this.userInfo.code
}
const res = await apiInitNoQuotaData(params)
const {
......
......@@ -127,7 +127,7 @@
'top': `${this.sysinfo.safeArea.top + 120}px`
}
},
...mapState(['sysinfo'])
...mapState(['sysinfo', 'userInfo'])
},
onNavigationBarButtonTap(e) {
console.log('onNavigationBarButtonTap:', e);
......@@ -137,7 +137,7 @@
},
created() {
this.pullTimer = null;
this.condition.PARTNER = this.userInfo.code
this._isWidescreen = false;
this.loadData()
},
......
......@@ -198,7 +198,7 @@
// 初始化订单数据
async initProduceMaterialPlanData() {
const params = {
'PARTNER': this.userInfo.customerCode
'PARTNER': this.userInfo.code
}
const res = await apiProduceMaterialPlanInit(params)
const {
......@@ -322,7 +322,7 @@
async submit() {
const params = {
USER_BP: this.userInfo.customerCode,
USER_BP: this.userInfo.code,
HEAD: this.HEADINFO,
ITEM: this.planinnerLists
}
......@@ -334,7 +334,7 @@
} = res
const params2 = {
USER_BP: this.userInfo.customerCode,
USER_BP: this.userInfo.code,
HEAD: HEAD2,
ITEM: ITEM2
}
......
......@@ -133,7 +133,7 @@
'top': `${this.sysinfo.safeArea.top + 120}px`
}
},
...mapState(['sysinfo'])
...mapState(['sysinfo', 'userInfo'])
},
onNavigationBarButtonTap(e) {
console.log('onNavigationBarButtonTap:', e);
......@@ -143,7 +143,7 @@
},
created() {
this.pullTimer = null;
this.condition.PARTNER = this.userInfo.code
this._isWidescreen = false;
this.loadData()
},
......
......@@ -182,7 +182,7 @@
// 初始化订单数据
async initProducePlanData() {
const params = {
'PARTNER': this.userInfo.customerCode
'PARTNER': this.userInfo.code
}
const res = await apiProducePlanInit(params)
const {
......@@ -337,6 +337,7 @@
this.$refs.popup.open('center')
},
resetData() {
this.$refs.popup.close()
this.planinnerLists = []
this.salesCenterIndex = -1
this.selectedSalesCenter = {}
......
......@@ -135,7 +135,7 @@
}
},
computed: {
...mapState(['sysinfo']),
...mapState(['sysinfo', 'userInfo']),
navHeight() {
return {
'height': `${this.sysinfo.safeArea.top + 44}px`
......@@ -163,6 +163,7 @@
},
created() {
this.condition.RT_GJAHR[0].LOW = timeFormat(new Date(), 'yyyy')
this.condition.MV_BP = this.userInfo.code
this.reset()
this.getSalesPlanTypes(true);
},
......
......@@ -261,7 +261,7 @@
// 初始化订单数据
async initQuotaData() {
const params = {
'PARTNER': this.userInfo.customerCode
'PARTNER': this.userInfo.code
}
const res = await apiInitQuotaData(params)
const {
......
......@@ -181,7 +181,7 @@
}
const params = {
...this.page,
'PARTNER': this.userInfo.customerCode,
'PARTNER': this.userInfo.code,
SHORT,
PRODUCT_ID,
}
......
......@@ -97,11 +97,11 @@
}
},
computed: {
...mapState(['sysinfo'])
...mapState(['sysinfo', 'userInfo'])
},
created() {
this.pullTimer = null;
this.condition.PARTNER = this.userInfo.code
this._isWidescreen = false;
this.loadData()
},
......
......@@ -5,8 +5,8 @@
<view class="userinfo">
<image class="avatar" src="@/static/image/avatar@3x.png" mode=""></image>
<view class="nick-block">
<text class="nick-block--name">{{userInfo.username || '苏州新川商贸有限公司'}}</text>
<text class="nick-block--no">编号:{{userInfo.customerCode}}</text>
<text class="nick-block--name">{{userInfo.name || '苏州新川商贸有限公司'}}</text>
<text class="nick-block--no">编号:{{userInfo.code}}</text>
</view>
</view>
<view class="amount-card">
......@@ -147,7 +147,7 @@
methods: {
async getBpPrice() {
const res = await apiGetBpPrice({
PARTNER: this.userInfo.customerCode
PARTNER: this.userInfo.code
})
this.bpPrice = res.DATA
},
......
......@@ -146,7 +146,7 @@ class Request {
// 请求后的拦截
response: (res) => {
console.log('interceptor---response-----', res)
if (res.MSGTYPE === 'S' || res.msgtype === 'S') {
if (res.MSGTYPE === 'S' || res.msgtype === 'S' || res.status === 1) {
// 如果把originalData设置为了true,这里return回什么,this.$u.post的then回调中就会得到什么
return res;
} else {
......
......@@ -38,8 +38,8 @@ const install = (Vue, vm) => {
http.interceptor.response = (res) => {
// 如果把originalData设置为了true,这里得到将会是服务器返回的所有的原始数据
// 判断可能变成了res.statueCode,或者res.data.code之类的,请打印查看结果
console.log('response-----', res)
if (res.MSGTYPE === 'S' || res.msgtype === 'S') {
console.log('interceptor---response-----', res)
if (res.MSGTYPE === 'S' || res.msgtype === 'S' || res.status === 1) {
// 如果把originalData设置为了true,这里return回什么,this.$u.post的then回调中就会得到什么
return res;
} else {
......
......@@ -6,7 +6,9 @@ import apiHelper from './api.helper.js'
* @returns {Promise<AxiosResponse<T>>}
*/
export async function apiLogin(params) {
const res = await apiHelper.post('/crm-app/login', params)
const res = await apiHelper.post('/crm-app/login', params, {
'content-type': "application/x-www-form-urlencoded"
})
return res
}
......
......@@ -39,9 +39,8 @@ const store = new Vuex.Store({
vuex_version: '1.0.1',
vuex_demo: '绛紫',
userInfo: {
username: '苏州新川商贸有限公司',
password: '',
customerCode: '' || '0050000215'
name: '',
code: ''
},
quotaOrder: {
'ITEM_INNER': [],
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
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