|
|
@@ -57,9 +57,8 @@
|
|
|
<view class="iconfont icon-duanxinyanzheng" style="margin-right: 30rpx;" />
|
|
|
<input type="text" :value="imagecaptcha" @input="onInput($event, 'imagecaptcha')"
|
|
|
placeholder="登录验证码" class="input" />
|
|
|
- <image v-if="timestamp" style="width: 200rpx;"
|
|
|
- :src="`https://crm.meida.com:16691/yos/rest/index/imagecaptcha?timestamp=${timestamp}`"
|
|
|
- @click="changeTimestamp" mode="widthFix" />
|
|
|
+ <image v-if="timestamp" style="width: 200rpx;" :src="imageUrl" @click="changeTimestamp"
|
|
|
+ mode="widthFix" />
|
|
|
</view>
|
|
|
</view>
|
|
|
<view style="height: 20rpx;">
|
|
|
@@ -156,12 +155,29 @@ function onInput(e, name) {
|
|
|
inputMap[name].value = e.detail.value;
|
|
|
}
|
|
|
}
|
|
|
-let timestamp = ref(Date.now());
|
|
|
+let timestamp = ref(Date.now()),
|
|
|
+ imageUrl = ref(null);
|
|
|
|
|
|
function changeTimestamp() {
|
|
|
timestamp.value = Date.now();
|
|
|
+ imagecaptcha.value = '';
|
|
|
+ uni.downloadFile({
|
|
|
+ url: 'https://crm.meida.com:16691/yos/rest/index/imagecaptcha?timestamp=' + timestamp.value, //仅为示例,并非真实的资源
|
|
|
+ success: (res) => {
|
|
|
+ imageUrl.value = res.tempFilePath;
|
|
|
+ $Http._handleSessionCookies(res)
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
+uni.downloadFile({
|
|
|
+ url: 'https://crm.meida.com:16691/yos/rest/index/imagecaptcha?timestamp=' + timestamp.value, //仅为示例,并非真实的资源
|
|
|
+ success: (res) => {
|
|
|
+ imageUrl.value = res.tempFilePath;
|
|
|
+ $Http._handleSessionCookies(res)
|
|
|
+ }
|
|
|
+});
|
|
|
+
|
|
|
function validatephonenumber() {
|
|
|
const selectedCountry = countryCodes.find(country => country.code === countryCode.value);
|
|
|
if (!selectedCountry || !selectedCountry.regex.test(phonenumber.value)) {
|
|
|
@@ -186,7 +202,7 @@ const downTime = ref(0); // 倒计时初始值
|
|
|
function getAuthCode() {
|
|
|
if (downTime.value > 0) return;
|
|
|
if (!validatephonenumber()) return;
|
|
|
- $Http.getpassword({ "phonenumber": phonenumber.value, "systemclient": "wechatsaletool" }).then(res => {
|
|
|
+ $Http.getpassword({ "phonenumber": phonenumber.value, "systemclient": "wmeidaserve" }).then(res => {
|
|
|
console.log('获取验证码结果:', res);
|
|
|
if (res.code == 1) {
|
|
|
downTime.value = 60;
|
|
|
@@ -216,7 +232,7 @@ function logIn() {
|
|
|
if (!validatephonenumber()) return;
|
|
|
if (isAgreement.value == false) return showModal.value = true;
|
|
|
loading.value = true;
|
|
|
- $Http.plogin({ "phonenumber": phonenumber.value, "password": hexMD5(password.value), "systemclient": "wechatsaletool" }).then(res => {
|
|
|
+ $Http.plogin({ "phonenumber": phonenumber.value, "password": hexMD5(password.value), "systemclient": "wmeidaserve" }).then(res => {
|
|
|
if (res.code == 1) {
|
|
|
if (res.account_list.length == 1) {
|
|
|
handleLogin(res.account_list[0]);
|
|
|
@@ -236,9 +252,7 @@ function logIn() {
|
|
|
async function accLogIn() {
|
|
|
if (isAgreement.value == false) return showModal.value = true;
|
|
|
loading.value = true;
|
|
|
-
|
|
|
- let isRelease = uni.getAccountInfoSync().miniProgram.envVersion == 'release';
|
|
|
- const s = isRelease ? await $Http.OldLogin(`?username=${accountno.value}&password=${encodeURIComponent(password1.value)}`) : {
|
|
|
+ const s = $Http.baseUrl == "https://crm.meida.com:16691" ? await $Http.OldLogin(`?username=${accountno.value}&password=${encodeURIComponent(password1.value)}`) : {
|
|
|
success: false
|
|
|
};
|
|
|
console.log("单点登录", s)
|
|
|
@@ -246,8 +260,8 @@ async function accLogIn() {
|
|
|
"accountno": s.data.userinfo.username,
|
|
|
"password": s.data.cookie.split("=")[1],
|
|
|
"imagecaptcha": imagecaptcha.value || '',
|
|
|
- "systemclient": "wechatsaletool"
|
|
|
- }) : await $Http.login({ "accountno": accountno.value, "imagecaptcha": imagecaptcha.value, "password": hexMD5(password1.value), "systemclient": "wechatsaletool" });
|
|
|
+ "systemclient": "wmeidaserve"
|
|
|
+ }) : await $Http.login({ "accountno": accountno.value, "imagecaptcha": imagecaptcha.value, "password": hexMD5(password1.value), "systemclient": "wmeidaserve" });
|
|
|
|
|
|
if (res.code == 1) {
|
|
|
if (res.remindchangepassword) return uni.showModal({
|
|
|
@@ -349,9 +363,25 @@ function handleLogin1(data) {
|
|
|
uni.setStorageSync('accountnoPwd', '');
|
|
|
}
|
|
|
|
|
|
- uni.redirectTo({
|
|
|
- url: '/pages/index/index',
|
|
|
- });
|
|
|
+
|
|
|
+ $Http.basic({
|
|
|
+ "classname": "sysmanage.develop.userauth.userauth",
|
|
|
+ "method": "query_userauth", //获取用户权限
|
|
|
+ content: {
|
|
|
+ nocache: true
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ if (!res.data.length) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '当前用户无使用权限,请联系管理员',
|
|
|
+ icon: 'none',
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ uni.redirectTo({
|
|
|
+ url: '/pages/index/index',
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
|
|
|
$Http.basic({
|
|
|
"classname": "webmanage.site.site",
|