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

登录接口联调

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