| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- import {
- HTTP
- } from './Http.js'
- class ApiModel extends HTTP {
- devicevaluecheck(data) {
- data.accesstoken = uni.getStorageSync('userMsg').token || '';
- return this.request({
- url: "/simple/devicevaluecheck",
- data
- })
- }
- loginbywechat(data) {
- return this.request({
- url: "/index/loginbywechat",
- data
- })
- }
- /* 登录 */
- login(data) {
- return this.request({
- url: "/index/loginbyaccount",
- data
- })
- }
- /* 老CRM登录 */
- OldLogin(data) {
- return this.getRequest({
- url: 'https://crm.meida.com/dmsService/rest/login' + data
- })
- }
- SSO(data) {
- return this.request({
- data,
- suffix: 'https://crm.meida.com:16691/yos/rest/sso/crm'
- })
- }
- /* 验证码登录 */
- plogin(data) {
- return this.request({
- url: "/index/login",
- data
- })
- }
- /* 获取验证码 */
- getpassword(data) {
- return this.request({
- url: "/index/getpassword",
- data
- })
- }
- /* 有状态通用 */
- basic(data, loading = true) {
- data.accesstoken = uni.getStorageSync('userMsg').token;
- return this.request({
- url: "/index",
- data,
- loading
- })
- }
- getClass(typename) {
- return this.basic({
- "classname": "sysmanage.develop.optiontype.optiontype",
- "method": "optiontypeselect",
- "content": {
- "typename": typename
- }
- })
- }
- /* 无状态 */
- base(data, loading = true) {
- return this.request({
- url: "/index",
- data,
- loading
- })
- }
- /* 退出登录 */
- logout() {
- let data = {
- accesstoken: uni.getStorageSync('userMsg').token
- }
- return this.request({
- url: "/index/logout",
- data
- })
- }
- /* 获取地区code */
- getLocationCode() {
- return this.request({
- url: "/index/getforward?url=" + encodeURIComponent("http://www.nmc.cn/rest/position"),
- data: {},
- method: "GET",
- header: {
- "Access-Control-Allow-Origin": "*"
- }
- })
- }
- }
- export {
- ApiModel
- }
|