login.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751
  1. <template>
  2. <view style="height: 100vh;width: 100vw;background-color: #fff;padding-top: 120rpx;box-sizing: border-box;">
  3. <view class="head-image">
  4. <image src="/static/image/logo1.png" mode="heightFix" />
  5. </view>
  6. <view v-if="false" style="padding: 20rpx;padding-top: 0;margin-bottom: 20rpx;">
  7. <up-tabs :current="current" :activeStyle="{
  8. color: '#2979FF',
  9. fontWeight: 'bold',
  10. lineColor: '#2979FF',
  11. transform: 'scale(1.05)'
  12. }" :list="list1" @change="changeTabs"></up-tabs>
  13. </view>
  14. <block v-if="current == 0">
  15. <view class="input-box">
  16. <view class="content">
  17. <picker class="picker" mode="selector" :range="countryCodes" range-key="name" :value="countryCode"
  18. @change="changeCountryCode">
  19. {{ countryCode }}
  20. </picker>
  21. <input type="number" :value="phonenumber" :focus="focused == 'phonenumber'"
  22. @input="onInput($event, 'phonenumber')" placeholder="请输入手机号" class="input" />
  23. </view>
  24. </view>
  25. <view class="input-box" style="margin-top:70rpx;">
  26. <view class="content">
  27. <input type="number" :value="password" :focus="focused == 'password'"
  28. @input="onInput($event, 'password')" placeholder="请输入验证码" class="input" />
  29. <view class="auth-code" @click="getAuthCode">
  30. {{ downTime == 0 ? '获取验证码' : downTime + "S" }}
  31. </view>
  32. </view>
  33. </view>
  34. <My-button :customStyle="customStyle" class="my-but" :loading="loading" :disabled="disabled" text="登录"
  35. @onClick="logIn" />
  36. </block>
  37. <block v-else>
  38. <view class="input-box">
  39. <view class="content">
  40. <view class="iconfont icon-zhanghao" style="margin-right: 30rpx;" />
  41. <input type="text" :value="accountno" @input="onInput($event, 'accountno')" placeholder="账号"
  42. class="input" />
  43. </view>
  44. </view>
  45. <view class="input-box" style="margin-top:40rpx;">
  46. <view class="content">
  47. <view class="iconfont icon-mima" style="margin-right: 30rpx;" />
  48. <input type="password" password="true" :value="password1" @input="onInput($event, 'password1')"
  49. placeholder="密码" class="input" />
  50. </view>
  51. </view>
  52. <view class="input-box" style="margin-top:40rpx;">
  53. <view class="content">
  54. <view class="iconfont icon-duanxinyanzheng" style="margin-right: 30rpx;" />
  55. <input type="text" :value="imagecaptcha" @input="onInput($event, 'imagecaptcha')"
  56. placeholder="登录验证码" class="input" />
  57. <image v-if="timestamp" style="width: 200rpx;" :src="imageUrl" @click="changeTimestamp"
  58. mode="widthFix" />
  59. </view>
  60. </view>
  61. <view style="height: 20rpx;">
  62. </view>
  63. <up-checkbox class="checkbox" usedAlone v-model:checked="remember" label="记住密码" color="#276BF0" />
  64. <My-button :customStyle="customStyle" class="my-but" :loading="loading" :disabled="disabled2" text="登录"
  65. @onClick="accLogIn" />
  66. </block>
  67. <view class="agreement-box">
  68. <up-checkbox label="已阅读并同意" name="agree" usedAlone v-model:checked="isAgreement" />
  69. <view @click="checkTheAgreement" style="color: #3874F6;">
  70. 《隐私协议》
  71. </view>
  72. </view>
  73. <up-modal negativeTop="100" asyncClose :show="showModal" confirmColor="#052E5D" showCancelButton
  74. confirmText="阅读并获取" @confirm="onConfirm1" @cancel="showModal = false">
  75. <view class="modal-u">请阅读并同意<text style="color: #3874F6;" @click="checkTheAgreement">《隐私协议》</text></view>
  76. </up-modal>
  77. <!-- 正式无需使用 -->
  78. <up-picker title="选择站点" :show="account_list.length != 0" :columns="account_list" keyName="sitename"
  79. @cancel="onCancel" @confirm='onConfirm' />
  80. </view>
  81. </template>
  82. <script setup>
  83. import { ref, reactive, getCurrentInstance, computed } from 'vue'
  84. import { onLoad } from '@dcloudio/uni-app';
  85. const { $Http } = getCurrentInstance().proxy;
  86. let list1 = reactive([
  87. { name: '手机号登录' },
  88. { name: '账号登录' },
  89. ]),
  90. current = ref(1);
  91. function changeTabs({ index }) {
  92. current.value = index
  93. }
  94. // 表单相关
  95. const focused = ref('');
  96. const countryCode = ref('+86');
  97. const phonenumber = ref('');
  98. const password = ref('');
  99. const accountno = ref('');
  100. const password1 = ref('');
  101. const imagecaptcha = ref('');
  102. onLoad(() => {
  103. const storedPhone = uni.getStorageSync('phonenumber');
  104. const accountno1 = uni.getStorageSync('accountno');
  105. accountno.value = accountno1;
  106. const password12 = uni.getStorageSync('accountnoPwd');
  107. password1.value = password12;
  108. if (storedPhone) {
  109. phonenumber.value = storedPhone;
  110. isAgreement.value = true;
  111. }
  112. });
  113. // 登陆按钮相关
  114. const loading = ref(false);
  115. const disabled = computed(() => {
  116. return !(phonenumber.value.length > 0 && password.value.length >= 4);
  117. });
  118. const disabled2 = computed(() => {
  119. return !(accountno.value.length > 0 && password1.value.length >= 4 && imagecaptcha.value.length > 0);
  120. });
  121. const customStyle = ref({
  122. width: '380rpx',
  123. margin: '120rpx auto 0',
  124. });
  125. const countryCodes = reactive([
  126. { code: '+86', name: '中国 +86', regex: /^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\d{8}$/ }, // 中国手机号验证规则
  127. { code: '+1', name: '美国 +1', regex: /^[2-9]\d{2}[2-9](?!11)\d{6}$/ }, // 美国手机号验证规则
  128. { code: '+44', name: '英国 +44', regex: /^7\d{9}$/ }, // 英国手机号验证规则
  129. ]);
  130. function onInput(e, name) {
  131. const inputMap = {
  132. phonenumber: phonenumber,
  133. accountno: accountno,
  134. password: password,
  135. password1: password1,
  136. imagecaptcha: imagecaptcha,
  137. };
  138. if (inputMap[name]) {
  139. inputMap[name].value = e.detail.value;
  140. }
  141. }
  142. let timestamp = ref(Date.now()),
  143. imageUrl = ref(null);
  144. function changeTimestamp() {
  145. timestamp.value = Date.now();
  146. imagecaptcha.value = '';
  147. uni.downloadFile({
  148. url: 'https://crm.meida.com:16691/yos/rest/index/imagecaptcha?timestamp=' + timestamp.value, //仅为示例,并非真实的资源
  149. success: (res) => {
  150. imageUrl.value = res.tempFilePath;
  151. $Http._handleSessionCookies(res)
  152. }
  153. });
  154. }
  155. uni.downloadFile({
  156. url: 'https://crm.meida.com:16691/yos/rest/index/imagecaptcha?timestamp=' + timestamp.value, //仅为示例,并非真实的资源
  157. success: (res) => {
  158. imageUrl.value = res.tempFilePath;
  159. $Http._handleSessionCookies(res)
  160. }
  161. });
  162. function validatephonenumber() {
  163. const selectedCountry = countryCodes.find(country => country.code === countryCode.value);
  164. if (!selectedCountry || !selectedCountry.regex.test(phonenumber.value)) {
  165. uni.showToast({
  166. title: `请输入有效的${selectedCountry ? selectedCountry.name.split(" ")[0] + '号码' : '手机号'}`,
  167. icon: 'none',
  168. });
  169. focused.value = 'phonenumber'; // 聚焦输入框
  170. return false;
  171. }
  172. return true;
  173. }
  174. function changeCountryCode(e) {
  175. countryCode.value = countryCodes[e.detail.value].code;
  176. if (phonenumber.value) validatephonenumber();
  177. }
  178. // 验证码相关
  179. let countDown = null;
  180. const downTime = ref(0); // 倒计时初始值
  181. function getAuthCode() {
  182. if (downTime.value > 0) return;
  183. if (!validatephonenumber()) return;
  184. $Http.getpassword({ "phonenumber": phonenumber.value, "systemclient": "wmeidaserve" }).then(res => {
  185. console.log('获取验证码结果:', res);
  186. if (res.code == 1) {
  187. downTime.value = 60;
  188. countDown = setInterval(() => {
  189. downTime.value--;
  190. if (downTime.value <= 0) {
  191. clearInterval(countDown);
  192. downTime.value = 0;
  193. }
  194. }, 1000);
  195. if (res.msg.indexOf('手机验证码为:') != -1) {
  196. const code = res.msg.split('手机验证码为:');
  197. if (code[1]) {
  198. password.value = code[1].trim(); // 自动填充验证码
  199. } else {
  200. focused.value = 'password'; // 聚焦输入框
  201. }
  202. }
  203. } else {
  204. uni.showToast({
  205. title: res.msg,
  206. icon: 'none',
  207. });
  208. }
  209. })
  210. }
  211. function logIn() {
  212. if (!validatephonenumber()) return;
  213. if (isAgreement.value == false) return showModal.value = true;
  214. loading.value = true;
  215. $Http.plogin({ "phonenumber": phonenumber.value, "password": hexMD5(password.value), "systemclient": "wmeidaserve" }).then(res => {
  216. if (res.code == 1) {
  217. if (res.account_list.length == 1) {
  218. handleLogin(res.account_list[0]);
  219. } else {
  220. account_list = reactive([res.account_list]);
  221. }
  222. } else {
  223. loading.value = false;
  224. uni.showToast({
  225. title: res.msg,
  226. icon: 'none',
  227. });
  228. }
  229. })
  230. }
  231. async function accLogIn() {
  232. if ($Http.baseUrl == "https://crm.meida.com:16691") {
  233. if (isAgreement.value == false) return showModal.value = true;
  234. loading.value = true;
  235. const s = $Http.baseUrl == "https://crm.meida.com:16691" ? await $Http.OldLogin(`?username=${accountno.value}&password=${encodeURIComponent(password1.value)}`) : {
  236. success: false
  237. };
  238. let res = s.success == true ? await $Http.SSO({
  239. "accountno": s.data.userinfo.username,
  240. "password": s.data.cookie.split("=")[1],
  241. "imagecaptcha": imagecaptcha.value || '',
  242. "systemclient": "wmeidaserve"
  243. }) : await $Http.login({ "accountno": accountno.value, "imagecaptcha": imagecaptcha.value, "password": hexMD5(password1.value), "systemclient": "wmeidaserve" });
  244. if (res.code == 1) {
  245. if (res.remindchangepassword) return uni.showModal({
  246. title: '提示',
  247. content: '当前密码为系统初始化密码,请修改后重新登录',
  248. showCancel: false,
  249. confirmText: "前去修改",
  250. complete: () => {
  251. uni.removeStorageSync('accountno');
  252. uni.setStorageSync('accountno', accountno.value);
  253. uni.navigateTo({
  254. url: '/pages/index/changePassword?token=' + res.account_list[0].token
  255. })
  256. $Http.claerPassword = function () {
  257. phonenumber.value = '';
  258. }.bind(this);
  259. loading.value = false;
  260. }
  261. })
  262. if (res.account_list.length == 1) {
  263. handleLogin1(res.account_list[0]);
  264. } else {
  265. account_list = reactive([res.account_list]);
  266. }
  267. } else {
  268. loading.value = false;
  269. imagecaptcha.value = '';
  270. changeTimestamp();
  271. uni.showToast({
  272. title: res.msg,
  273. icon: 'none',
  274. });
  275. }
  276. } else {
  277. let res = await $Http.login({ "accountno": accountno.value, "imagecaptcha": imagecaptcha.value, "password": hexMD5(password1.value), "systemclient": "wmeidaserve" });
  278. if (res.code == 1) {
  279. if (res.remindchangepassword) return uni.showModal({
  280. title: '提示',
  281. content: '当前密码为系统初始化密码,请修改后重新登录',
  282. showCancel: false,
  283. confirmText: "前去修改",
  284. complete: () => {
  285. uni.removeStorageSync('accountno');
  286. uni.setStorageSync('accountno', accountno.value);
  287. uni.navigateTo({
  288. url: '/pages/index/changePassword?token=' + res.account_list[0].token
  289. })
  290. $Http.claerPassword = function () {
  291. phonenumber.value = '';
  292. }.bind(this);
  293. loading.value = false;
  294. }
  295. })
  296. if (res.account_list.length == 1) {
  297. handleLogin1(res.account_list[0]);
  298. } else {
  299. account_list = reactive([res.account_list]);
  300. }
  301. } else {
  302. loading.value = false;
  303. imagecaptcha.value = '';
  304. changeTimestamp();
  305. uni.showToast({
  306. title: res.msg,
  307. icon: 'none',
  308. });
  309. }
  310. }
  311. }
  312. function onCancel() {
  313. account_list = reactive([]);
  314. }
  315. function onConfirm(e) {
  316. handleLogin(e.value[0]);
  317. account_list = reactive([]);
  318. }
  319. function handleLogin(data) {
  320. $Http.base({
  321. "id": 2025072809441203,
  322. "content": {
  323. "customerphone": phonenumber.value,
  324. siteid: data.siteid || 'MD'
  325. }
  326. }).then(res => {
  327. console.log("登录结果:", res);
  328. loading.value = false;
  329. if (res.code == 1) {
  330. uni.removeStorageSync('userMsg');
  331. uni.setStorageSync('userMsg', data);
  332. uni.removeStorageSync('phonenumber');
  333. uni.setStorageSync('phonenumber', phonenumber.value);
  334. uni.redirectTo({
  335. url: '/pages/index/index',
  336. });
  337. $Http.basic({
  338. "classname": "webmanage.site.site",
  339. "method": "querySite_Parameter", //查询站点数据
  340. content: {
  341. nocache: true
  342. }
  343. }).then(res => {
  344. if (res.code == 1) {
  345. uni.removeStorageSync('siteP');
  346. uni.setStorageSync("siteP", res.data)
  347. }
  348. })
  349. } else {
  350. uni.showToast({
  351. title: res.msg,
  352. icon: 'none',
  353. });
  354. }
  355. })
  356. }
  357. let account_list = reactive([]);
  358. let remember = ref(uni.getStorageSync('remember') || false);
  359. async function handleLogin1(data) {
  360. loading.value = false;
  361. uni.removeStorageSync('userMsg');
  362. uni.setStorageSync('userMsg', data);
  363. uni.removeStorageSync('accountno');
  364. uni.setStorageSync('accountno', accountno.value);
  365. uni.setStorageSync('remember', remember.value);
  366. if (remember.value) {
  367. uni.removeStorageSync('accountnoPwd');
  368. uni.setStorageSync('accountnoPwd', password1.value);
  369. } else {
  370. uni.removeStorageSync('accountnoPwd');
  371. uni.setStorageSync('accountnoPwd', '');
  372. }
  373. let auth = false && uni.getStorageSync("userAuth");
  374. if (auth) {
  375. console.log("使用缓存权限")
  376. $Http.basic({
  377. "classname": "sysmanage.develop.userauth.userauth",
  378. "method": "query_userauth", //获取用户权限
  379. content: {
  380. nocache: true
  381. }
  382. }).then(res => {
  383. if (!res.data.length) {
  384. uni.showToast({
  385. title: '当前用户无使用权限,请联系管理员',
  386. icon: 'none',
  387. });
  388. } else {
  389. uni.removeStorageSync('isAdmin');
  390. uni.removeStorageSync('isViewSkus');
  391. uni.removeStorageSync('userAuth');
  392. uni.setStorageSync('userAuth', res.data)
  393. try {
  394. let app = res.data.find(v => v.system == "service").modules.find(v => v.systemmodule == "wserve").apps.find(v => v.name == "wxchatserve").meta.auth.map(v => v.option);
  395. uni.setStorageSync('isAdmin', app.includes('admin'));
  396. uni.setStorageSync('isViewSkus', app.includes('skus'));
  397. } catch (error) {
  398. console.log(error)
  399. uni.setStorageSync('isAdmin', false);
  400. uni.setStorageSync('isViewSkus', false);
  401. }
  402. }
  403. })
  404. uni.redirectTo({
  405. url: '/pages/index/index',
  406. });
  407. } else {
  408. console.log("重新获取权限")
  409. $Http.basic({
  410. "classname": "sysmanage.develop.userauth.userauth",
  411. "method": "query_userauth", //获取用户权限
  412. content: {
  413. nocache: true
  414. }
  415. }).then(res => {
  416. if (!res.data.length) {
  417. uni.showToast({
  418. title: '当前用户无使用权限,请联系管理员',
  419. icon: 'none',
  420. });
  421. } else {
  422. uni.removeStorageSync('isAdmin');
  423. uni.removeStorageSync('isViewSkus');
  424. uni.removeStorageSync('isWork');
  425. uni.removeStorageSync('userAuth');
  426. uni.setStorageSync('userAuth', res.data)
  427. try {
  428. let app = res.data.find(v => v.system == "service").modules.find(v => v.systemmodule == "wserve").apps.find(v => v.name == "wxchatserve").meta.auth.map(v => v.option);
  429. uni.setStorageSync('isAdmin', app.includes('admin'));
  430. uni.setStorageSync('isViewSkus', app.includes('skus'));
  431. uni.setStorageSync('isWork', app.includes('work'));
  432. } catch (error) {
  433. console.log(error)
  434. uni.setStorageSync('isAdmin', false);
  435. uni.setStorageSync('isViewSkus', false);
  436. uni.setStorageSync('isWork', false);
  437. }
  438. uni.redirectTo({
  439. url: '/pages/index/index',
  440. });
  441. }
  442. })
  443. }
  444. $Http.basic({
  445. "classname": "webmanage.site.site",
  446. "method": "querySite_Parameter", //查询站点数据
  447. content: {
  448. nocache: true
  449. }
  450. }).then(res => {
  451. if (res.code == 1) {
  452. uni.removeStorageSync('siteP');
  453. uni.setStorageSync("siteP", res.data)
  454. }
  455. })
  456. }
  457. //隐私协议相关
  458. const isAgreement = ref(false);
  459. const showModal = ref(false);
  460. if ($Http.baseUrl != "https://crm.meida.com:16691") {
  461. imagecaptcha.value = '8888';
  462. isAgreement.value = true;
  463. }
  464. function checkTheAgreement() {
  465. uni.showLoading({
  466. title: "加载中...",
  467. });
  468. uni.downloadFile({
  469. url: 'https://crm.meida.com:16691/yos/rest/tool/attachment/download/YOSSYS/202512021764653461493B1119e706.docx',
  470. success: (res) => {
  471. uni.openDocument({
  472. filePath: res.tempFilePath,
  473. fileType: "docx",
  474. success: (s) => {
  475. uni.hideLoading();
  476. },
  477. fail: (err) => {
  478. console.log("openDocument", err);
  479. uni.hideLoading();
  480. uni.showToast({
  481. title: "读取失败,请稍后再试",
  482. icon: "none",
  483. });
  484. },
  485. });
  486. },
  487. fail: (err) => {
  488. console.log("downloadFile", err);
  489. uni.hideLoading();
  490. uni.showToast({
  491. title: "读取失败,请稍后再试",
  492. icon: "none",
  493. });
  494. },
  495. });
  496. }
  497. function onConfirm1() {
  498. showModal.value = false;
  499. isAgreement.value = true;
  500. if (current.value == 0) {
  501. logIn()
  502. } else {
  503. accLogIn()
  504. };
  505. }
  506. /* 以下为MD5加密 */
  507. function hexMD5(str) {
  508. return binl2hex(coreMD5(str2binl(str)))
  509. }
  510. function safe_add(x, y) {
  511. var lsw = (x & 0xFFFF) + (y & 0xFFFF)
  512. var msw = (x >> 16) + (y >> 16) + (lsw >> 16)
  513. return (msw << 16) | (lsw & 0xFFFF)
  514. }
  515. function rol(num, cnt) {
  516. return (num << cnt) | (num >>> (32 - cnt))
  517. }
  518. function cmn(q, a, b, x, s, t) {
  519. return safe_add(rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b)
  520. }
  521. function ff(a, b, c, d, x, s, t) {
  522. return cmn((b & c) | ((~b) & d), a, b, x, s, t)
  523. }
  524. function gg(a, b, c, d, x, s, t) {
  525. return cmn((b & d) | (c & (~d)), a, b, x, s, t)
  526. }
  527. function hh(a, b, c, d, x, s, t) {
  528. return cmn(b ^ c ^ d, a, b, x, s, t)
  529. }
  530. function ii(a, b, c, d, x, s, t) {
  531. return cmn(c ^ (b | (~d)), a, b, x, s, t)
  532. }
  533. function coreMD5(x) {
  534. var a = 1732584193
  535. var b = -271733879
  536. var c = -1732584194
  537. var d = 271733878
  538. for (var i = 0; i < x.length; i += 16) {
  539. var olda = a
  540. var oldb = b
  541. var oldc = c
  542. var oldd = d
  543. a = ff(a, b, c, d, x[i + 0], 7, -680876936)
  544. d = ff(d, a, b, c, x[i + 1], 12, -389564586)
  545. c = ff(c, d, a, b, x[i + 2], 17, 606105819)
  546. b = ff(b, c, d, a, x[i + 3], 22, -1044525330)
  547. a = ff(a, b, c, d, x[i + 4], 7, -176418897)
  548. d = ff(d, a, b, c, x[i + 5], 12, 1200080426)
  549. c = ff(c, d, a, b, x[i + 6], 17, -1473231341)
  550. b = ff(b, c, d, a, x[i + 7], 22, -45705983)
  551. a = ff(a, b, c, d, x[i + 8], 7, 1770035416)
  552. d = ff(d, a, b, c, x[i + 9], 12, -1958414417)
  553. c = ff(c, d, a, b, x[i + 10], 17, -42063)
  554. b = ff(b, c, d, a, x[i + 11], 22, -1990404162)
  555. a = ff(a, b, c, d, x[i + 12], 7, 1804603682)
  556. d = ff(d, a, b, c, x[i + 13], 12, -40341101)
  557. c = ff(c, d, a, b, x[i + 14], 17, -1502002290)
  558. b = ff(b, c, d, a, x[i + 15], 22, 1236535329)
  559. a = gg(a, b, c, d, x[i + 1], 5, -165796510)
  560. d = gg(d, a, b, c, x[i + 6], 9, -1069501632)
  561. c = gg(c, d, a, b, x[i + 11], 14, 643717713)
  562. b = gg(b, c, d, a, x[i + 0], 20, -373897302)
  563. a = gg(a, b, c, d, x[i + 5], 5, -701558691)
  564. d = gg(d, a, b, c, x[i + 10], 9, 38016083)
  565. c = gg(c, d, a, b, x[i + 15], 14, -660478335)
  566. b = gg(b, c, d, a, x[i + 4], 20, -405537848)
  567. a = gg(a, b, c, d, x[i + 9], 5, 568446438)
  568. d = gg(d, a, b, c, x[i + 14], 9, -1019803690)
  569. c = gg(c, d, a, b, x[i + 3], 14, -187363961)
  570. b = gg(b, c, d, a, x[i + 8], 20, 1163531501)
  571. a = gg(a, b, c, d, x[i + 13], 5, -1444681467)
  572. d = gg(d, a, b, c, x[i + 2], 9, -51403784)
  573. c = gg(c, d, a, b, x[i + 7], 14, 1735328473)
  574. b = gg(b, c, d, a, x[i + 12], 20, -1926607734)
  575. a = hh(a, b, c, d, x[i + 5], 4, -378558)
  576. d = hh(d, a, b, c, x[i + 8], 11, -2022574463)
  577. c = hh(c, d, a, b, x[i + 11], 16, 1839030562)
  578. b = hh(b, c, d, a, x[i + 14], 23, -35309556)
  579. a = hh(a, b, c, d, x[i + 1], 4, -1530992060)
  580. d = hh(d, a, b, c, x[i + 4], 11, 1272893353)
  581. c = hh(c, d, a, b, x[i + 7], 16, -155497632)
  582. b = hh(b, c, d, a, x[i + 10], 23, -1094730640)
  583. a = hh(a, b, c, d, x[i + 13], 4, 681279174)
  584. d = hh(d, a, b, c, x[i + 0], 11, -358537222)
  585. c = hh(c, d, a, b, x[i + 3], 16, -722521979)
  586. b = hh(b, c, d, a, x[i + 6], 23, 76029189)
  587. a = hh(a, b, c, d, x[i + 9], 4, -640364487)
  588. d = hh(d, a, b, c, x[i + 12], 11, -421815835)
  589. c = hh(c, d, a, b, x[i + 15], 16, 530742520)
  590. b = hh(b, c, d, a, x[i + 2], 23, -995338651)
  591. a = ii(a, b, c, d, x[i + 0], 6, -198630844)
  592. d = ii(d, a, b, c, x[i + 7], 10, 1126891415)
  593. c = ii(c, d, a, b, x[i + 14], 15, -1416354905)
  594. b = ii(b, c, d, a, x[i + 5], 21, -57434055)
  595. a = ii(a, b, c, d, x[i + 12], 6, 1700485571)
  596. d = ii(d, a, b, c, x[i + 3], 10, -1894986606)
  597. c = ii(c, d, a, b, x[i + 10], 15, -1051523)
  598. b = ii(b, c, d, a, x[i + 1], 21, -2054922799)
  599. a = ii(a, b, c, d, x[i + 8], 6, 1873313359)
  600. d = ii(d, a, b, c, x[i + 15], 10, -30611744)
  601. c = ii(c, d, a, b, x[i + 6], 15, -1560198380)
  602. b = ii(b, c, d, a, x[i + 13], 21, 1309151649)
  603. a = ii(a, b, c, d, x[i + 4], 6, -145523070)
  604. d = ii(d, a, b, c, x[i + 11], 10, -1120210379)
  605. c = ii(c, d, a, b, x[i + 2], 15, 718787259)
  606. b = ii(b, c, d, a, x[i + 9], 21, -343485551)
  607. a = safe_add(a, olda)
  608. b = safe_add(b, oldb)
  609. c = safe_add(c, oldc)
  610. d = safe_add(d, oldd)
  611. }
  612. return [a, b, c, d]
  613. }
  614. function binl2hex(binarray) {
  615. var hex_tab = "0123456789abcdef"
  616. var str = ""
  617. for (var i = 0; i < binarray.length * 4; i++) {
  618. str += hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8 + 4)) & 0xF) +
  619. hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8)) & 0xF)
  620. }
  621. return str
  622. }
  623. function str2binl(str) {
  624. var nblk = ((str.length + 8) >> 6) + 1 // number of 16-word blocks
  625. var blks = new Array(nblk * 16)
  626. for (var i = 0; i < nblk * 16; i++) blks[i] = 0
  627. for (var i = 0; i < str.length; i++)
  628. blks[i >> 2] |= (str.charCodeAt(i) & 0xFF) << ((i % 4) * 8)
  629. blks[i >> 2] |= 0x80 << ((i % 4) * 8)
  630. blks[nblk * 16 - 2] = str.length * 8
  631. return blks
  632. }
  633. </script>
  634. <style lang="scss" scoped>
  635. .checkbox {
  636. margin-left: 60rpx;
  637. font-family: Microsoft YaHei, Microsoft YaHei;
  638. font-size: 28rpx;
  639. color: #333333;
  640. }
  641. .head-image {
  642. display: flex;
  643. justify-content: center;
  644. height: 148rpx;
  645. margin-bottom: 60rpx;
  646. image {
  647. height: 100%;
  648. }
  649. }
  650. .input-box {
  651. width: 630rpx;
  652. padding-bottom: 20rpx;
  653. margin: 0 auto;
  654. border-bottom: 1px solid #dcdcdc;
  655. box-sizing: border-box;
  656. .content {
  657. display: flex;
  658. justify-content: space-between;
  659. align-items: center;
  660. height: 48rpx;
  661. width: 100%;
  662. .picker {
  663. font-family: Microsoft YaHei, Microsoft YaHei;
  664. font-weight: bold;
  665. font-size: 32rpx;
  666. color: #333333;
  667. margin-right: 20rpx;
  668. }
  669. .input {
  670. flex: 1;
  671. }
  672. .auth-code {
  673. margin-left: 20rpx;
  674. font-family: Microsoft YaHei, Microsoft YaHei;
  675. font-weight: bold;
  676. font-size: 28rpx;
  677. color: #3874F6;
  678. }
  679. }
  680. }
  681. .my-but {
  682. width: 380rpx;
  683. }
  684. .agreement-box {
  685. position: fixed;
  686. bottom: 80rpx;
  687. width: 100%;
  688. display: flex;
  689. justify-content: center;
  690. align-items: center;
  691. up-checkbox {
  692. font-family: Microsoft YaHei, Microsoft YaHei;
  693. font-weight: bold;
  694. font-size: 28rpx;
  695. color: #333333;
  696. }
  697. }
  698. </style>