Commit 6c53cb2b by fengzhaoyu

fix:login minguserId ===>username

parent 6d50c0f3
const login = () => {
const app = getApp()
let mingUserId = dd.getStorageSync({ key: 'mingUserId' }).data
let username = dd.getStorageSync({ key: 'username' }).data
// 有token
if(dd.getStorageSync({ key: 'token' }).data && dd.getStorageSync({ key: 'token' }).data.access_token) {
let hasToken = dd.getStorageSync({ key: 'token' }).data; // token
......@@ -92,8 +93,8 @@ const login = () => {
'Content-Type': 'application/x-www-form-urlencoded'
},
data: {
username: mingUserId,
password: mingUserId,
username: username,
password: username,
scope: 'server',
grant_type: 'password'
},
......
......@@ -54,10 +54,13 @@ Page({
method: 'POST',
dataType: 'json',
success: function(res) {
console.log(res,'11111111')
if(res.data.resultCode == 0) {
const data = res.data.data
dd.setStorageSync({
key: 'username',
data: data.username
})
dd.setStorageSync({
key: 'mingUserId',
data: data.mingUserId
})
......
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