From e17108966ccfcaee2bef8d981601c79c8716e304 Mon Sep 17 00:00:00 2001 From: whycq <913841844@qq.com> Date: 星期四, 28 三月 2024 13:53:39 +0800 Subject: [PATCH] Merge branch 'demo' of http://47.97.1.152:5880/r/wms_app into demo --- pages/api/common/common.js | 27 +++++++++++++++++++++++++++ 1 files changed, 27 insertions(+), 0 deletions(-) diff --git a/pages/api/common/common.js b/pages/api/common/common.js index e69de29..4b3f3b1 100644 --- a/pages/api/common/common.js +++ b/pages/api/common/common.js @@ -0,0 +1,27 @@ +import md5 from '@/static/js/md5.js' + +async function onLogin(user) { + let _this = this, + item = {}; + var login = await uni.request({ + url: `${baseUrl}/login.action`, + data: { + username: user.username, + password: md5.hex_md5(user.password) + }, + }).then((result) => { + console.log(result); + result = result.data + if (result.code === 200 && result.data.token) { + uni.setStorageSync('token', result.data.token); + } + item = result + }, (res) => { + item = {code: 0} + }) + return item +} + +module.exports = { + onLogin: onLogin +} \ No newline at end of file -- Gitblit v1.9.1