This commit is contained in:
PQZ 2024-08-29 12:44:18 +08:00
parent 204b0c1ab9
commit 655d45a160
3 changed files with 14 additions and 8 deletions

View File

@ -2,8 +2,8 @@
module.exports = { module.exports = {
// baseUrl: 'https://vue.ruoyi.vip/prod-api', // baseUrl: 'https://vue.ruoyi.vip/prod-api',
baseUrl: 'https://www.nuoyunr.com/jx', imagesUrl: 'http://localhost:48080/admin-api',
imagesUrl: 'https://www.nuoyunr.com/jx', baseUrl: 'http://localhost:48080/admin-api',
// baseUrl: 'http://192.168.31.54:8016/jx', // baseUrl: 'http://192.168.31.54:8016/jx',
// imagesUrl: 'http://192.168.31.54:8016/jx', // imagesUrl: 'http://192.168.31.54:8016/jx',
// 应用信息 // 应用信息

View File

@ -55,6 +55,7 @@
<script> <script>
import request from '../../utils/request'; import request from '../../utils/request';
import config from '@/config'
import { import {
setToken setToken
} from '@/utils/auth.js' } from '@/utils/auth.js'
@ -160,6 +161,8 @@
}, },
getPhone(e) { getPhone(e) {
console.log('执行了'); console.log('执行了');
config.header = config.header || {}
config.header['Tenant-Id'] = '1'
if (this.privacyPolicyChecked == false) { if (this.privacyPolicyChecked == false) {
uni.showToast({ uni.showToast({
icon: "none", icon: "none",
@ -171,8 +174,9 @@
uni.checkSession({ uni.checkSession({
success: () => { success: () => {
uni.request({ uni.request({
url: this.baseUrl + "/wxLoginJc", url: this.baseUrl + "/rescue/wxLogin",
method: "POST", method: "POST",
header: config.header,
data: { data: {
code: uni.getStorageSync('c1'), code: uni.getStorageSync('c1'),
encryptedIv: e.detail.iv, encryptedIv: e.detail.iv,
@ -182,11 +186,12 @@
}, },
success: (rex) => { success: (rex) => {
console.log('yongdao返回', rex) console.log('yongdao返回', rex)
if (rex.data.code == 200) { if (rex.data.code == 0) {
if (this.loginStatus) { // if (this.loginStatus) {
clearInterval(this.loginStatus) // clearInterval(this.loginStatus)
} // }
uni.setStorageSync('App-Token', rex.data.token); uni.setStorageSync('App-Token', rex.data.token);
debugger
if (this.returnUrl) { if (this.returnUrl) {
uni.navigateBack() uni.navigateBack()
} else { } else {
@ -229,7 +234,7 @@
userinfo() { userinfo() {
console.log('执行了'); console.log('执行了');
request({ request({
url: '/getAppInfo', url: '/jx/auth/getAppInfo',
method: 'get', method: 'get',
}).then((res) => { }).then((res) => {

View File

@ -17,6 +17,7 @@ const request = config => {
// 是否需要设置 token // 是否需要设置 token
const isToken = (config.headers || {}).isToken === false const isToken = (config.headers || {}).isToken === false
config.header = config.header || {} config.header = config.header || {}
config.header['Tenant-Id'] = '1'
if (getToken() && !isToken) { if (getToken() && !isToken) {
config.header['Authorization'] = 'Bearer ' + getToken() config.header['Authorization'] = 'Bearer ' + getToken()
} }